text:
# Networking

There are currently three ways of configuring the network of a container launched by `swarm-launcher`, which are partially mutually-exclusive:

* [LAUNCH_HOST_NETWORK](#launch_host_network)
* [LAUNCH_EXT_NETWORKS](#launch_ext_networks)
* [LAUNCH_NETWORKS](#launch_networks)

## Ingress network

The container started by swarm-launcher does **not** run as a [docker service](https://docs.docker.com/engine/reference/commandline/service/), but as a stand-alone container. Because the [ingress](https://docs.docker.com/engine/swarm/ingress/) network is not [attachable](https://docs.docker.com/network/overlay/#customize-the-default-ingress-network), the only way for a published port to be opened on all nodes is with a proxy service deployed in swarm (for example: [haproxy](https://hub.docker.com/_/haproxy), [traefik](https://docs.traefik.io/)), connected to the same overlay network as the container.

## LAUNCH_HOST_NETWORK

If the option `LAUNCH_HOST_NETWORK` is set, the following other options are ignored:
* `LAUNCH_PORTS`
* `LAUNCH_NETWORKS`
* `LAUNCH_EXT_NETWORKS`

The container then receives the option `network_mode: host` ([link to documentation](https://docs.docker.com/compose/compose-file/#network_mode)).

## LAUNCH_EXT_NETWORKS

This is a **space** separated list of already existing networks. It means, the networks specified here **must** exist when the container is created.

**Warning**: The network **must** be created with the `attachable: true` option!

There are two options here:
* The network gets created **outside** the stack (by using `docker network create`)
* The network gets created by the stack (by specifying `networks` in your stack yml file)

### Example #1:
Let's say, I want to deploy a stack called `ci-runners` for my gitlab pipeline. And I want the network to be created automatically, when deploying the stack:
```yml
version: "3.7"

services:
  runner-launcher:
    deploy:
      mode: global
      restart_policy:
        delay: 5s
      labels:
        ai.ix.auto-update: 'true'
    image: registry.gitlab.com/ix.ai/swarm-launcher:latest
    networks:
      - runners
    volumes:
      - '/var/run/docker.sock:/var/run/docker.sock:rw'
    environment:
      LAUNCH_IMAGE: gitlab/gitlab-runner:alpine
      LAUNCH_PULL: 'true'
      LAUNCH_EXT_NETWORKS: 'ci-runners_runners'
      LAUNCH_CONTAINER_NAME: 'gitlab-ci-runner'
      LAUNCH_PRIVILEGED: 'true'
      LAUNCH_VOLUMES: '/var/run/docker.sock:/var/run/docker.sock:rw /var/storage/docker/gitlab-runner:/etc/gitlab-runner:rw'
      LAUNCH_COMMAND: 'run --listen-address=:9252 --user=gitlab-runner --working-directory=/home/gitlab-runner'
    healthcheck:
      test: ["CMD", "curl", "-f", "http://gitlab-ci-runner:9252/metrics"]
      timeout: 2s
      retries: 3
      start_period: 30s
networks:
  runners:
    driver: bridge
    attachable: true
```
**Note**: The `ai.ix.auto-update: 'true'` label I'm using is for [ix-ai/cioban](/ix-ai/cioban).

As you can see, the value for `LAUNCH_EXT_NETWORKS` is set to `ci-runners_runners`. This is because the stack itself is named `ci-runners` (and gets deployed with `docker stack deploy -c stack.yml ci-runners`) and the network defined in the stack is called `runners`.

### Example #2:
Let's say, I want to deploy a stack called `ci-runners` for my gitlab pipeline. And I want it to be attached to an existing network `traefik-oauth`.

You need to make sure that the existing network allows for containers to be attached to it:
```sh
docker network inspect traefik-oauth|grep Attach
        "Attachable": true,
```

If it doesn't, you need either to create a network that allows attaching ([link to documentation](https://docs.docker.com/engine/reference/commandline/network_create/)), or delete this one and create it again with the `--attachable` option:
```sh
$ docker network rm traefik-web
traefik-web
$ docker network create --attachable --driver overlay --opt encrypted=true traefik-web
vnji34a5jzfvxnotgkznd165c
```

<details>
  <summary>Click to see the command: `docker network inspect traefik-web`</summary>

```json
[
    {
        "Name": "traefik-web",
        "Id": "vnji34a5jzfvxnotgkznd165c",
        "Created": "2020-02-18T06:15:14.190547649Z",
        "Scope": "swarm",
        "Driver": "overlay",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": null,
            "Config": [
                {
                    "Subnet": "<IP_ADDRESS>/24",
                    "Gateway": "<IP_ADDRESS>"
                }
            ]
        },
        "Internal": false,
        "Attachable": true,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": null,
        "Options": {
            "com.docker.network.driver.overlay.vxlanid_list": "4124",
            "encrypted": "true"
        },
        "Labels": null
    }
]
```

</details>

The `stack.yml` only needs then to have the a minimum number of options configured:
```yml
version: "3.7"

services:
  runner-launcher:
    deploy:
      labels:
        ai.ix.auto-update: 'true'
    image: registry.gitlab.com/ix.ai/swarm-launcher:latest
    volumes:
      - '/var/run/docker.sock:/var/run/docker.sock:rw'
    environment:
      LAUNCH_IMAGE: gitlab/gitlab-runner:alpine
      LAUNCH_PULL: 'true'
      LAUNCH_EXT_NETWORKS: 'traefik-web'
      LAUNCH_PRIVILEGED: 'true'
      LAUNCH_VOLUMES: '/var/run/docker.sock:/var/run/docker.sock:rw /var/storage/docker/gitlab-runner:/etc/gitlab-runner:rw'
      LAUNCH_COMMAND: 'run --listen-address=:9252 --user=gitlab-runner --working-directory=/home/gitlab-runner'
```

You deploy it:
```sh
$ docker stack deploy -c stack.yml ci-runners
Creating network ci-runners_default
Creating service ci-runners_runner-launcher
```

And then, let's check the progress (it may take a while):
```sh
$ docker service ls
ID                  NAME                         MODE                REPLICAS            IMAGE                           PORTS
71oyeqy0rnqc        ci-runners_runner-launcher   replicated          1/1                 registry.gitlab.com/ix.ai/swarm-launcher:latest
```

<details>
  <summary>Click to see the command: `docker service inspect --pretty ci-runners_runner-launcher`</summary>

```
ID:		71oyeqy0rnqcilnd9wsgp3juz
Name:		ci-runners_runner-launcher
Labels:
 ai.ix.auto-update=true
 com.docker.stack.image=registry.gitlab.com/ix.ai/swarm-launcher:latest
 com.docker.stack.namespace=ci-runners
Service Mode:	Replicated
 Replicas:	1
Placement:
UpdateConfig:
 Parallelism:	1
 On failure:	pause
 Monitoring Period: 5s
 Max failure ratio: 0
 Update order:      stop-first
RollbackConfig:
 Parallelism:	1
 On failure:	pause
 Monitoring Period: 5s
 Max failure ratio: 0
 Rollback order:    stop-first
ContainerSpec:
 Image:		registry.gitlab.com/ix.ai/swarm-launcher:latest@sha256:2eb4d8fbc67ca15e31a6ed07ac08b3f38c4e82e46abda5c2410cc61b976518d0
 Env:		LAUNCH_COMMAND=run --listen-address=:9252 --user=gitlab-runner --working-directory=/home/gitlab-runner LAUNCH_EXT_NETWORKS=traefik-web LAUNCH_IMAGE=gitlab/gitlab-runner:alpine LAUNCH_PRIVILEGED=true LAUNCH_PULL=true LAUNCH_VOLUMES=/var/run/docker.sock:/var/run/docker.sock:rw /var/storage/docker/gitlab-runner:/etc/gitlab-runner:rw
Mounts:
 Target:	/var/run/docker.sock
  Source:	/var/run/docker.sock
  ReadOnly:	false
  Type:		bind
Resources:
Networks: ci-runners_default
Endpoint Mode:	vip
```

</details>

On the node where `swarm-launcher` is running, you can also see the other container:
```sh
$ docker ps -f label=ai.ix.started-by=ix.ai/swarm-launcher
CONTAINER ID        IMAGE                         COMMAND                  CREATED             STATUS              PORTS               NAMES
4b6ba8fdc720        gitlab/gitlab-runner:alpine   "/usr/bin/dumb-init …"   3 minutes ago       Up 3 minutes                            swarm-launcher_Xbv1eP_1
```

<details>
  <summary>Click to see the command: `docker inspect swarm-launcher_Xbv1eP_1`</summary>

```json
[
    {
        "Id": "4b6ba8fdc7202f0823860b44c7e950112fd6fb0173e6a8bc0d2ff7ba62f26c17",
        "Created": "2020-02-18T06:18:14.523467575Z",
        "Path": "/usr/bin/dumb-init",
        "Args": [
            "/entrypoint",
            "run",
            "--listen-address=:9252",
            "--user=gitlab-runner",
            "--working-directory=/home/gitlab-runner"
        ],
        "State": {
            "Status": "running",
            "Running": true,
            "Paused": false,
            "Restarting": false,
            "OOMKilled": false,
            "Dead": false,
            "Pid": 3749,
            "ExitCode": 0,
            "Error": "",
            "StartedAt": "2020-02-18T06:18:15.631715818Z",
            "FinishedAt": "0001-01-01T00:00:00Z"
        },
        "Image": "sha256:477b30b7fb67f2db80fd2d3846ca071b3327ef0fbb233316cb9c576468ac114d",
        "ResolvConfPath": "/var/lib/docker/containers/4b6ba8fdc7202f0823860b44c7e950112fd6fb0173e6a8bc0d2ff7ba62f26c17/resolv.conf",
        "HostnamePath": "/var/lib/docker/containers/4b6ba8fdc7202f0823860b44c7e950112fd6fb0173e6a8bc0d2ff7ba62f26c17/hostname",
        "HostsPath": "/var/lib/docker/containers/4b6ba8fdc7202f0823860b44c7e950112fd6fb0173e6a8bc0d2ff7ba62f26c17/hosts",
        "LogPath": "/var/lib/docker/containers/4b6ba8fdc7202f0823860b44c7e950112fd6fb0173e6a8bc0d2ff7ba62f26c17/4b6ba8fdc7202f0823860b44c7e950112fd6fb0173e6a8bc0d2ff7ba62f26c17-json.log",
        "Name": "/swarm-launcher_Xbv1eP_1",
        "RestartCount": 0,
        "Driver": "overlay2",
        "Platform": "linux",
        "MountLabel": "",
        "ProcessLabel": "",
        "AppArmorProfile": "",
        "ExecIDs": null,
        "HostConfig": {
            "Binds": [
                "/var/storage/docker/gitlab-runner:/etc/gitlab-runner:rw",
                "/var/run/docker.sock:/var/run/docker.sock:rw"
            ],
            "ContainerIDFile": "",
            "LogConfig": {
                "Type": "json-file",
                "Config": {}
            },
            "NetworkMode": "traefik-web",
            "PortBindings": {},
            "RestartPolicy": {
                "Name": "no",
                "MaximumRetryCount": 0
            },
            "AutoRemove": false,
            "VolumeDriver": "",
            "VolumesFrom": [],
            "CapAdd": null,
            "CapDrop": null,
            "Capabilities": null,
            "Dns": null,
            "DnsOptions": null,
            "DnsSearch": null,
            "ExtraHosts": null,
            "GroupAdd": null,
            "IpcMode": "shareable",
            "Cgroup": "",
            "Links": null,
            "OomScoreAdj": 0,
            "PidMode": "",
            "Privileged": true,
            "PublishAllPorts": false,
            "ReadonlyRootfs": false,
            "SecurityOpt": [
                "label=disable"
            ],
            "UTSMode": "",
            "UsernsMode": "",
            "ShmSize": 67108864,
            "Runtime": "runc",
            "ConsoleSize": [
                0,
                0
            ],
            "Isolation": "",
            "CpuShares": 0,
            "Memory": 0,
            "NanoCpus": 0,
            "CgroupParent": "",
            "BlkioWeight": 0,
            "BlkioWeightDevice": null,
            "BlkioDeviceReadBps": null,
            "BlkioDeviceWriteBps": null,
            "BlkioDeviceReadIOps": null,
            "BlkioDeviceWriteIOps": null,
            "CpuPeriod": 0,
            "CpuQuota": 0,
            "CpuRealtimePeriod": 0,
            "CpuRealtimeRuntime": 0,
            "CpusetCpus": "",
            "CpusetMems": "",
            "Devices": null,
            "DeviceCgroupRules": null,
            "DeviceRequests": null,
            "KernelMemory": 0,
            "KernelMemoryTCP": 0,
            "MemoryReservation": 0,
            "MemorySwap": 0,
            "MemorySwappiness": null,
            "OomKillDisable": false,
            "PidsLimit": null,
            "Ulimits": null,
            "CpuCount": 0,
            "CpuPercent": 0,
            "IOMaximumIOps": 0,
            "IOMaximumBandwidth": 0,
            "MaskedPaths": null,
            "ReadonlyPaths": null
        },
        "GraphDriver": {
            "Data": {
                "LowerDir": "/var/lib/docker/overlay2/bdb9c5c1216c0184e9acb263bb325006149923c0e0a2af14b528489bf5f2a865-init/diff:/var/lib/docker/overlay2/5c50da38b54ea659b8c8a254e0cfde04d2d6f55d2e7dfb332924da60bcd9bdf9/diff:/var/lib/docker/overlay2/235444f533fefd43a3f16c740bdaf9032d276485fd6d4af8e1ed7db9c9f3d220/diff:/var/lib/docker/overlay2/7dcdaad22907ecce5f0be15eecd708ba6403644f4f0d870bc6ec17db1eee38e6/diff:/var/lib/docker/overlay2/20bcd62d82a56a6f33fecc54039776082f3e5f8d19bf0b4d9159eba9c541a9f2/diff:/var/lib/docker/overlay2/fb042eeb41ca21981db662493f63ed8668b0a78e5eafb42564a1933ea500fb1d/diff:/var/lib/docker/overlay2/039617b6dd19553bebb94f8e59eb012efb7c988c6c06565a5054d0c46f063f8a/diff:/var/lib/docker/overlay2/1cd285bc316c710f75976f0aab094b8b166db1ba7784cc83db68bc3e1262985c/diff:/var/lib/docker/overlay2/6a3bb2827ec554171948604936781647709d426953cd86e5995978f7a2ab3d83/diff",
                "MergedDir": "/var/lib/docker/overlay2/bdb9c5c1216c0184e9acb263bb325006149923c0e0a2af14b528489bf5f2a865/merged",
                "UpperDir": "/var/lib/docker/overlay2/bdb9c5c1216c0184e9acb263bb325006149923c0e0a2af14b528489bf5f2a865/diff",
                "WorkDir": "/var/lib/docker/overlay2/bdb9c5c1216c0184e9acb263bb325006149923c0e0a2af14b528489bf5f2a865/work"
            },
            "Name": "overlay2"
        },
        "Mounts": [
            {
                "Type": "bind",
                "Source": "/var/storage/docker/gitlab-runner",
                "Destination": "/etc/gitlab-runner",
                "Mode": "rw",
                "RW": true,
                "Propagation": "rprivate"
            },
            {
                "Type": "bind",
                "Source": "/var/run/docker.sock",
                "Destination": "/var/run/docker.sock",
                "Mode": "rw",
                "RW": true,
                "Propagation": "rprivate"
            },
            {
                "Type": "volume",
                "Name": "6a292b20cb9c39e9875f7c6ca79d8252f8b0913cc12018759ffc6602ff1dfb54",
                "Source": "/var/lib/docker/volumes/6a292b20cb9c39e9875f7c6ca79d8252f8b0913cc12018759ffc6602ff1dfb54/_data",
                "Destination": "/home/gitlab-runner",
                "Driver": "local",
                "Mode": "",
                "RW": true,
                "Propagation": ""
            }
        ],
        "Config": {
            "Hostname": "4b6ba8fdc720",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
            ],
            "Cmd": [
                "run",
                "--listen-address=:9252",
                "--user=gitlab-runner",
                "--working-directory=/home/gitlab-runner"
            ],
            "Image": "gitlab/gitlab-runner:alpine",
            "Volumes": {
                "/etc/gitlab-runner": {},
                "/home/gitlab-runner": {},
                "/var/run/docker.sock": {}
            },
            "WorkingDir": "",
            "Entrypoint": [
                "/usr/bin/dumb-init",
                "/entrypoint"
            ],
            "OnBuild": null,
            "Labels": {
                "ai.ix.started-by": "ix.ai/swarm-launcher",
                "com.docker.compose.config-hash": "528fbccc990e8d462ce6d95f40086034a6ce83be5720ff803b57a6121eb16806",
                "com.docker.compose.container-number": "1",
                "com.docker.compose.oneoff": "False",
                "com.docker.compose.project": "swarm-launcher",
                "com.docker.compose.project.config_files": "docker-compose.yml",
                "com.docker.compose.project.working_dir": "/",
                "com.docker.compose.service": "Xbv1eP",
                "com.docker.compose.version": "1.25.1"
            },
            "StopSignal": "SIGQUIT"
        },
        "NetworkSettings": {
            "Bridge": "",
            "SandboxID": "35b80fea39647f8e55931e2fcfc7c68c910ecaf0bde04170ab0111509d85e75c",
            "HairpinMode": false,
            "LinkLocalIPv6Address": "",
            "LinkLocalIPv6PrefixLen": 0,
            "Ports": {},
            "SandboxKey": "/var/run/docker/netns/35b80fea3964",
            "SecondaryIPAddresses": null,
            "SecondaryIPv6Addresses": null,
            "EndpointID": "",
            "Gateway": "",
            "GlobalIPv6Address": "",
            "GlobalIPv6PrefixLen": 0,
            "IPAddress": "",
            "IPPrefixLen": 0,
            "IPv6Gateway": "",
            "MacAddress": "",
            "Networks": {
                "traefik-web": {
                    "IPAMConfig": {
                        "IPv4Address": "<IP_ADDRESS>"
                    },
                    "Links": null,
                    "Aliases": [
                        "4b6ba8fdc720",
                        "Xbv1eP"
                    ],
                    "NetworkID": "vnji34a5jzfvxnotgkznd165c",
                    "EndpointID": "515cdd7eba1db33047d13fa6d5affb1d950bf67c88c674330bc9b7667ae64c53",
                    "Gateway": "",
                    "IPAddress": "<IP_ADDRESS>",
                    "IPPrefixLen": 24,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "MacAddress": "02:42:0a:00:1c:02",
                    "DriverOpts": null
                }
            }
        }
    }
]
```

</details>

## LAUNCH_NETWORKS

This is a space separated list of networks to be created by swarm-launcher **on the node where it's running**.

The networks are created with the driver `bridge` and will be named according to the name of project (see `LAUNCH_PROJECT_NAME` in [Environment variables](../blob/master/README.md#environment-variables))

### Example #1

I'll reuse the example above, with starting up a GitLab CI Runner.

This would be the `stack.yml` file:
```yml
version: "3.7"

services:
  runner-launcher:
    deploy:
      labels:
        ai.ix.auto-update: 'true'
    image: registry.gitlab.com/ix.ai/swarm-launcher:latest
    volumes:
      - '/var/run/docker.sock:/var/run/docker.sock:rw'
    environment:
      LAUNCH_IMAGE: gitlab/gitlab-runner:alpine
      LAUNCH_PULL: 'true'
      LAUNCH_NETWORKS: 'amazing'
      LAUNCH_PROJECT_NAME: 'ci-runner'
      LAUNCH_PRIVILEGED: 'true'
      LAUNCH_VOLUMES: '/var/run/docker.sock:/var/run/docker.sock:rw /var/storage/docker/gitlab-runner:/etc/gitlab-runner:rw'
      LAUNCH_COMMAND: 'run --listen-address=:9252 --user=gitlab-runner --working-directory=/home/gitlab-runner'
```

Deploy it and then see the networks:
```sh
$ docker stack deploy -c stack.yml ci-runner-starter
Creating network ci-runner-starter_default
Creating service ci-runner-starter_runner-launcher
$ docker network ls
[...]
be26a0a53689        ci-runner_amazing           bridge              local
[...]
```

The network has been created and has the name in the form `$LAUNCH_PROJECT_NAME_$LAUNCH_NETWORKS`.

<details>
  <summary>Click to see the command: `docker network inspect ci-runner_amazing`</summary>

```json
[
    {
        "Name": "ci-runner_amazing",
        "Id": "be26a0a536891a169211b14416de1f47f5dc7b62d42c559fd1c8e30991df51c7",
        "Created": "2020-02-18T07:14:15.038551358Z",
        "Scope": "local",
        "Driver": "bridge",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": null,
            "Config": [
                {
                    "Subnet": "<IP_ADDRESS>/16",
                    "Gateway": "<IP_ADDRESS>"
                }
            ]
        },
        "Internal": false,
        "Attachable": true,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": {
            "112fdfc7489539a630e9cd4a13efe178b96942ef68f365d951ea867c07701828": {
                "Name": "ci-runner_pYd0gd_1",
                "EndpointID": "6dc314afd3fb598256dd0113520d100797c534d1093d35becbde204309b48e85",
                "MacAddress": "02:42:ac:13:00:02",
                "IPv4Address": "<IP_ADDRESS>/16",
                "IPv6Address": ""
            }
        },
        "Options": {},
        "Labels": {
            "com.docker.compose.network": "amazing",
            "com.docker.compose.project": "ci-runner",
            "com.docker.compose.version": "1.25.1"
        }
    }
]
```

</details>

### Example #2

You can even combine `LAUNCH_NETWORKS` and `LAUNCH_EXT_NETWORKS`. Let's add to the stack.yml above also the existing `traefik-web` **attachable** network:

```yml
version: "3.7"

services:
  runner-launcher:
    deploy:
      labels:
        ai.ix.auto-update: 'true'
    image: registry.gitlab.com/ix.ai/swarm-launcher:latest
    volumes:
      - '/var/run/docker.sock:/var/run/docker.sock:rw'
    environment:
      LAUNCH_IMAGE: gitlab/gitlab-runner:alpine
      LAUNCH_PULL: 'true'
      LAUNCH_NETWORKS: 'amazing'
      LAUNCH_EXT_NETWORKS: 'traefik-web'
      LAUNCH_PROJECT_NAME: 'ci-runner'
      LAUNCH_PRIVILEGED: 'true'
      LAUNCH_VOLUMES: '/var/run/docker.sock:/var/run/docker.sock:rw /var/storage/docker/gitlab-runner:/etc/gitlab-runner:rw'
      LAUNCH_COMMAND: 'run --listen-address=:9252 --user=gitlab-runner --working-directory=/home/gitlab-runner'
```

And now, let's deploy it and see the outcome:

```sh
$ docker stack deploy -c stack.yml ci-runner-starter
Updating service ci-runner-starter_runner-launcher (id: jvxr6ukkailli4n6d1lpcbroy)
$ docker ps -f name=ci-runner
CONTAINER ID        IMAGE                           COMMAND                  CREATED              STATUS              PORTS               NAMES
1f859f84aef7        gitlab/gitlab-runner:alpine     "/usr/bin/dumb-init …"   About a minute ago   Up About a minute                       ci-runner_jzwdPf_1
915bc20df741        registry.gitlab.com/ix.ai/swarm-launcher:latest   "/bin/sh -c /entrypo…"   About a minute ago   Up About a minute                       ci-runner-starter_runner-launcher.1.i7qxfidjdd4oo2yb99m8f6en3
```

<details>
  <summary>Click to see the command: `docker inspect ci-runner_jzwdPf_1`</summary>

```json
[
    {
        "Id": "1f859f84aef7faff641c761377f938e0ee91d00768992135e026f8593c65759c",
        "Created": "2020-02-18T07:21:24.671362767Z",
        "Path": "/usr/bin/dumb-init",
        "Args": [
            "/entrypoint",
            "run",
            "--listen-address=:9252",
            "--user=gitlab-runner",
            "--working-directory=/home/gitlab-runner"
        ],
        "State": {
            "Status": "running",
            "Running": true,
            "Paused": false,
            "Restarting": false,
            "OOMKilled": false,
            "Dead": false,
            "Pid": 6311,
            "ExitCode": 0,
            "Error": "",
            "StartedAt": "2020-02-18T07:21:25.68226633Z",
            "FinishedAt": "0001-01-01T00:00:00Z"
        },
        "Image": "sha256:477b30b7fb67f2db80fd2d3846ca071b3327ef0fbb233316cb9c576468ac114d",
        "ResolvConfPath": "/var/lib/docker/containers/1f859f84aef7faff641c761377f938e0ee91d00768992135e026f8593c65759c/resolv.conf",
        "HostnamePath": "/var/lib/docker/containers/1f859f84aef7faff641c761377f938e0ee91d00768992135e026f8593c65759c/hostname",
        "HostsPath": "/var/lib/docker/containers/1f859f84aef7faff641c761377f938e0ee91d00768992135e026f8593c65759c/hosts",
        "LogPath": "/var/lib/docker/containers/1f859f84aef7faff641c761377f938e0ee91d00768992135e026f8593c65759c/1f859f84aef7faff641c761377f938e0ee91d00768992135e026f8593c65759c-json.log",
        "Name": "/ci-runner_jzwdPf_1",
        "RestartCount": 0,
        "Driver": "overlay2",
        "Platform": "linux",
        "MountLabel": "",
        "ProcessLabel": "",
        "AppArmorProfile": "",
        "ExecIDs": null,
        "HostConfig": {
            "Binds": [
                "/var/run/docker.sock:/var/run/docker.sock:rw",
                "/var/storage/docker/gitlab-runner:/etc/gitlab-runner:rw"
            ],
            "ContainerIDFile": "",
            "LogConfig": {
                "Type": "json-file",
                "Config": {}
            },
            "NetworkMode": "ci-runner_amazing",
            "PortBindings": {},
            "RestartPolicy": {
                "Name": "no",
                "MaximumRetryCount": 0
            },
            "AutoRemove": false,
            "VolumeDriver": "",
            "VolumesFrom": [],
            "CapAdd": null,
            "CapDrop": null,
            "Capabilities": null,
            "Dns": null,
            "DnsOptions": null,
            "DnsSearch": null,
            "ExtraHosts": null,
            "GroupAdd": null,
            "IpcMode": "shareable",
            "Cgroup": "",
            "Links": null,
            "OomScoreAdj": 0,
            "PidMode": "",
            "Privileged": true,
            "PublishAllPorts": false,
            "ReadonlyRootfs": false,
            "SecurityOpt": [
                "label=disable"
            ],
            "UTSMode": "",
            "UsernsMode": "",
            "ShmSize": 67108864,
            "Runtime": "runc",
            "ConsoleSize": [
                0,
                0
            ],
            "Isolation": "",
            "CpuShares": 0,
            "Memory": 0,
            "NanoCpus": 0,
            "CgroupParent": "",
            "BlkioWeight": 0,
            "BlkioWeightDevice": null,
            "BlkioDeviceReadBps": null,
            "BlkioDeviceWriteBps": null,
            "BlkioDeviceReadIOps": null,
            "BlkioDeviceWriteIOps": null,
            "CpuPeriod": 0,
            "CpuQuota": 0,
            "CpuRealtimePeriod": 0,
            "CpuRealtimeRuntime": 0,
            "CpusetCpus": "",
            "CpusetMems": "",
            "Devices": null,
            "DeviceCgroupRules": null,
            "DeviceRequests": null,
            "KernelMemory": 0,
            "KernelMemoryTCP": 0,
            "MemoryReservation": 0,
            "MemorySwap": 0,
            "MemorySwappiness": null,
            "OomKillDisable": false,
            "PidsLimit": null,
            "Ulimits": null,
            "CpuCount": 0,
            "CpuPercent": 0,
            "IOMaximumIOps": 0,
            "IOMaximumBandwidth": 0,
            "MaskedPaths": null,
            "ReadonlyPaths": null
        },
        "GraphDriver": {
            "Data": {
                "LowerDir": "/var/lib/docker/overlay2/4690e753634c35aeed7119b2c83e8711a59be8408742d0455df22b39677886e7-init/diff:/var/lib/docker/overlay2/5c50da38b54ea659b8c8a254e0cfde04d2d6f55d2e7dfb332924da60bcd9bdf9/diff:/var/lib/docker/overlay2/235444f533fefd43a3f16c740bdaf9032d276485fd6d4af8e1ed7db9c9f3d220/diff:/var/lib/docker/overlay2/7dcdaad22907ecce5f0be15eecd708ba6403644f4f0d870bc6ec17db1eee38e6/diff:/var/lib/docker/overlay2/20bcd62d82a56a6f33fecc54039776082f3e5f8d19bf0b4d9159eba9c541a9f2/diff:/var/lib/docker/overlay2/fb042eeb41ca21981db662493f63ed8668b0a78e5eafb42564a1933ea500fb1d/diff:/var/lib/docker/overlay2/039617b6dd19553bebb94f8e59eb012efb7c988c6c06565a5054d0c46f063f8a/diff:/var/lib/docker/overlay2/1cd285bc316c710f75976f0aab094b8b166db1ba7784cc83db68bc3e1262985c/diff:/var/lib/docker/overlay2/6a3bb2827ec554171948604936781647709d426953cd86e5995978f7a2ab3d83/diff",
                "MergedDir": "/var/lib/docker/overlay2/4690e753634c35aeed7119b2c83e8711a59be8408742d0455df22b39677886e7/merged",
                "UpperDir": "/var/lib/docker/overlay2/4690e753634c35aeed7119b2c83e8711a59be8408742d0455df22b39677886e7/diff",
                "WorkDir": "/var/lib/docker/overlay2/4690e753634c35aeed7119b2c83e8711a59be8408742d0455df22b39677886e7/work"
            },
            "Name": "overlay2"
        },
        "Mounts": [
            {
                "Type": "bind",
                "Source": "/var/run/docker.sock",
                "Destination": "/var/run/docker.sock",
                "Mode": "rw",
                "RW": true,
                "Propagation": "rprivate"
            },
            {
                "Type": "bind",
                "Source": "/var/storage/docker/gitlab-runner",
                "Destination": "/etc/gitlab-runner",
                "Mode": "rw",
                "RW": true,
                "Propagation": "rprivate"
            },
            {
                "Type": "volume",
                "Name": "8dc99d7b0070d69959d0c35a15e58c00803cef3f8466445d19afc64294bb3cce",
                "Source": "/var/lib/docker/volumes/8dc99d7b0070d69959d0c35a15e58c00803cef3f8466445d19afc64294bb3cce/_data",
                "Destination": "/home/gitlab-runner",
                "Driver": "local",
                "Mode": "",
                "RW": true,
                "Propagation": ""
            }
        ],
        "Config": {
            "Hostname": "1f859f84aef7",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
            ],
            "Cmd": [
                "run",
                "--listen-address=:9252",
                "--user=gitlab-runner",
                "--working-directory=/home/gitlab-runner"
            ],
            "Image": "gitlab/gitlab-runner:alpine",
            "Volumes": {
                "/etc/gitlab-runner": {},
                "/home/gitlab-runner": {},
                "/var/run/docker.sock": {}
            },
            "WorkingDir": "",
            "Entrypoint": [
                "/usr/bin/dumb-init",
                "/entrypoint"
            ],
            "OnBuild": null,
            "Labels": {
                "ai.ix.started-by": "ix.ai/swarm-launcher",
                "com.docker.compose.config-hash": "16f4c8fda111e72937b69623b30b163d0f8e49d9ed0feebd11ef79f6fd94cf75",
                "com.docker.compose.container-number": "1",
                "com.docker.compose.oneoff": "False",
                "com.docker.compose.project": "ci-runner",
                "com.docker.compose.project.config_files": "docker-compose.yml",
                "com.docker.compose.project.working_dir": "/",
                "com.docker.compose.service": "jzwdPf",
                "com.docker.compose.version": "1.25.1"
            },
            "StopSignal": "SIGQUIT"
        },
        "NetworkSettings": {
            "Bridge": "",
            "SandboxID": "188af86224bb161f02692fe77a6ae158d238809831240088e5aa82f76bb97945",
            "HairpinMode": false,
            "LinkLocalIPv6Address": "",
            "LinkLocalIPv6PrefixLen": 0,
            "Ports": {},
            "SandboxKey": "/var/run/docker/netns/188af86224bb",
            "SecondaryIPAddresses": null,
            "SecondaryIPv6Addresses": null,
            "EndpointID": "",
            "Gateway": "",
            "GlobalIPv6Address": "",
            "GlobalIPv6PrefixLen": 0,
            "IPAddress": "",
            "IPPrefixLen": 0,
            "IPv6Gateway": "",
            "MacAddress": "",
            "Networks": {
                "ci-runner_amazing": {
                    "IPAMConfig": null,
                    "Links": null,
                    "Aliases": [
                        "jzwdPf",
                        "1f859f84aef7"
                    ],
                    "NetworkID": "4d407a17e8c948b8ba26caf206ad00f98657ad96c42ee96be13a19e719b78e9b",
                    "EndpointID": "c63bdfa67cc0d8170db60f1e0ce5aa082c4d894f39066ed73001846c4e24706b",
                    "Gateway": "<IP_ADDRESS>",
                    "IPAddress": "<IP_ADDRESS>",
                    "IPPrefixLen": 16,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "MacAddress": "02:42:ac:14:00:02",
                    "DriverOpts": null
                },
                "traefik-web": {
                    "IPAMConfig": {
                        "IPv4Address": "<IP_ADDRESS>"
                    },
                    "Links": null,
                    "Aliases": [
                        "jzwdPf",
                        "1f859f84aef7"
                    ],
                    "NetworkID": "vnji34a5jzfvxnotgkznd165c",
                    "EndpointID": "cfea4017dda43a2af9151f48f41d9b7bf967215feb77a3bd805d00d01876646c",
                    "Gateway": "",
                    "IPAddress": "<IP_ADDRESS>",
                    "IPPrefixLen": 24,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "MacAddress": "02:42:0a:00:1c:04",
                    "DriverOpts": null
                }
            }
        }
    }
]
```

</details>

repository: ix-ai/swarm-launcher

gha_language: Shell

repo_name: ix-ai/swarm-launcher


text:
# [chat-app](https://chat-app-omarewies.netlify.app/)

This is a real-time chat application, I developed it using  [Chat Engine Rest API](https://chatengine.io/).

You can use the following Credentials to [log in](https://chat-app-omarewies.netlify.app/):

* username: asac
* username: asac1
* username: asac2
* username: asac3
* username: asac4
* username: asac5
* password: 123123
FOR ALL THE USERS.

license: MIT

repository: oebitw/chat-app

branch_name: refs/heads/main

extension: md

license_type: permissive

repo_name: oebitw/chat-app


text:
# Garlic Bread

## info
* About 20 minutes
* servings

## ingredients
* 1 loaf Italian bread
* 4 tbsp melted butter
* 4 garlic cloves
* 1 tsp garlic powder
* 1 tsp water
* 1 tsp salt
* 1/4 tsp cayenne pepper (optional)
* 4 tbsp cold butter

## steps
1. Preheat oven to 450ºF
2. Melt 4 tbsp butter
3. Slice garlic cloves in half, remove little green bits, and crush into butter
4. Crush (or microplane) garlic into butter; let cook until warm and mellow
5. Mix garlic powder and water; add to butter along with spices
6. Add cold butter to re-thicken the mixture into a spreadable paste
7. Cut bread into two halves; spread butter paste onto both
8. Place on rimmed baking sheet and cook for about 4 minutes
9. Flip halves and lightly press with a large spatula or another baking sheet
10. Put back in oven for 5–10 minutes, serve hot

## notes
* Other variations and methods in the recipe below

## based on
* https://www.bingingwithbabish.com/recipes/garlic-bread-scott-pilgrim

repository: jeffThompson/Recipes

branch_name: refs/heads/master

gha_language: JavaScript

gha_license_id: MIT

repo_name: jeffThompson/Recipes


text:
# L3Pilot Common Data Format

_Generated by Johannes Hiller on 20-Aug-2019 13:41:09_

## Datasets

### egoVehicle

|Signal name|Array signal name|Data type|Description|
|:---|:---|:---:|---|
| UTCTime |  | native long long | System time in milliseconds since epoch |
| FileTime |  | native double | Time since beginning of recording |
| ABSIntervention |  | enum native signed char | Whether the ABS system is intervening; -1 = not applicable; 0 = ABS system not intervening; 1 = ABS system intervening; 9 = unknown |
| ADFunctionActive |  | enum native signed char | Status of the autonomous driving function; -1 = not applicable; 0 = not active; 1 = active; 9 = unknown |
| ADFunctionAvailable |  | enum native signed char |  Whether the preconditions are met to enable the autonomous driving function; -1 = not applicable; 0 = preconditions not met; 1 = preconditions met; 9 = unknown |
| AmbientLightLevel |  | native double | Ambient light level at the location of the ego vehicle; Measured as the natural log of the raw value (because the range is huge) |
| AmbientTemperature |  | native double | Ambient temperature recorded by the ego vehicles temperature sensor |
| BaselineADASActive |  | native int | The combination of ADAS active in baseline mode, bit-wise encoding; -2 = unknown; -1 = not applicable; 0 = none; Bits:; 1 = CC (Cruise controls); 2 = SRS (Speed restriction system); 3 = ACC (Adaptive cruise controls); 4 = FCW (Forward collision warning); 5 = AEB (Automatic emergency braking); 6 = BLIS (Blind spot information system); 7 = LDW (Lane departure warning); 8 = LKA (Lane keeping assist); 9 = FEA (Fuel efficiency advisor); 10 = ... |
| BaselineADASIntervention |  | native int | The combination of ADAS intervening / showing warnings in baseline mode, bit-wise encoding; -2 = unknown; -1 = not applicable; 0 = none; Bits:; 1 = CC (Cruise controls); 2 = SRS (Speed restriction system); 3 = ACC (Adaptive cruise controls); 4 = FCW (Forward collision warning); 5 = AEB (Automatic emergency braking); 6 = BLIS (Blind spot information system); 7 = LDW (Lane departure warning); 8 = LKA (Lane keeping assist); 9 = FEA (Fuel efficiency advisor); 10 = ... |
| BrakeLight |  | enum native signed char | Status of the brake light.; -1 = not applicable; 0 = off; 1 = on; 2 = flashing; 9 = unknown |
| BrakePedalPos |  | native int | The position of the brake pedal in %.; -1 = not applicable; 0 = not pressed; 100 = fully pressed |
| BrakePressure |  | native int | Brake system pressure in percentage of maximum pressure |
| DirectionIndicator |  | enum native signed char | The status of the turn indicator.; -1 = not applicable; 0 = off; 1 = left; 2 = right; 3 = hazard; 9 = unknown |
| EnergyConsumption |  | native double | Current energy consumption |
| ESCIntervention |  | enum native signed char | Whether the Electronic Slip Control / Traction Control system is intervening; -1=not applicable; 0 = ESC system not intervening; 1 = ESC system intervening; 9 = unknown |
| FrontFogLightStatus |  | enum native signed char | The status of the front fog light; -1 = not applicable; 0 = off; 1 = on; 9 = unknown |
| FrontWiperStatus |  | enum native signed char | The operation state of the front wiper; -1 = not applicable; 0 = off; 1 = slow interval; 2 = fast interval; 3 = slow; 4 = fast; 9 = unknown |
| FuelConsumption |  | native double | Current fuel consumption |
| HandsOnDetection |  | enum native signed char | Whether the driver has their hands on the steering wheel; -1 = not applicable; 0 = hands off; 1 = one hand on; 2 = two hands on; 9 = unknown |
| LatAcceleration |  | native double | lateral acceleration (Y axis) |
| LongAcceleration |  | native double | longitudinal acceleration (X axis) |
| Odometer |  | native double | The vehicle odometer reading |
| RearFogLightStatus |  | enum native signed char | The status of the rear fog light; -1 = not applicable; 0 = off; 1 = on; 9 = unknown |
| SteeringAngle |  | native double | The steering wheel angle.; Turning left (counterclockwise) is positive; Turning right (clockwise) is negative |
| SteeringAngleADF |  | native double | Steering angle desired by the ADF; This can be used to detect whether the driver or the ADF is driving |
| ThrottlePedalPos |  | native int | The position of the throttle pedal in %.; -1 = not applicable; 0 = not pressed; 100 = fully pressed |
| TOR |  | enum native signed char | Whether the take-over-request to return control to the driver is active; -TOR at known system limits; -TOR at unknown system limits (system failures); -1 = not applicable; 0 = TOR not active; 1 = TOR active; 2 = short TOR active; 9 = unknown |
| TorsionBarTorque |  | native double | Steering force applied by the driver on the torsion bar |
| VehicleSpeed |  | native double | Speed of the ego vehicle as reported by the ABS / wheel sensing module |
| YawRate |  | native double | The yaw rate of the ego vehicle; Towards left is positive; Towards right is negative |

### objects

|Signal name|Array signal name|Data type|Description|
|:---|:---|:---:|---|
| UTCTime |  | native long long | System time in milliseconds since epoch |
| FileTime |  | native double | Time since beginning of recording |
| LeadVehicleID |  | native int | ID of the objects currently selected as lead vehicle |
| NumberOfObjects |  | native int | Number of objects in timestep |
| sObject [32] |  | struct |  |
|  | Classification | enum native signed char | Classification of the object; -1 = not applicable; 0 = other; 1 = car; 2 = truck; 3 = motorcycle; 4 = bicycle; 5 = pedestrian; 9 = unknown |
|  | Height | native double | Height of the object |
|  | ID | native int | Unique ID of the object |
|  | LatPosition | native double | Position in lateral direction in the ego coordinate system |
|  | LatVelocity | native double | Relative velocity in lateral direction |
|  | Length | native double | Length of the object |
|  | LongPosition | native double | Position in longitudinal direction in the ego coordinate system |
|  | LongVelocity | native double | Relative velocity in longitudinal direction |
|  | Width | native double | Width of the object |
|  | YawAngle | native double | Relative yaw angle of the object; Positive is to the left of the azimuth; Negative is to the right of the azimuth |
|  | YawRate | native double | Relative yaw angle rate of the object |

### laneLines

|Signal name|Array signal name|Data type|Description|
|:---|:---|:---:|---|
| UTCTime |  | native long long | System time in milliseconds since epoch |
| FileTime |  | native double | Time since beginning of recording |
| EgoLaneWidth |  | native double | Width of the current lane |
| sLaneLine [4] |  | struct | 0 = right; 1 = left; 2 = right of right lane; 3 = left of left lane |
|  | Curvature | native double | The curvature of the lane markings. ; Needed for the calculation of the lane marking polynomial |
|  | CurvatureDx | native double | Differential curvature of the lane markings |
|  | Dy | native double | Lateral Position of lane markings |
|  | QualityIndex | native int | Quality index for lane detection |
|  | MarkingType | enum native signed char | Type of lane marking; -1 = not applicable; 0 = none; 1 = continuous; 2 = dashed; 3 = dots; 4 = double; 5 = other; 9 = unknown |
|  | YawAngle | native double | Yaw angle between ego heading and lane markings |

### positioning

|Signal name|Array signal name|Data type|Description|
|:---|:---|:---:|---|
| UTCTime |  | native long long | System time in milliseconds since epoch |
| FileTime |  | native double | Time since beginning of recording |
| Altitude |  | native double | Altitude of the ego vehicle (WGS84) |
| GNSSSpeed |  | native double | Speed of the ego vehicle as reported by the GNSS module / IMU |
| GNSSTime |  | native long long | GNSS time (UTC) in milliseconds since epoch |
| Heading |  | native double | Heading of the ego vehicle; 0 = North; pi/2 = West; pi = South; 3pi/2 = East |
| Latitude |  | native double | Latitude of the ego vehicle (WGS84) |
| Longitude |  | native double |  Longitude of the ego vehicle (WGS84) |
| NumberOfSatellites |  | native int | The number of used satellites |

### externalData

|Signal name|Array signal name|Data type|Description|
|:---|:---|:---:|---|
| map |  | dataset |  |
|  | UTCTime | native long long | System time in milliseconds since epoch |
|  | FileTime | native double | Time since beginning of recording |
|  | DistIntersection | native double | Distance to next intersection |
|  | NumberOfLanes | native int | The number of lanes on the current road section. |
|  | RoadType | enum native signed char | The roadtype is coded as follows:; -1 = initial value; 1 = highway / motorway / autostrada / autobahn; 2 = major aterial / A-road; 3 = minor road / B-road; 4 = local road / street; 5 = car park |
|  | RulesIntersection | enum native signed char | Type of priority rule at intersection according to UDRIVE codebook; -1 = not applicable; 0 = other; 1 = regulated by law only; 2 = traffic signs and road markings; 3 = traffic light allowing partial conflicts; 4 = traffic lights not allowing partial conflicts; 9 = unknown |
|  | SpeedLimit | native int | The speed limit at the current location of the ego vehicle in m/s; Unlimited = -1; No information = 0 |
|  | TypeIntersection | enum native signed char | The type of the next intersection according to UDRIVE codebook; -1 = not applicable; 0 = none; 1 = X intersection; 2 = T intersection right; 3 = T intersection left; 4 = T intersection by-road; 5 = Y intersection; 6 = Roundabout; 7 = 5 or more legs; 8 = merging lane; 9 = passing by merging lane; 10 = exit or turning lane; 11 = complex intersection; 99 = unkown |


text:
---
title: Our favorite mistakes
date: '2018-09-17 06:00:00'
image: baking_mistake_.jpg
tags: cross cultural mistakes rainy season vanlife camping
categories: food spanish water vandwelling
layout: post
---

Here's an abbreviated gallery of mistakes we've made:

We've been baking in [our grill](https://reverdecer.annalisagross.com/2018/08/08/our-grill/) and it doesn't really work. Takes forever even if we use the smallest containers we have. When we don't have room to fit containers inside (they can't get too close to the flame) I've put some on top, and once, when moving a pyrex bowl to the side, it shattered. Must've been too cold on the grill's side table (can't imagine how that can be cold, but clearly it was). We've lost more dishes to the concrete floor, but thanks to Capula we have enough.

First time we went to Costco we ended up with a box of sugar packets, rather than a box of sugar. We could blame it on not reading the Spanish carefully, but truly, I made the same mistake in the US years ago!

[![](/images/sugar_mistake_.jpg){:width="60%"}](/images/sugar_mistake.jpg)

After opening packet by packet each time I baked for a month or two, I finally got tired of it and sat down with a podcast and opened every single one, pouring the sugar into a container. The packets became mulch in the gardens. No waste!

When we first arrived en El Terreno [we expected to get robbed a lot](https://reverdecer.annalisagross.com/2018/04/17/en-el-terreno/). So Phillip quickly built a shed and we dug a root cellar underneath for hidden storage. We haven't used it much since [we've only had one theft](https://reverdecer.annalisagross.com/2018/08/12/first-theft/) and no one has come onto the land without our knowledge (ha, in our knowledge, you know?)

[![](/images/ruined_.jpg){:width="60%"}](/images/ruined.jpg)

Well...we did have one tub of books and gear under there - stuff we were keeping in "storage" outside the van. These tubs have proven themselves rainproof. We never considered whether they were pond-proof, since we didn't plan to have them underwater.

Not only did everything get soaked, it sat in water getting stinky like a swamp. We lay each item out, rinsed and rinsed, sunned and sunned, and salvaged most of the gear a handful of books.

But sunning the books put them in rain's way, so we spread them throughout the [kitchen](https://reverdecer.annalisagross.com/2018/06/30/rustico/) where we constantly tripped over these reminders of our idiocy.

After weeks of hoping the problems would resolve themselves, the pages would unstick, the smell would dissipate, I got too grouchy about the mess and we found the handful of books that can still be read, and I'm mulching trees with the rest.

We're glad to have a roof over the outhouse since it rains so much these days. Somehow our toilet paper got soaked anyway (maybe from the ground up?) and we used one roll (sustainability and all) but it was yellowish with gray flecks of mildew, and I tossed the 2nd wet roll out. We can afford some new tp. Now we have a Costco pack with individually-plastic-wrapped rolls, which is truly wasteful...and handy en El Terreno.

[![](/images/tp_ruin2_.jpg){:width="60%"}](/images/tp_ruin2.jpg)

Guess what else rain has ruined?

The first time we made a [solar dehydrator](https://reverdecer.annalisagross.com/2018/08/19/solar-dehydrator-1st-attempt/) we went full simple. It lasted about six rounds of drying, because by then it had been rained on three times and couldn't hold shape any longer.

| [![](/images/dry_box2_.jpg)](/images/dry_box2.jpg) | [![](/images/dehydrator_done_.jpg)](/images/dehydrator_done.jpg) |

Our new one is much sturdier and working well. We'll post about it another day.

gha_language: CSS


text:
# WABT bindings for Rust

[![crates.io](https://img.shields.io/crates/v/wabt.svg)](https://crates.io/crates/wabt)
[![docs.rs](https://docs.rs/wabt/badge.svg)](https://docs.rs/wabt/)

Rust bindings for [WABT](https://github.com/WebAssembly/wabt).

## Usage

Add this to your `Cargo.toml`:

```toml
[dependencies]
wabt = "0.9.0"
```

## Use cases

Assemble a given program in WebAssembly text format (aka wat) and translate it into binary.

```rust
extern crate wabt;
use wabt::wat2wasm;

fn main() {
    assert_eq!(
        wat2wasm("(module)").unwrap(),
        &[
            0, 97, 115, 109, // \0ASM - magic
            1, 0, 0, 0       //  0x01 - version
        ]
    );
}
```

or disassemble a wasm binary into the text format.

```rust
extern crate wabt;
use wabt::wasm2wat;
fn main() {
    assert_eq!(
        wasm2wat(&[
            0, 97, 115, 109, // \0ASM - magic
            1, 0, 0, 0       //    01 - version
        ]),
        Ok("(module)\n".to_owned()),
    );
}
```

`wabt` can be also used for parsing the official [testsuite](https://github.com/WebAssembly/testsuite) scripts.

```rust
use wabt::script::{ScriptParser, Command, CommandKind, Action, Value};

let wast = r#"
;; Define anonymous module with function export named `sub`.
(module
  (func (export "sub") (param $x i32) (param $y i32) (result i32)
    ;; return x - y;
    (i32.sub
      (get_local $x) (get_local $y)
    )
  )
)

;; Assert that invoking export `sub` with parameters (8, 3)
;; should return 5.
(assert_return
  (invoke "sub"
    (i32.const 8) (i32.const 3)
  )
  (i32.const 5)
)
"#;

let mut parser = ScriptParser::<f32, f64>::from_str(wast)?;
while let Some(Command { kind, .. }) = parser.next()? {
    match kind {
        CommandKind::Module { module, name } => {
            // The module is declared as anonymous.
            assert_eq!(name, None);

            // Convert the module into the binary representation and check the magic number.
            let module_binary = module.into_vec();
            assert_eq!(&module_binary[0..4], &[0, 97, 115, 109]);
        }
        CommandKind::AssertReturn { action, expected } => {
            assert_eq!(action, Action::Invoke {
                module: None,
                field: "sub".to_string(),
                args: vec![
                    Value::I32(8),
                    Value::I32(3)
                ],
            });
            assert_eq!(expected, vec![Value::I32(5)]);
        },
        _ => panic!("there are no other commands apart from that defined above"),
    }
}
```

# Alternatives

You might find [`wat`](https://crates.io/crates/wat) or [`wast`](https://crates.io/crates/wast)
crate useful if you only want to parse `.wat` or `.wast` source. The advantage of using them is that
they are implemented completely in Rust. Moreover, [`wast`](https://crates.io/crates/wast) among other things
allows you to add your own extensions to WebAssembly text format.

For print the text representation of a wasm binary, [`wasmprinter`](https://crates.io/crates/wasmprinter)
can work better for you, since it is implemented completely in Rust.

repository: pepyakin/wabt-rs

gha_language: Rust

repo_name: pepyakin/wabt-rs


text:
These are my notes on Classical Mechanics (advanced level), initially taken for the PHYS503 class lectured by Dr. Kenkre at the University of New Mexico, Fall 2012.

*Main_CM.tex* is the TeX code outlined the whole set of notes.
The section on Lagrangian and Hamiltonian mechanics was modified from a LaTeX  source code provided by Ninnat (*Tom*) Dangniam (thank Tom for letting me share his works online).

These notes are now openly shared for academic purpose, and can be redistributed and revised under the MIT license. Because most of the notes were taken on-fly, there are definitely numerous errors.
I haven't found a chance to check the grammar errors carefully enough to hide to the readers that English is not my native language.
If you find any errors, please help update with a better version in a Pull Request on the Git repository.
Thanks for the contributions to these notes and derived works, if any.
Enjoy learning and creating!

Xiaodong Qi,

University of New Mexico

Jan 25, 2016


text:
# T2WML tutorial Overview

T2WML is a YAML-based language that maps tabular data to Wikidata
knowledge graph statements. This tutorial will teach you how to write
T2WML YAML scripts. For an overview of the T2WML Grammar see
[here](../docs/grammar.md).

The T2WML tutorial is partitioned into tutorial projects. To run each tutorial
project:
* Start the `T2WML` application
* Click on `Open Project`, browse the tutorial project folder and select the `project.t2wml` project file.

| Tutorial                 | Description |
|--------------------------|-------------|
| Region_Tutorial          | Tutorial on how to use the `region` attribute to define variable values |
| Qualifier_Tutorial       | Tutorial on how to use `qualifiers` to describe/refine variable values |
| Advanced_Tutorial        | Tutorial on how to use `iterator variable` to fill in omitted values |
| Data_Cleaning_Tutorial   | Tutorial on how to use different functions for data cleaning included in T2WML |


text:
# Static file serving

**Note:** This feature is new and not extensively tested.

Within this folder, Minify creates minified files on demand, serving them without the overhead of PHP at all.

For example, when a visitor requests a URL like `/min/static/1467089473/f=js/my-script.js`, Minify creates the directories `1467089473/f=js`, and saves the minified file `my-script.js` in it. On following requests, the file is served directly.

## Getting started

1. Make sure the `static` directory is writable by your server.

2. In `minify/config.php`, set `$min_enableStatic = true;`

3. Request the test script http://example.org/min/static/0/f=min/quick-test.js

    This will create a new cache directory within `static` and redirect the browser to the new location, e.g. http://example.org/min/static/1467089473/f=min/quick-test.js.

    You should see the minified script and on the server the `static` directory should contain a new subdirectory tree with the static file. Following requests will serve the file directly.

4. Delete the new subdirectory (e.g. `1467089473`) and refresh the browser.

You should be redirected to the new location where the file and cache directory has been recreated.

## Site integration

You don't want to hardcode any URLs. Instead we'll use functions in `lib.php`:

```php
require_once __DIR__ . '/path/to/static/lib.php';

$static_uri = "/min/static";
$query = "b=scripts&f=1.js,2.js";
$type = "js";

$uri = Minify\StaticService\build_uri($static_uri, $query, $type);
```

If you release a new build (or change any source file), you *must* clear the cache by deleting the entire directory:

```php
require_once __DIR__ . '/path/to/static/lib.php';

Minify\StaticService\flush_cache();
```

## URL rules

As URLs result in files being created, they are more strictly formatted.

* Arbitrary parameters (e.g. to bust a cache) are not permitted.
* URLs must end with `.js` or `.css`.

If your URL does not end with `.js` or `.css`, you'll need to append `&z=.js` or `&z=.css` to the URL. E.g.:

* http://example.org/min/static/1467089473/g=home-scripts&z=.js
* http://example.org/min/static/1467089473/f=styles.less&z=.css

Note that `Minify\StaticService\build_uri` handles this automatically for you.

URLs aren't canonical, so these URLs are all valid and will produce separate files:

* http://example.org/min/static/1467089473/f=one/two/three.js
* http://example.org/min/static/1467089473/b=one/two&f=three.js
* http://example.org/min/static/1467089473/f=three.js&b=one/two&z=.js

## Disable caching

You can easily switch to use the regular `min/` endpoint during development:

```php
<?php

$query = "b=styles&f=minimal.less";
$type = "css";

if ($use_static) {
    require_once __DIR__ . '/path/to/static/lib.php';
    $static_uri = "/min/static";
    $uri = Minify\StaticService\build_uri($static_uri, $query, $type);
} else {
    $uri = "/min/?$query";
}
```

repository: Bcdo/project

gha_language: Twig

repo_name: Bcdo/project


text:
# Worker

`Worker` is a logical worker node in a Spark Standalone cluster.

`Worker` can be [launched from command line](#launch).

##  Worker RPC Endpoint

`Worker` is a `ThreadSafeRpcEndpoint` and is registered under **Worker** name (when [launched as a command-line application](#launch) and requested to [set up an RPC environment](#startRpcEnvAndEndpoint)).

##  Launching Standalone Worker

`Worker` can be launched as a standalone application using `spark-class`.

```text
./bin/spark-class org.apache.spark.deploy.worker.Worker
```

!!! note
    At least one [master URL](#master) is required.

###  main Entry Point

```scala
main(
  args: Array[String]): Unit
```

`main` is the entry point of `Worker` standalone application.

`main` prints out the following INFO message to the logs:

```text
Started daemon with process name: [processName]
```

`main` registers signal handlers for `TERM`, `HUP`, `INT` signals.

`main` parses [command-line options](#options) (using `WorkerArguments`) and [initializes an RpcEnv](#startRpcEnvAndEndpoint).

`main` asserts that:

1. External Shuffle Service is not used (based on `spark.shuffle.service.enabled` configuration property)
1. Number of worker instances is `1` (based on `SPARK_WORKER_INSTANCES` environment variable)

`main` throws an `IllegalArgumentException` when the above does not hold:

```text
Starting multiple workers on one host is failed because we may launch no more than one external shuffle service on each host, please set spark.shuffle.service.enabled to false or set SPARK_WORKER_INSTANCES to 1 to resolve the conflict.
```

In the end, `main` requests the `RpcEnv` to be notified when `terminated`.

##  Command-Line Options

`Worker` supports command-line options.

```text
Usage: Worker [options] <master>

Master must be a URL of the form spark://hostname:port

Options:
  -c CORES, --cores CORES  Number of cores to use
  -m MEM, --memory MEM     Amount of memory to use (e.g. 1000M, 2G)
  -d DIR, --work-dir DIR   Directory to run apps in (default: SPARK_HOME/work)
  -i HOST, --ip IP         Hostname to listen on (deprecated, please use --host or -h)
  -h HOST, --host HOST     Hostname to listen on
  -p PORT, --port PORT     Port to listen on (default: random)
  --webui-port PORT        Port for web UI (default: 8081)
  --properties-file FILE   Path to a custom Spark properties file.
                           Default is conf/spark-defaults.conf.
```

### cores

### host

### ip

###  Master URLs

**(required)** Comma-separated standalone Master's URLs in the form:

```text
spark://host1:port1,host2:port2,...
```

### memory

### port

### properties-file

### webui-port

### work-dir

## Creating Instance

`Worker` takes the following to be created:

*  `RpcEnv`
*  web UI's Port
*  Number of CPU cores
*  Memory
*  `RpcAddress`es of the [Master](Master.md)s
*  Endpoint Name
*  Work Dir Path (default: `null`)
*  `SparkConf`
*  `SecurityManager`
*  Optional Resource File (default: (undefined))
*  Supplier of `ExternalShuffleService` (default: `null`)

`Worker` is created when:

* `Worker` utility is requested to [startRpcEnvAndEndpoint](Worker.md#startRpcEnvAndEndpoint)

##  ExternalShuffleService

`Worker` initializes an `ExternalShuffleService` (directly or indirectly using a [Supplier](#externalShuffleServiceSupplier) if given).

`ExternalShuffleService` is `started` when `Worker` is requested to [startExternalShuffleService](#startExternalShuffleService).

`ExternalShuffleService` is used as follows:

* Informed about an application removed when `Worker` handles a [WorkDirCleanup](#WorkDirCleanup) message or [maybeCleanupApplication](#maybeCleanupApplication)

* Informed about an executor removed when `Worker` is requested to [handleExecutorStateChanged](#handleExecutorStateChanged)

`ExternalShuffleService` is stopped when `Worker` is requested to [stop](#stop).

##  Starting Up RPC Environment

```scala
startRpcEnvAndEndpoint(
  host: String,
  port: Int,
  webUiPort: Int,
  cores: Int,
  memory: Int,
  masterUrls: Array[String],
  workDir: String,
  workerNumber: Option[Int] = None,
  conf: SparkConf = new SparkConf,
  resourceFileOpt: Option[String] = None): RpcEnv
```

`startRpcEnvAndEndpoint` creates an `RpcEnv` (with the name `sparkWorker` and the given `host` and `port`).

`startRpcEnvAndEndpoint` translates the given `masterUrls` to `RpcAddress`es.

`startRpcEnvAndEndpoint` creates a [Worker](#creating-instance) and requests the `RpcEnv` to set it up as an RPC endpoint under the [Worker](#ENDPOINT_NAME) name.

`startRpcEnvAndEndpoint` is used when:

* `LocalSparkCluster` is requested to `start`
* `Worker` standalone application is [launched](#main)

###  Creating Work Directory

```scala
createWorkDir(): Unit
```

`createWorkDir` sets <<workDir, workDir>> to be either <<workDirPath, workDirPath>> if defined or <<sparkHome, sparkHome>> with `work` subdirectory.

In the end, `createWorkDir` creates <<workDir, workDir>> directory (including any necessary but nonexistent parent directories).

`createWorkDir` reports...FIXME

## Messages

###  ApplicationFinished

###  DriverStateChanged

###  ExecutorStateChanged

```scala
ExecutorStateChanged(
  appId: String,
  execId: Int,
  state: ExecutorState,
  message: Option[String],
  exitStatus: Option[Int])
```

Message Handler: [handleExecutorStateChanged](#handleExecutorStateChanged)

Posted when:

* `ExecutorRunner` is requested to [killProcess](ExecutorRunner.md#killProcess) and [fetchAndRunExecutor](ExecutorRunner.md#fetchAndRunExecutor)

###  KillDriver

###  KillExecutor

###  LaunchDriver

###  LaunchExecutor

###  MasterChanged

###  ReconnectWorker

###  RegisterWorkerResponse

###  ReregisterWithMaster

###  RequestWorkerState

###  SendHeartbeat

###  WorkDirCleanup

##  handleExecutorStateChanged

```scala
handleExecutorStateChanged(
  executorStateChanged: ExecutorStateChanged): Unit
```

`handleExecutorStateChanged`...FIXME

`handleExecutorStateChanged` is used when:

* `Worker` is requested to handle [ExecutorStateChanged](#ExecutorStateChanged) message

##  maybeCleanupApplication

```scala
maybeCleanupApplication(
  id: String): Unit
```

`maybeCleanupApplication`...FIXME

`maybeCleanupApplication` is used when:

* `Worker` is requested to [handle a ApplicationFinished message](#ApplicationFinished) and [handleExecutorStateChanged](#handleExecutorStateChanged)

## Logging

Enable `ALL` logging level for `org.apache.spark.deploy.worker.Worker` logger to see what happens inside.

Add the following line to `conf/log4j.properties`:

```text
log4j.logger.org.apache.spark.deploy.worker.Worker=ALL
```

Refer to [Logging](logging.md).

repository: japila-books/spark-standalone-internals

repo_name: japila-books/spark-standalone-internals


text:
statsd-agent
============

Statsd client to monitor CPU, Memory, Disk and Network

Quickstart
============

## Installation (Ubuntu) [see below]
First, download both *statsd-agent.py* and *statsd-agent.conf*. Create a directory `/opt/statsd-agent` and place *statsd-agent.py* in it. Place the Upstart configuration file *statsd-agent.conf* in `/etc/init/`. The statsd-agent.py will automatically start as service on system startup or you can manually start it using the following command:
```
service statsd-agent start
```

## Installation (Other Linux/Mac)
stasd-agent.py is really just a single python file. You can run it directly using python command:
```
python statsd-agent.py
```

### Full install procedure (Linux):
1. `sudo apt-get update`
2. `sudo apt-get install python-dev git`
3. `git clone https://github.com/sdvicorp/statsd-agent.git`
4. `git checkout cfg`
5. `sudo mkdir /opt/statsd-agent`
6. `sudo cp statsd-agent.py /opt/statsd-agent`
7. `sudo cp statsd-agent.cfg /opt/statsd-agent`
8. `sudo cp statsd-agent.conf /etc/init`
9. `sudo nano /opt/statsd-agent/statsd-agent.cfg`
10. Change fields and other options as necessary
11. `sudo pip install psutil statsd`
12. `sudo service statsd-agent start`
13. `cd ~`
14. `rm -rf statsd-agent`

## Installation (Windows)
1. Grab the `statsd-agent-sfx.exe` file.
2. Run it.
3. When prompted for the output path, enter `C:\statsd-agent`.
4. Open `cmd.exe`
5. `cd statsd-agent`
6. Edit the `statsd-agent.cfg` file and set the `host=` and `service=` options (at least).
7. Run `statsd-agent.exe install`
8. Open the Windows Services control panel.
9. Change the statsd agent service setting for startup to automatic.
10. Start the service.

## Running/Stopping (Ubuntu)
Use upstart command to run/stop statsd-agent:
```
service statsd-agent start
service statsd-agent stop
service statsd-agent restart
service statsd-agent status
```
More info about Ubuntu Upstart can be found at http://askubuntu.com/questions/19320/how-to-enable-or-disable-services

## Windows Build

1. Install Python2.7 (into the default `C:\Python27` dir)
2. Install psutil
3. Install statsd
4. Install py2exe
5. Install git
6. In `C:\User\Administrator`:
7. `git clone https://github.com/sdvicorp/statsd-agent.git`
8. `cd statsd-agent`
9. `git checkout cfg`
10. `python setup.py`
11. `iexpress /N statsd-agent.SED`. Will produce `statsd-agent-sfx.exe` in `C:\User\Administrator`

License
============

    The MIT License (MIT)

    Copyright (c) 2013 Mohd Rozi

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

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

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


text:
# Architecture Decision Record: Use ADRs

## Context

We want to think deeply about all our architectural decisions, exploring all alternatives and making a careful, considered, well-researched choice.
We want to be as transparent as possible in our decision-making process.
We don't want decisions to be made unilaterally in a vacuum. Specifically, we want to give our steering group the opportunity to review every major decision.
Despite being a geographically and temporally distributed team, we want our contributors to have a strong shared understanding of the technical rationale behind decisions.
We want to be able to revisit prior decisions to determine fairly if they still make sense, and if the motivating circumstances or conditions have changed.

## Decision

We will document every architecture-level decision for Arachne and its core modules with an Architecture Decision Record. These are a well structured, relatively lightweight way to capture architectural proposals. They can serve as an artifact for discussion, and remain as an enduring record of the context and motivation of past decisions.

## Status

Accepted

## Consequences

Developers must write an ADR and submit it for review before selecting an approach to any architectural decision -- that is, any decision that affects the way Arachne or an Arachne application is put together at a high level.
We will have a concrete artifact around which to focus discussion, before finalizing decisions.
If we follow the process, decisions will be made deliberately, as a group.
The master branch of our repositories will reflect the high-level consensus of the steering group.
We will have a useful persistent record of why the system is the way it is.

repository: JonQuxBurton/MobileMicroservicesSample

gha_language: C#

repo_name: JonQuxBurton/MobileMicroservicesSample


text:
# What is JavaScript?
- JavaScript (JS) is one of the most used programming languages. It was created by Brendan Eich in 1995, and it took him ten days. You read it right: JavaScript was really developed in just ten days!

<img src = "https://ucarecdn.com/541cca3b-6668-401c-9e88-ed9ed42a61a3/" class="center" >

- According to GitHub 2018, JS tops the list of the most popular programming languages. It is used for both front-end and back-end development.

```
JavaScript is not Java. These are different programming languages. Their similar names were a marketing move to draw attention to the new language and take advantage of the popularity of Java.
```
- JavaScript is based on the ECMAScript standard (often shortened to ES). The latest version of this standard is ES11.

# JavaScript Basics
 - This program displays the text "Hello from JavaScript!" in the console, a zone displaying textual information available in most JavaScript environments, such as browsers.
 -  To achieve this, it uses a JavaScript command named console.log(), whose role is to display a piece of information. The text to be displayed is placed between parentheses and followed by a semicolon, which marks the end of the line.
  - Displaying a text on the screen (the famous Hello World all programmers know) is often the first thing you’ll do when you learn a new programming language. It’s the classic example.


text:
# Active Record Nearest Neighbor

Easy, high performance geospatial nearest-neighbor searches with ActiveRecord, leveraging PostGIS.

Dependencies:

1. [PostgreSQL](http://www.postgresql.org/).

2. [ActiveRecord](https://github.com/rails/rails/tree/master/activerecord).

3. [PostGIS ActiveRecord Adapter gem](https://github.com/rgeo/activerecord-postgis-adapter).

In your Gemfile:

```
  gem 'active_record_nearest_neighbor'
```

The central feature of this gem is a scope method for your Active Record models, `close_to`. With `close_to`, you can perform blazing fast and accurate nearest neighbor searches with PostGIS, without writing a line of geospatial SQL. All you need to do is add the appropriate geospatial columns, include a module, and you're set:

Active Record Nearest Neighbor provides you with several helpful rake tasks to get you started:

1. If you don't yet have the PostGIS extension added to your PostgreSQL database:

  ```
    rake db:gis:setup
  ```

2. In your config/database.yml file, change the adapater of your database to postgis:

    ```
      database: postgis
    ```

3. Generate a rake task to create a table or add columns:

  1. To generate a migration to create a new table with geospatial columns:

    ```
      rake nearest_neighbor:create[table_name]
    ```

  2. To generate a migration to add geospatial columns and point index to a table that you already have:

    ```
      rake nearest_neighbor:add_columns[table_name]
    ```

4. Run the generated migration with `$ rake db:migrate`

5. To add `close_by` to your model class, include `NearestNeighbor`:

  ```
     class Building < ActiveRecord::Base
       include NearestNeighbor

     end
  ```

6. Now you're set!

  ```
    # Buildings close to the Empire State Building
    latitude = 40.748441
    longitude = -73.985664
    Building.close_to(longitude, latitude)
  ```

You can use `close_to` in different ways to perform the nearest neighbor query that you want. By default, `close_to` will use a bounding box of 10 kilometers. Set the `:distance` option (uses meters) if you want to change the size of this bounding box.

  ```
    # Buildings within 500 meters from the Empire State Building
    latitude = 40.748441
    longitude = -73.985664
    Building.close_to(longitude, latitude, distance: 500)
  ```

If you want to know what's close to your geospatial Active Record objects, simply pass the object to `close_to` instead of longitude and latitude!

  ```
    # Buildings within 500 meters from the Space Needle
    space_needle = Building.find_by_name("Space Needle")
    Building.close_to(space_needle, distance: 500)
  ```

Maybe you need to avoid a bounding box? No sweat! Provide the `:k_nearest_neighbor` option to `close_to` and `close_to` will avoid a bounding box. This is great for nearest neighbor searches with data of greatly varying distances and/or datasets that aren't significantly large. NOTE: This will have slower performance with larger datasets.

  ```
    # Volcanoes, ordered by proximity to Mount Rainier
    mount_rainier = Volcanoe.find_by_name("Mount Rainier")
    Volcano.close_to(mount_rainier, method: :k_nearest_neighbor)
  ```

You can provide `close_to` with a `limit` option if you know a limit ahead of time:

  ```
    # The 5 closest roller coasters to Los Angeles
    RollerCoaster.close_to(-118.243685, 34.052234, method: :k_nearest_neighbor, limit: 5)
  ```


text:
What is NgRx?

NgRx is a framework for building reactive applications in Angular. NgRx provides libraries for:

- Managing global and local state.
- Isolation of side effects to promote a cleaner component architecture.
- Entity collection management.
- Integration with the Angular Router.
- Developer tooling that enhances developer experience when building many different types of applications.

## Packages

NgRx packages are divided into a few main categories

### State

- [Store](guide/store) - RxJS powered global state management for Angular apps, inspired by Redux.
- [Effects](guide/effects) - Side effect model for @ngrx/store.
- [Router Store](guide/router-store) - Bindings to connect the Angular Router to @ngrx/store.
- [Entity](guide/entity) - Entity State adapter for managing record collections.
- [ComponentStore](guide/component-store) - Standalone library for managing local/component state.

### Data

- [Data](guide/data) - Extension for simplified entity data management.

### View

- [Component](guide/component) - Extension for building reactive Angular templates.

### Developer Tools

- [Store Devtools](guide/store-devtools) - Instrumentation for @ngrx/store that enables visual tracking of state and time-travel debugging.
- [Schematics](guide/schematics) - Scaffolding library for Angular applications using NgRx libraries.
- [ESLint Plugin](guide/eslint-plugin) - ESLint rules to warn against bad practices. It also contains a few automatic fixes to enforce a consistent style, and to promote best practice.


text:
VehicleViewerCore
---------------
Contains the core components of the "VehicleViewer" app.

[![SwiftPM compatible](https://img.shields.io/badge/SwiftPM-Compatible-brightgreen)](https://swift.org/package-manager)

Installation
--------------

### Swift Package Manager:

Add `VehicleViewerCore` as a dependency in your `Package.swift` file:

```swift
.package(url: "https://github.com/Frunza/VehicleViewerCore", .upToNextMajor(from: "0.0.1"))
```

-------
After installing import the module where you want to use it:

Swift:

```swift
import VehicleViewerCore
```

Requirements
------------

- Base SDK of iOS 13.0 or higher.
- Deployment target of iOS 13.0 or higher.

repository: Frunza/VehicleViewerCore

repo_name: Frunza/VehicleViewerCore


text:
# Running the tests

## Unit tests

Before we start the application, let's try running the tests. Create the test databases:

```bash
$ MIX_ENV=test mix do ecto.create, ecto.migrate

# Or if you are using specific database URLs:
$ MIX_ENV=test DATABASE_URL=postgres://localhost/ewallet_test_db LOCAL_LEDGER_DATABASE_URL=postgres://localhost/local_ledger_test_db mix do ecto.create, ecto.migrate
```

Then, let's run the tests:

```bash
$ mix test

# Or if you are using specific database URLs:
$ DATABASE_URL=postgres://localhost/ewallet_test_db LOCAL_LEDGER_DATABASE_URL=postgres://localhost/local_ledger_test_db mix test
```

You should see the results similar to below:

```elixir
==> local_ledger_db
Finished in 0.5 seconds
57 tests, 0 failures

==> ewallet_db
Finished in 2.3 seconds
249 tests, 0 failures

==> local_ledger
Finished in 0.9 seconds
24 tests, 0 failures

==> ewallet
Finished in 3.4 seconds
141 tests, 0 failures

==> admin_api
Finished in 4.4 seconds
184 tests, 0 failures

==> ewallet_api
Finished in 4.5 seconds
134 tests, 0 failures
```

All the tests should pass. If some tests are failing, double-check you have install all the dependencies. If you keep getting the failures, you can get in touch with us on [Gitter](https://gitter.im/omisego/ewallet)!

## Acceptance tests

We offer acceptance tests at [omisego/e2e](https://github.com/omisego/e2e) written using [Robot Framework](http://robotframework.org/).
These tests rely on initial seeded data which are 2 admins and a base account.

Prior to running the acceptance tests, you will need generate the sample data needed for the tests:

```bash
$ mix seed --test --yes
```

`--yes` option allows to skip all prompted confirmations which is ideal when ran on an automation server.

You will need to add a few environment variables before running the seed, check [Environment Variables](/docs/setup/env.md#e2e-tests) for more information.

repository: amadeobrands/ewallet

repo_name: amadeobrands/ewallet


text:
1.0.19 / 12.01.2018
===================

  * Refactored `twitter` style and styles overall: style can now have `threshold(now)` function and also gradation step can have `format(value, locale)` function instead of `unit`.

1.0.17 / 11.01.2018
===================

  * Renamed `override` to `custom` for styles

1.0.15 / 11.01.2018
===================

  * Renamed `fuzzy` style to `time`.
  * Refactored `gradation`s and `style`s.
  * `gradation` is now not being exported from `index.js` along with `day`, `month` and `year` (one can still `import` it manually from `gradation.js`).
  * `es6` folder got renamed to `modules`
  * `build` folder got renamed to `commonjs`

1.0.11 / 10.01.2018
===================

  * Renamed `plural` to `quantify` inside locale data.
  * Implemented `Intl.RelativeTimeFormat` proposal polyfill which is now being exported.

1.0.10 / 09.01.2018
===================

  * (can be a breaking change for custom styles) Renamed `just-now` unit to `now` and `xxx-concise` flavour to `xxx_time` (+ flavour `.json` files got renamed accordingly).

1.0.8 / 09.01.2018
===================

  * (breaking change) When defining a custom `style` its `override()` function takes `date` and `time` parameters: now `date` parameter of `override()` is not guaranteed to be set (can be inferred from `time`).

1.0.2 / 08.01.2018
===================

  * (breaking change) Due to a long-standing engineering flaw in `intl-messageformat` library (the locale data loading process) I dismissed it and this library is now using raw CLDR locale data instead so built-in locale data now holds an extra property: the `plural` function taking a number and returning the pluralization type of that number ("one", "few", etc). Therefore, if adding raw CLDR locale data for locales which are not built-in this pluralization function must be passed as the second argument to `.locale(localeDataCLDR, pluralsClassifier)`.

  * (breaking change) `javascriptTimeAgo.styles` is no more accesible: pass `style` as a string instead.

  * (breaking change) `locales` folder inside the package renamed to `locale` (e.g. `javascript-time-ago/locales/en` -> `javascript-time-ago/locale/en`).

  * `style.flavour` can now be an array

0.4.4 / 22.12.2016
===================

  * Changed `yesterday` and `tomorrow` labels for Russian localization

0.2.0 / 13.04.2016
===================

  * Moved `intl-messageformat` to `peerDependencies`

0.1.0 / 03.04.2016
===================

  * Initial release

repository: nickolos/front

repo_name: nickolos/front


text:
# status-tab-spacing package

Displays the length of tabs in the active editor down in the status bar and allows you to switch between tab length. Feel free to fork and improve!

## Usage
* `ctrl + option + p` brings up the spacing menu

## Screenshots

![Choose tab length](http://i.imgur.com/meM1QVU.png)

![Spaces displayed on status bar](http://i.imgur.com/M4qzMZk.png)

repository: huba/status-tab-spacing

repo_name: huba/status-tab-spacing


text:
# Lois [![CircleCI](https://circleci.com/gh/ketiko/lois.svg?style=svg)](https://circleci.com/gh/ketiko/lois)

Lois reports statuses of CI results to Github Pull Request Statuses.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'lois'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install lois

## Usage

```
bundle exec lois help

Commands:
  lois brakeman -g, --github-credentials=GITHUB_CREDENTIALS       # Run brakeman
  lois bundler-audit -g, --github-credentials=GITHUB_CREDENTIALS  # Run bundler-audit
  lois help [COMMAND]                                             # Describe available commands or one specific command
  lois reek -g, --github-credentials=GITHUB_CREDENTIALS           # Run reek
  lois rubocop -g, --github-credentials=GITHUB_CREDENTIALS        # Run Rubocop
  lois simplecov -g, --github-credentials=GITHUB_CREDENTIALS      # Run simplecov
```

Lois has commands to run and report ruby quality metrics to Github PR Statuses.  All it requires is
a github basic auth credentials for a user to report the statuses.  The user needs write access to the repo to post
PR status updates.

See [https://developer.github.com/v3/auth/#basic-authentication](https://developer.github.com/v3/auth/#basic-authentication).
We recommend using oauth tokens and not your password.

Currently we only support reporting through [CircleCI](https://circleci.com/), but PRs for additional continuous integration systems are welcome.

Lois will output all the results of the checks to a `lois` directory.  You can add this to your artifact path to view the html representation of the results later.

A sample `.circleci/config.yml` would look like:

```
- run:
    name: Bundler-Audit
    command: bin/lois bundler-audit -g $GITHUB_CREDENTIALS

- run:
    name: Brakeman
    command: bin/lois brakeman -g $GITHUB_CREDENTIALS

- run:
    name: Rubocop
    command: bin/lois rubocop -g $GITHUB_CREDENTIALS

- run:
    name: Reek
    command: bin/lois reek -g $GITHUB_CREDENTIALS

- store_artifacts:
    path: lois
    destination: lois
```

### SimpleCov

To get SimpleCov output you must have an `at_exit` hook.  A sample SimpleCov setup looks like:

```
if ENV['COVERAGE']
  require 'simplecov'
  SimpleCov.start
  SimpleCov.minimum_coverage 55
  SimpleCov.at_exit do
    if ENV['CI']
      min = SimpleCov.minimum_coverage
      actual = SimpleCov.result.covered_percent
      system("lois simplecov -g $GITHUB_CREDENTIALS -m #{min} -a #{actual}")
    end
    SimpleCov.result.format!
  end
end
```

## Development

After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/lois.

repository: calaway/lois

repo_name: calaway/lois


text:
---
layout: song
title: '"You''ve Got a Friend in Me" (Randy Newman / Toy Story)'
song_title:  You've Got a Friend in Me
artist: Randy Newman
year: 1995
category: full_song
difficulty: beginner
yt_video_id: vDEGA1jUDXw
date_published: 2020-11-22
slug: "338"
redirect_from:
  - /lessons/246/
tags: [Full Song Lesson, 1990s, Key of C, Movie Songs, Fingerstyle]
hidden_tags: [Toy Story, youve got a friend, youve got in a friend in me]
pdf_version: musicnotes
pdf_numpages: 2
musicnotes_url: https://www.musicnotes.com/l/DHFMS
---

## How to play the full song (Lesson #338)

{% include youtube_embed.html yt_id = page.yt_video_id %}

<!-- Coming soon! -->

{% include pdf-module.html slug = page.slug pdf_numpages = page.pdf_numpages pdf_version = page.pdf_version has_patreon_url = page.patreon_lesson_url patreon_url = page.patreon_lesson_url free_pdf_available = page.free_pdf_available free_pdf_url = page.free_pdf_url song_name = page.song_title pdf_for_sale = page.pdf_for_sale musicnotes_url = page.musicnotes_url %}

## Editor's notes

Hey friends! New lesson here teaching you how to play a strum-friendly campfire version of "You've Got a Friend In Me", from start to finish. This is a song I first learned the intro to last year ([see my lesson #246](https://playsongnotes.com/lessons/246/)), but knew I needed to return and teach the entire song after several of you requested I do so. As such, I put together this lesson teaching you basic chord shapes, progressions, and strumming patterns needed -- and also show you two new ways to play the intro (one very simple, the other my "secret stash" personal version). This one has been a blast to learn, I hope you enjoy learning it as much as I did!

This version is largely inspired by the Claire Ryann (and her dad) cover that's on YouTube, which is fantastic and I recommend watching. Note, I don't get into the complexities of his fingerstyle technique -- just because they raise the bar of difficulty quite a bit. Where possible, I'm opting for easy / familiar chords, especially during the bridge which I keep as simple as possible.

Video timestamps:

- 0:00 Preview & lesson overview
- 2:25 Chord shapes needed
- 6:20 Chord progressions
- 9:48 Strumming patterns
- 13:21 Rhythm tip: pushing the C7 chord
- 15:40 Intro tab: simple version
- 19:06 Intro tab: my secret stash version
- 21:47 Full play-along cover w/ lyrics

## Advanced fingerstyle intro (Lesson #246)

Here's my earlier lesson, recorded about one year before my full-song lesson above. This one focuses only on the intro, and aims to fully mimic what's played in the Claire Ryann cover on YouTube. Just note, this one is tricker than my newer video above!

<iframe width="560" height="315" src="https://www.youtube.com/embed/pCgwYSW99RI?showinfo=0" frameborder="0" allowfullscreen></iframe>

## Song lyrics

See PDF for my intro tab.

<!-- VERSE
    C            G+        C   C7    F               F         C     C7
    You've got a friend in me.......... You've got a friend in me....
    F           C           E         Am
    ...When the road looks.... rough ahead
               F         C               E         Am
    And you're miles and miles from your nice warm bed
    F             C                E       Am
    ...You just remember what your old pal said
         Dm           G         C   C7        Dm           G         C
    Boy, you've got a friend in me.....  You've got a friend in me....
    F                C         E               Am
    ...If you've got troubles.... I've got 'em too
    F              C         E             Am
    ...There isn't anything, I wouldn't do--- for you
    F             C              E         Am
    ...We stick together and can... see it through
           Dm           G             C  C7   Dm           G         C
    'Cause you've got a friend in me.........  Yeah, you've got a friend in me -->

## Chord Progression

See PDF for chord progression.

<!-- Verse:

    "You've got a friend in me..."
    C       Gaug    C       C7      F               C       C7
    1 + 2 + 3 + 4 + 1 + 2 + 3 + 4 + 1 + 2 + 3 + 4 + 1 + 2 + 3 + 4 +    ...play 1 time

    "When the road looks tough ahead..."
    F       C       E       Am
    1 + 2 + 3 + 4 + 1 + 2 + 3 + 4 +      ...play 3 times

    "You've got a friend in me..."
    Dm      G       C       C7      Dm      G       C
    1 + 2 + 3 + 4 + 1 + 2 + 3 + 4 + 1 + 2 + 3 + 4 + 1 //      ...start intro riff on final C

Bridge:

    "Some other folks might be a little bit smarter than I am..."
    F               B7              C       Gaug    C       C7
    1 + 2 + 3 + 4 + 1 + 2 + 3 + 4 + 1 + 2 + 3 + 4 + 1 + 2 + 3 + 4 +

    "But none of them will ever love you..."
    B7              B7              Em      A7      Dm      G
    1 + 2 + 3 + 4 + 1 + 2 + 3 + 4 + 1 + 2 + 3 + 4 + 1 + 2 + 3 + 4 + -->

<!--  Then do a full strum on the 2 and 4 counts.

    See PDF for strumming pattern.

<!-- 1 + 2 + 3 + 4 +       d = down strum, bass note only
d   D   d   D         D = down strum, all strings -->

Then, you can proceed to this full version -- which adds extra up strums on the "+" counts after the 2 and 4:

    See PDF for strumming pattern.

<!-- 1 + 2 + 3 + 4 +       d = down strum, bass note only
d   D U d   D U       D = down strum, all strings
                      U = up strum -->

## Intro riff

Simple version:

    See PDF for full tab diagram.

My "secret stash" personal version:

    See PDF for full tab diagram.

url: https://raw.githubusercontent.com/davidpots/playsongnotes/923e07f479ef5fdfa9e7f3e6ce44c36ae7053038/_lessons/338 - Youve Got a Friend in Me - strummy version - Randy Newman.md

repository: davidpots/playsongnotes

gha_language: HTML

gha_license_id: NOASSERTION

repo_name: davidpots/playsongnotes


text:
---
title: "Day 29"
---

import Layout from "../components/layout"

<Layout>

Today I wrote the most beautiful for loop after writing super complicated versions of the loop during all my pom breaks at school. Here's the link to the
rep.l -<EMAIL_ADDRESS>
Aaaaand just because I'm really happy about it here's the code snippet of my simple for loop to turn true to false and false to true.

```JS
var truthsAndLies = [true, true, false, true, false, true, true];

// 9) Change each false value to true and log the array to confirm
for (var i = 0; i < truthsAndLies.length; i++) {
  console.log(!truthsAndLies[i]);
}
```
Huzzah.

I also learned about Test Driven Development today. We were able to work with tests that had already been written and then write code to make the tests work. The testing programs we ran were Mocha and Chai. Mocha is a testing framework that run on node.js in your terminal. Chai is an assertion library that plugs into Mocha.

Important reasons to test include:
- find bugs early
- provides a roadmap to say how app should work
- helps make sure code is modular, flexible, decoupled and compartmentalized
- make sure small peices of code all work together
- helps plan for error states

We won't write any tests until the next module.

OK, I have to go check to make sure all my homework is done.

I listened to Krill while I was coding today. [forever and ever]

</Layout>


text:
# NuGetProxy
NuGet Proxy Server

NuGet Server has bug, query Packages(Id=,Version=) fails to get latest version, so I found out an alternative way to query and return same package through OData query, surprisingly, NuGet's package restore does not use OData and fails to restore package. But this server can act as proxy.

Steps to use

1. Host this on some live web server with SSL installed.
2. Modify NuGet.targets file and add custom feed as `<PackageSource Include="https://yourserver.com/api/v2/" />`

How does this work?

This project is nothing but simple URL Rewriter and a reverse proxy, it rewrites URL `Package(Id='',Version='')` to equivalent OData query as shown below.

    `Packages()?$filter=(Id eq '')and(Version eq '')`

repository: neurospeech/NuGetProxy

repo_name: neurospeech/NuGetProxy


text:
# Panel Attack

## About
Panel attack is a clone of [Tetris Attack/Panel De Pon](https://en.wikipedia.org/wiki/Tetris_Attack) written in JavaScript using PhaserJS.

![title screen](readme_assets/title_screen.jpg)
![game screen](readme_assets/game_screen.jpg)

* Blocks move up from the bottom of the screen and you have to try to clear them by making colour-matching combinations of 3 or greater.
*  Matches can be vertical or horizontal.
*  Move blocks by swiping them to the left or to the right.

Best played on a touch device.

### Don't want to clone and build it locally? [You can play it here.](http://floating-river-60550.herokuapp.com/)

## Installing and running
Assuming that you have nodejs and npm installed:

`npm install`

`npm run server:dev`

I used Richard Roylance's [Phaser NPM Webpack Typescript Starter Project](https://github.com/rroylance/phaser-npm-webpack-typescript-starter-project) as a starting point, so most of the documentation on that project applies here as well.

license: Unlicense