text:
# Awesome WebDAV [![Awesome](https://awesome.re/badge.svg)](https://awesome.re)

> A curated list of awesome apps that support the WebDAV protocol ([RFC 4918](https://tools.ietf.org/html/rfc4918)) and tools related to it.

Inspired by the [awesome](https://github.com/sindresorhus/awesome) list thing. Feel free to improve this list by [contributing](contributing.md)!

## Table of Contents

- [Resources](#resources)
  - [General](#general)
  - [Client guides](#client-guides)
  - [Server guides](#server-guides)
- [Servers](#servers)
  - [Standalone](#standalone)
  - [Web servers](#web-servers)
  - [Docker images](#docker-images)
- [Desktop apps](#desktop-apps)
  - [File managers](#desktop-file-managers)
  - [Backup and sync](#backup-and-sync)
  - [Other apps](#desktop-other-apps)
- [Mobile apps](#mobile-apps)
  - [Android](#android)
    - [File managers](#android-file-managers)
    - [Other apps](#android-other-apps)
  - [iOS](#ios)
    - [File managers](#ios-file-managers)
    - [Other apps](#ios-other-apps)
- [Libraries](#libraries)
  - [C](#c)
  - [C++](#c-1)
  - [Go](#go)
  - [Java](#java)
  - [JavaScript](#javascript)
  - [Python](#python)
- [Cloud providers](#cloud-providers)
- [Extensions](#extensions)

## Resources

### General

_General information about WebDAV_

- [Wikipedia article](https://en.wikipedia.org/wiki/WebDAV)
- [DAV Frequently Asked Questions](http://www.webdav.org/other/faq.html)

### Client guides

_Mounting a WebDAV volume if you have an existing server_

- [Connect to or disconnect from a WebDAV server on Mac](https://support.apple.com/en-au/guide/mac-help/mchlp1546/mac)
- [Accessing WebDAV with Windows](https://help.dreamhost.com/hc/en-us/articles/216473357-Accessing-WebDAV-with-Windows)
- [How do I establish a WebDAV connection in Gnome 3?](https://askubuntu.com/questions/233242/how-do-i-establish-a-webdav-connection-in-gnome-3)

### Server guides

_Setting up a WebDAV server_

- [How To Configure WebDAV Access with Apache on Ubuntu 14.04](https://www.digitalocean.com/community/tutorials/how-to-configure-webdav-access-with-apache-on-ubuntu-14-04)
- [Run your own WebDAV server with Docker](https://docs.bytemark.co.uk/article/run-your-own-webdav-server-with-docker/)

## Servers

### Standalone

_Standalone servers specifically built for WebDAV and its extensions_

- [phởdav](https://wiki.gnome.org/phodav) (a.k.a. chezdav) – a minimal open source WebDAV server, ideal for sharing one folder (for FreeBSD, Linux, and Windows)
- [hacdias-webdav](https://github.com/hacdias/webdav) – a simple yet configurable WebDAV server written in Go
- [sabre/dav](https://sabre.io/) - open source CardDAV, CalDAV and WebDAV server
- [SFTPGo](https://github.com/drakkan/sftpgo) - SFTP server with optional FTP/S and WebDAV support

### Web servers

_Web servers that support WebDAV or have modules to enable WebDAV support_

- [Apache HTTP Server](https://httpd.apache.org/docs/2.4/mod/mod_dav.html) supports WebDAV via the `mod_dav` module
- [Caddy](https://caddyserver.com/docs/modules/http.handlers.webdav) supports WebDAV via the `http.handlers.webdav` module
- [lighttpd](https://redmine.lighttpd.net/projects/1/wiki/Docs_ModWebDAV) supports WebDAV via the `mod_webdav` module
- [Microsoft Internet Information Services (IIS)](https://docs.microsoft.com/en-us/iis/configuration/system.webServer/webdav/) supports WebDAV starting with version 7.0 when _WebDAV Publishing_ is enabled
- [nginx](https://nginx.org/en/docs/http/ngx_http_dav_module.html) supports a subset of WebDAV methods via the `ngx_http_dav_module` module
  - [`nginx-dav-ext-module`](https://github.com/arut/nginx-dav-ext-module) is an unofficial module that adds full WebDAV support

### Docker images

_Docker images for easily deploying a WebDAV server_

- [bytemark/webdav](https://hub.docker.com/r/bytemark/webdav) - based on Apache HTTP Server
- [ugeek/webdav](https://hub.docker.com/r/ugeek/webdav) - based on nginx

## Desktop apps

### File managers and tools

_General purpose apps to browse and manage files on a WebDAV server_

- [Cyberduck](https://cyberduck.io/) - libre server and cloud storage browser with WebDAV support (for Windows and Mac)
- [Mountain Duck](https://mountainduck.io/) - lets you mount server and cloud storage including WebDAV as a disk (for Windows and Mac)
- [FileZilla Pro](https://filezillapro.com/how-to-connect-to-webdav/) - file transfer tool that supports many protocols, including WebDAV (for Windows, Mac and Linux)
- [WinSCP](https://winscp.net/eng/docs/webdav) - popular SFTP client that also supports WebDAV (for Windows)
- [davfs2](https://savannah.nongnu.org/projects/davfs2) - allows mounting a WebDAV server as a local filesystem (for Linux)

### Backup and sync

_Apps used for backup and/or synchronizing data between multiple destinations_

- [rclone](https://rclone.org/) - supports WebDAV as a backup target and [can itself act as a WebDAV server](https://rclone.org/commands/rclone_serve_webdav/) (for Windows, Mac and Linux)
- [Duplicacy](https://duplicacy.com/) - beta support for WebDAV as a backup target (for Windows, Mac and Linux)
- [Duplicati](https://github.com/duplicati/duplicati) - supports WebDAV as a backup target (for Windows, Mac and Linux)

### Other apps

_Apps and browser extensions that support WebDAV in some form, e.g. for backup and sync_

- [KeePass Password Safe](https://keepass.info/) - password manager that supports WebDAV sync (for Windows)
- [floccus](https://floccus.org/) - browser extension for bookmark sync that supports WebDAV (for Chrome, Firefox and Edge)
- [Violentmonkey](https://violentmonkey.github.io/) – a web browser extension for UserJS management that can sync with WebDAV.

## Mobile apps

### Android

#### File managers

_General purpose apps to browse and manage files on a WebDAV server_

- [WebDAV Navigator](https://play.google.com/store/apps/details?id=com.schimera.webdavnav) - WebDAV client for Android devices
- [Total Commander](https://play.google.com/store/apps/details?id=com.ghisler.android.TotalCommander) - file manager that has a WebDAV plugin

#### Other apps

_Apps that support WebDAV in some form, e.g. for backup and sync_

- [Joplin](https://play.google.com/store/apps/details?id=net.cozic.joplin) - note taking and to-do application that supports WebDAV sync
- [Keepass2Android](https://play.google.com/store/apps/details?id=keepass2android.keepass2android) - KeePass-based password manager that supports WebDAV sync

### iOS

#### File managers

_General purpose apps to browse and manage files on a WebDAV server_

- [WebDAV Nav+](https://apps.apple.com/app/webdav-nav/id412341302) - download, share, store and edit files on a WebDAV server
- [WebDAV Navigator](https://apps.apple.com/app/webdav-navigator/id382551345) - download, share, store and edit files on a WebDAV server

#### Other apps

_Apps that support WebDAV in some form, e.g. for backup and sync_

- [1Writer](https://apps.apple.com/app/1writer-markdown-text-editor/id680469088) - markdown text editor that supports importing from WebDAV
- [beorg](https://apps.apple.com/app/beorg-to-do-list-agenda/id1238649962) - to-do list and agenda app with WebDAV sync support
- [GoodReader](https://apps.apple.com/app/goodreader-pdf-editor-viewer/id777310222) - PDF viewer and editor that supports WebDAV sync
- [Joplin](https://apps.apple.com/app/joplin/id1315599797) - note taking and to-do application that supports WebDAV sync
- [Notebooks 10](https://apps.apple.com/app/notebooks-write-and-organize/id1490084838) - writing app, a text and markdown editor with WebDAV support
- [Strongbox](https://apps.apple.com/app/strongbox-password-safe/id897283731) - KeePass-based password manager that supports WebDAV sync
- [Notability](https://apps.apple.com/app/notability/id360593530) - Note-taking app that supports webDAV for backups

## Libraries

_Libraries for accessing a WebDAV storage and/or building a WebDAV server_

### C

- [neon](https://github.com/notroj/neon) - an HTTP/1.1 and WebDAV client library with a C API

### C++

- [webdav-client-cpp](https://github.com/CloudPolis/webdav-client-cpp) - C++ WebDAV Client

### Go

- [golang.org/x/net/webdav](https://godoc.org/golang.org/x/net/webdav) - WebDAV server implementation as part of the standard library
- [go-webdav](https://github.com/emersion/go-webdav) - client library for WebDAV, CalDAV and CardDAV
- [gowebdav](https://github.com/studio-b12/gowebdav) - WebDAV client library and command line tool

### Java

- [Jackrabbit WebDAV Library](https://jackrabbit.apache.org/jcr/components/jackrabbit-webdav-library.html) - WebDAV Library component of the Apache Jackrabbit project

### JavaScript

- [webdav](https://github.com/perry-mitchell/webdav-client) - WebDAV client written in JavaScript for NodeJS and the browser
- [unifile](https://github.com/silexlabs/unifile) - NodeJS library to access cloud storage which supports WebDAV

### Python

- [webdavclient3](https://pypi.org/project/webdavclient3/) - WebDAV client for Python 3.x

## Cloud providers

_Cloud services that offer a WebDAV server or otherwise allow access via WebDAV_

- [4shared](https://www.4shared.com/web/helpCenter/fGeDNHCrXce#par_eight) fully supports WebDAV and allows synchronization over it
- [Nextcloud](https://docs.nextcloud.com/server/latest/user_manual/en/files/access_webdav.html) fully supports WebDAV and allows synchronization over it
- [ownCloud](https://doc.owncloud.org/server/latest/user_manual/files/access_webdav.html) fully supports WebDAV and allows synchronization over it
- [Yandex.Disk](https://yandex.com/dev/disk/webdav/) has a WebDAV API that treats its storage like a file system
- [~~Box~~](https://support.box.com/hc/en-us/articles/360043696414-WebDAV-with-Box) has a WebDAV URL that allows access via WebDAV (no longer supported)

## Extensions

_Protocol extensions and related protocols_

- [CalDAV](https://en.wikipedia.org/wiki/CalDAV)
- [CardDAV](https://en.wikipedia.org/wiki/CardDAV)
- [GroupDAV](https://en.wikipedia.org/wiki/GroupDAV)
- [Microsoft Extensions](https://docs.microsoft.com/en-us/openspecs/sharepoint_protocols/ms-wdvme/8cafdf55-ee5c-443e-bdb7-2cb2ab1fb2c3)

## Contribute

Contributions welcome! Read the [contribution guidelines](contributing.md) first.

## License

[![CC0](http://mirrors.creativecommons.org/presskit/buttons/88x31/svg/cc-zero.svg)](https://creativecommons.org/publicdomain/zero/1.0/)

repository: rukavitsin/awesome-webdav

repo_name: rukavitsin/awesome-webdav


text:
# Publish over OneDrive plugin for Jenkins

Based on publish-to-ftp and extending publish-to and basic-credentials this Jenkins plugin publishes artifacts in a post-build to onedrive folders without the need to run a sync client on your build server.

# Registration
1. Register your client application on [Mirosoft Developers](http://go.microsoft.com/fwlink/p/?LinkId=193157)
2. The drive is created at the first login. Login into your account in the web browser, otherwise you will get an authentication error if you try to run the SDK with your credentials.
    - The user have to be logged in at least once to use your application.
3. A development authentication token can be obtained on [OneDrive authentication](https://dev.onedrive.com/auth/msa_oauth.htm).
4. More details can be found [here](https://dev.onedrive.com/app-registration.htm)

**Once your app is registered you'll want to note both your Client ID and Client Secret. They will be used when configuring you credentials in the next step.**

# Configure Credentials
The first step to configuring the pubish-over Onedrive plugin is to connect your Onedrive account. To do so, navigate to **Jenkins > Credentials**

license: MIT

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
---
title: App Lab Docs
embedded_layout: simple_embedded
---

[name]

## circle(x, y, radius)

[/name]

[category]

Category: Canvas

[/category]

[description]

[short_description]

Draws a circle on the active canvas with its center at the specified (x, y) location and with the specified radius.

[/short_description]

You can draw many things with the basic canvas drawing functions of circle, line and rect. For circle(), the x and y coordinates specify the center of the circle, relative to the top-left corner of the canvas (x:0 y:0). The radius is measured in pixels. Circles are drawn using the current stroke width and current stroke color, and then filled with the current fill color (if the fill color is anything other than the default "transparent").

[/description]

### Examples
____________________________________________________

[example]

```
// Draw a circle centered on the screen with the default stroke color, width, fill color.
createCanvas("canvas1");
circle(160, 240, 100);
```

[/example]

____________________________________________________

[example]

**Example: Red Line**  Change the color of the circle outline.

```
// Change the color of the circle outline.
createCanvas("canvas1");
setStrokeColor("red");
circle(160, 240, 100);
```

[/example]

____________________________________________________

[example]

**Example: Red Dot**  Change the color of the circle fill (note the outline is still defailt black).

```
// Change the color of the circle fill (note the outline is still defailt black).
createCanvas("canvas1");
setFillColor("red");
circle(160, 240, 100);
```

[/example]

____________________________________________________

[example]

**Example: Thick Outline** Change the thickness of the circle outline.

```
//  Change the thickness of the circle outline.
createCanvas("canvas1");
setStrokeWidth(20);
circle(160, 240, 100);
```

[/example]

____________________________________________________

[example]

**Example: Two Circles** Draw two circles at the same location and with the same radius but with different stroke widths.

```
// Draw two circles at the same location and with the same radius but with different stroke widths.
createCanvas("canvas1");
setStrokeWidth(40);
setStrokeColor("lightblue");
circle(160, 240, 100);
setStrokeWidth(1);
setStrokeColor("black");
circle(160, 240, 100);
```

[/example]

____________________________________________________

[example]

**Example: Overlapping Circles** Shows the difference between drawing a circle filled with white pixels and a circle filled with transparent pixels.

```
createCanvas("canvas1");
setFillColor("white");
circle(100, 100, 50);
circle(100, 150, 50);
setStrokeColor("red");
setFillColor("transparent");
circle(200, 100, 50);
circle(200, 150, 50);
```

[/example]

____________________________________________________

[example]

**Example: Part of a Circle** Draw a circle larger than the canvas so that only the portion inside the canvas is visible.

```
// Draw a circle larger than the canvas so that only the portion inside the canvas is visible.
createCanvas("mouth", 120, 50);
setActiveCanvas("mouth");
setPosition("mouth", 100, 260);
setStrokeWidth(15);
circle(60, -15, 50);
```

[/example]

____________________________________________________

[syntax]

### Syntax

```
circle(x, y, radius)
```

[/syntax]

[parameters]

### Parameters

| Name  | Type | Required? | Description |
|-----------------|------|-----------|-------------|
| x | number | Yes | The x position in pixels of the center of the circle relative to the upper left corner of the active canvas. |
| y | number | Yes | The y position in pixels of the center of the circle relative to the upper left corner of the active canvas. |
| radius | number | Yes | The radius of the circle, in pixels. |

[/parameters]

[returns]

### Returns
No return value. Outputs to the display only.

[/returns]

[tips]

### Tips

- A canvas element must be created before a circle can be drawn. Create a canvas element in Design mode first, or call [createCanvas()](/applab/docs/createCanvas) before calling circle.
- If you're having trouble getting a circle to show up, make sure that you're trying to draw the circle within the bounds of the active canvas.
- Change the width of the line, color of the line, and fill color used to draw all subsequent circles using [setStrokeWidth](/applab/docs/setStrokeWidth), [setStrokeColor](/applab/docs/setStrokeColor). and [setFillColor](/applab/docs/setFillColor).
- When drawing thick lines, the radius of the circle defines the center of the perimeter line. The outside radius of the circle will be the specified radius plus half the stroke width.

[/tips]

[bug]

Found a bug in the documentation? Let us know at<EMAIL_ADDRESS>
[/bug]

<%= view :applab_docs_common %>

repository: stevekrenzel/code-dot-org

branch_name: refs/heads/staging

repo_name: stevekrenzel/code-dot-org


text:
#Thermometer

```
    |   ^F     _    ^C   |
    |  100  - | | -  40  |
    |   90  - | | -  30  |
    |   80  - | | -  25  |
    |   70  - | | -  20  |
    |   60  - | | -  15  |
    |   50  - | | -  10  |
    |   40  - | | -   5  |
    |   30  - | | -   0  |
    |   20  - | | -  -5  |
    |   10  - | | - -10  |
    |    0  - | | - -20  |
    |  -10  - | | - -25  |
    |  -20  - |_| - -30  |
    |  -30  - |*| - -35  |
    |        '***`       |
    |       (*****)      |
    |        `---'       |
    |____________________|
```

Specification
=============
* Starts at 20C
* Minimum temperature 10C
* Maximum temperature 32C
* Power saving mode: maximum temperature 25C
* Power saving mode: ON by default

User Stories
============

```
As a user,
So that I can make my house warmer,
I want to increase the temperature on my thermostat.
```

```
As a user,
So that my house doesn't get too hot,
I want to turn down the temperature on my thermostat.
```

```
As a user,
So that I can choose how much power I'm using,
I want to be able to toggle power saving mode on my thermostat.
```

```
As a user,
So that I can reset my thermometer,
I want a reset function.
```

```
As a user,
So I can be aware of how much power I'm using,
I want to be able to see my thermostats energy usage.
```

repository: dinespoulsen/thermostat

repo_name: dinespoulsen/thermostat


text:
# Firebase Performance

Firebase Performance is a free mobile app performance analytics service. It
provides detailed information about the performance of your apps automatically,
but works at its best with customized metrics set by you. For more information
about app performance and many other cool mobile services, check out [Firebase]
(https://firebase.google.com).

## Getting Started with Cocoapods

1.  Follow the instructions for
    [setting up Firebase](https://developers.google.com/firebase/docs/ios/)
2.  Add the following to your Podfile

    ```
    pod 'Firebase/Performance'
    ```

repository: devMEremenko/XcodeBenchmark

gha_language: Swift

gha_license_id: MIT

repo_name: devMEremenko/XcodeBenchmark


text:
# docker-cyon-apache

build a cyon shared apache like container for local development

usage:

In your php project, create a compose file:

```
version: '2'
services:
  cyon:
    image: jangalinski/cyon-apache
    container_name: <YOUR_CONTAINER_NAME>
    ports:
      - "<YOUR_LOCAL_PORT>:80"
    volumes:
      - ./:/var/www/html
```

then run with `docker-compose up` and enjoy.

repository: jangalinski/docker-cyon-apache

repo_name: jangalinski/docker-cyon-apache


text:
# Testing (with Jest)

Run `npm test` to run a test add `-- --watch` to run it in developer mode.

Tests should be placed in their related parents folder to keep consistency, i.e __components/\_\_tests\_\___ or __containers/\_\_tests\_\___

- (Snapshot testing) https://facebook.github.io/jest/docs/tutorial-react-native.html#snapshot-test
- (DOM testing WIP) https://facebook.github.io/jest/docs/tutorial-react.html#dom-testing

repository: LancCJ/react-native-cyber-police

repo_name: LancCJ/react-native-cyber-police


text:
CHANGELOG for 3.x
=================
## 3.5.0
* Deprecate `Bacow\DNS\Rdata\Algorithms`, use `Bacow\DNS\Algorithms` instead.
* New classes to support full stack DNS message:
  * `Badcow\DNS\Message`
  * `Badcow\DNS\Opcode`
  * `Badcow\DNS\Question`
* New method: `Badcow\DNS\Parser\StringIterator::getRemainingAsString()`.
* Additional parameters added to `Badcow\DNS\Rdata\RdataInterface::fromWire()`: `RdataInterface::fromWire(string $rdata, int &$offset = 0, ?int $rdLength = null)`.
* `Badcow\DNS\Rdata\RdataTrait::decodeName()` now can interpret RFC1035 compressed names in a DNS message context.
## 3.4.1
* [Issue #65](https://github.com/Badcow/DNS/issues/65): Correct replacement name validation in `NAPTR` Rdata.
## 3.4.0
* If the default TTL control entry `$TTL` is set, the `Parser` will set the TTL on all resource records to that TTL if one is not explicitly set.
If no `$TTL` is set, then the resource record will adopt the last defined $TTL.
* Fixed bug where orphan comments were not being ignored.
## 3.3.0
* Parser no longer ignores $ORIGIN control entry. The $ORIGIN will overwrite the first parameter of `Parser::Parse()`.
## 3.2.0
* [Issue #60](https://github.com/Badcow/DNS/issues/60): Correct resource name verification in `Parser`.
* [Issue #61](https://github.com/Badcow/DNS/issues/61): Order unordered types in `AlignedBuilder`.
* [Issue #61](https://github.com/Badcow/DNS/issues/61): Add an alignment formatter for RRSIG records that breaks the signature over multiple lines.
## 3.0
* Use `rlanvin/php-ip` version 2 [Issue #43](https://github.com/Badcow/DNS/issues/43).
* Namespace `Badcow\DNS\Rdata\DNSSEC` is deprecated and deleted. [Issue #42](https://github.com/Badcow/DNS/issues/42).
* Deleted deprecated constants:
  * `\Badcow\DNS\Parser\Normaliser::COMMENTS_NONE`
  * `\Badcow\DNS\Parser\Normaliser::COMMENTS_END_OF_RECORD_ENTRY`
  * `\Badcow\DNS\Parser\Normaliser::COMMENTS_WITHIN_MULTILINE`
  * `\Badcow\DNS\Parser\Normaliser::COMMENTS_WITHOUT_RECORD_ENTRY`
  * `\Badcow\DNS\Parser\Normaliser::COMMENTS_ALL`
* Upgraded to PHPUnit 8.
* Deprecated and deleted method `RdataInterface::output()` in favour of `RdataInterface::toText()`.
* New `RdataInterface` methods:
  * `RdataInterface::toText()` same as `RdataInterface::output()`
  * `RdataInterface::fromText()` construct an Rdata object from an Rdata string.
  * `RdataInterface::toWire()` Return rdata in its wire format ready to be placed in DNS request/response packet.
  * `RdataInterface::fromWire()` construct an Rdata object from wire formatted Rdata.
  * `RdataInterface::getTypeCode()` return the IANA Resource Record type code.
* Enforce strict_types [Issue #37](https://github.com/Badcow/DNS/issues/37).
* Support more additional RDATA types [Issue #55](https://github.com/Badcow/DNS/issues/55):
  * AFSDB
  * CDNSKEY
  * CDS
  * CERT
  * CSYNC
  * DHCID
  * DLV
  * HIP
  * IPSECKEY
  * KEY
  * KX
  * NAPTR
  * NSEC3
  * NSEC3PARAM
  * RP
  * SIG
  * SSHFP
  * TA
  * TKEY
  * TLSA
  * TSIG
  * URI
* New Validator methods:
  * `Validator::isBase64Encoded()`
  * `Validator::isUnsignedInteger()`
  * `Validator::isBase16Encoded()`
  * `Validator::isBase32Encoded()`
  * `Validator::isBase32HexEncoded()`
* Deprecate and delete NSEC methods:
  * `NSEC::addTypeBitMap()` replaced with `NSEC::addType()`
  * `NSEC::clearTypeMap()` replaced with `NSEC::clearTypes()`
  * `NSEC::getTypeBitMaps()` replaced with `NSEC::getTypes()`
* Deleted ResourceRecord::__construct(); the same functionality has been moved to static method ResourceRecord::create();
* Rename class `Bacow\DNS\Rdata\TypeCodes` to `Badcow\DNS\Rdata\Types`.
* Delete class `Badcow\DNS\Parser\RDataTypes` as the same functionality exists in `Badcow\DNS\Rdata\Types`.
* Added the Unknown Record Type `Badcow\DNS\Rdata\UnknownType` which complies with [RFC 3597 - Handling of Unknown DNS Resource
  Record (RR) Types](https://tools.ietf.org/html/rfc3597).
* Deleted class `Badcow\DNS\IP\Toolbox`, moved all methods to `Badcow\DNS\IP\PTR`.

repository: Livda/DNS

gha_language: PHP

repo_name: Livda/DNS


text:
---
date: 2021-05-07
title: "Employ K3S on a Pi Cluster"
linkTitle: "Employ K3S on a Pi Cluster"
description: "Easily install your own K3S cluster on Raspberry Pis"
author: Anthony Orlowski, Richard Otten, Gregor von Laszewski ([laszewski@gmail.com](mailto:laszewski@gmail.com)) [laszewski.github.io](https://laszewski.github.io), Richard Otten
resources:
- src: "**.{png,jpg}"
  title: "Image #:counter"
---

{{< imgproc image Fill "600x300" >}}
{{< /imgproc >}}

{{% pageinfo %}}

Install, manage, operate, and uninstall K3s on a cluster of Raspberry Pis
running Raspberry OS or Ubuntu.

**Learning Objectives**

* Learn how to easily install, manage, operate, and unisntall a K3S cluster
  using `cms`.

**Topics covered**

{{% table_of_contents %}}

{{% /pageinfo %}}

## 1. Introduction

K3S provides a lightweight, single binary distribution of Kubernetes with
very close feature parity to K8s that is perfect for single board computers
like the Raspberry Pi. In this tutorial we will install, verify, and
unistall K3s on a cluster of Pis that was created using the Cloudmesh burn
software.

## 2. Prequisites

This tutorial assumes a cluster burned using one of the following methods:

[Burn a Raspberry OS Cluster](https://cloudmesh.github.io/pi/tutorial/raspberry-burn/)

[Burn an Ubuntu Cluster](https://cloudmesh.github.io/pi/tutorial/ubuntu-burn/)

[Use our GUI to Burn a Cluster](https://cloudmesh.github.io/pi/tutorial/gui-burn/)

The tutorial supports both Raspberry OS and Ubuntu with no required user
input change.

## 3.  Enable Containers

This command adds `'cgroup_enable=cpuset cgroup_memory=1
cgroup_enable=memory'` to the end of the arguments in `cmdline.txt` if
they are not already present, and reboots the machines. This is required to
enable containers in the kernel.

```
you@your-laptop:~$ cms pi k3 enable containers red,red0[1-3]
pi k3 enable containers red,red0[1-3]
INFO: Enabling cgroups for ['red', 'red01', 'red02', 'red03']
+-------+---------+--------+
| host  | success | stdout |
+-------+---------+--------+
| red   | True    |        |
| red01 | True    |        |
| red02 | True    |        |
| red03 | True    |        |
+-------+---------+--------+
INFO: Executing `sudo reboot` for ['red01', 'red02', 'red03']
INFO: Executing `sudo reboot` for red
```

## 5. Install K3s on the Entire Cluster

This command wil install a K3S cluster with the manager (red) acting as the K3s
server, and the workers and the manager will be installed as agents of that
server.  Some output removed for brevity
```

## 6. Verify the K3S Cluster Install

Wait a moment for k3s to set up initial containers.

Let us check that server reports the appropriate nodes as members.

We can run remote commands with the `cms host ssh` command as well as using
K3S specific commands.

For example to get cluster information we can run

```
you@your-laptop:~$ cms pi k3 cluster info red
pi k3 cluster info red
INFO: Getting cluster info for red
INFO: sudo kubectl get nodes -o wide
NAME    STATUS   ROLES                  AGE   VERSION        INTERNAL-IP   EXTERNAL-IP    OS-IMAGE                         KERNEL-VERSION   CONTAINER-RUNTIME
red03   Ready    <none>                 28s   v1.20.5+k3s1   <IP_ADDRESS>      <none>         Raspbian GNU/Linux 10 (buster)   5.10.17-v7l+     containerd://1.4.4-k3s1
red02   Ready    <none>                 30s   v1.20.5+k3s1   <IP_ADDRESS>      <none>         Raspbian GNU/Linux 10 (buster)   5.10.17-v7l+     containerd://1.4.4-k3s1
red01   Ready    <none>                 27s   v1.20.5+k3s1   <IP_ADDRESS>      <none>         Raspbian GNU/Linux 10 (buster)   5.10.17-v7l+     containerd://1.4.4-k3s1
red     Ready    control-plane,master   84s   v1.20.5+k3s1   <IP_ADDRESS>      <IP_ADDRESS>   Raspbian GNU/Linux 10 (buster)   5.10.17-v7l+     containerd://1.4.4-k3s1
INFO: Server node token
K106f1caa41b133e69a69b1e3ac1da3a451393029e382be846eb0bcb7dfc7eab2db::server:2d604411ff6ab2a7c162bc4e82292690
INFO: Containers running on nodes
NODE: red03
CONTAINER           IMAGE               CREATED             STATE               NAME                ATTEMPT             POD ID
a24076569fa00       7d23a14d38d24       5 seconds ago       Running             lb-port-443         0                   70adcf7269a03
3332e6b1f602d       7d23a14d38d24       6 seconds ago       Running             lb-port-80          0                   70adcf7269a03
2f1273e3eca91       d24dd28770a36       15 seconds ago      Running             metrics-server      0                   0ca2190dba121

NODE: red02
CONTAINER           IMAGE               CREATED             STATE               NAME                     ATTEMPT             POD ID
be2ca6f1b77a5       7d23a14d38d24       5 seconds ago       Running             lb-port-443              0                   fc85e830e60bd
98ae1280e7a59       7d23a14d38d24       6 seconds ago       Running             lb-port-80               0                   fc85e830e60bd
ebcc2edeb3926       1e695755cc09d       13 seconds ago      Running             local-path-provisioner   0                   140da1f145714

NODE: red01
CONTAINER           IMAGE               CREATED             STATE               NAME                ATTEMPT             POD ID
bb4a9295bc345       7d23a14d38d24       1 second ago        Running             lb-port-443         0                   9fc4bec3faae0
6ba339136ae1a       944e5aba28f45       1 second ago        Running             traefik             0                   87ce8f8685767
491c2d8832f8d       7d23a14d38d24       1 second ago        Running             lb-port-80          0                   9fc4bec3faae0
d12b76e2c51e7       a0ce6ab869a69       12 seconds ago      Running             coredns             0                   a1777698c457c

NODE: red
CONTAINER           IMAGE               CREATED             STATE               NAME                ATTEMPT             POD ID
afa997d47eb33       7d23a14d38d24       4 seconds ago       Running             lb-port-443         0                   524fcbbd2b879
d0921db7d2229       7d23a14d38d24       5 seconds ago       Running             lb-port-80          0                   524fcbbd2b879
```

Or we can run the commands directly with `cms host ssh` as demonstrated
below. This is useful for commands that may not be built into cms, or that
the user knows better than the cms shell commands.

>NOTE: `cms host ssh`
>commands go are interpreted first by bash and then by python, complex
>commands may not work without complex escape sequences.

```
you@your-laptop:~$ cms host ssh red \" sudo kubectl get nodes \"
host ssh red " sudo kubectl get nodes "
+------+---------+--------------------------------------------------+
| host | success | stdout                                           |
+------+---------+--------------------------------------------------+
| red  | True    | NAME    STATUS   ROLES                  AGE      |
|      |         | VERSION                                          |
|      |         | red01   Ready    <none>                 15m      |
|      |         | v1.20.5+k3s1                                     |
|      |         | red02   Ready    <none>                 15m      |
|      |         | v1.20.5+k3s1                                     |
|      |         | red03   Ready    <none>                 15m      |
|      |         | v1.20.5+k3s1                                     |
|      |         | red     Ready    control-plane,master   16m      |
|      |         | v1.20.5+k3s1                                     |
+------+---------+--------------------------------------------------+
```

## 7. Creating the Dashboard.

It is straightforward to create a dashboard for our newly created cluster.

If using Raspberry OS on the pis, run:

```
you@your-laptop:~$ cms pi k3 dashboard create red
```

If using Ubuntu Server on the pis, run:

```
you@your-laptop:~$ cms pi k3 dashboard create red --ubuntu
```

Both commands will automatically start the dashboard. However, on Ubuntu Server, `cms pi k3 dashboard start red` needs to be run when the pi is rebooted.

## 8. Accessing the Dashboard

We can easily access the Web UI Dashboard for easy management of our cluster.

First, let us connect to the new dashboard created above.

```
you@your-laptop:~$ cms pi k3 dashboard connect red
```

We should get a green "Connection created" message. We can now check on the status of our dashboard and obtain our token to log in.

```
you@your-laptop:~$ cms pi k3 dashboard info
pi k3 dashboard info
INFO: Finding running dashboards...
+---------------------+-------------+------------+------------------+-------+
| Server Access Point | Remote Port | Local Port | Dashboard Status | PID   |
+---------------------+-------------+------------+------------------+-------+
| red                 | 8001        | 8001       | Active           | 99240 |
+---------------------+-------------+------------+------------------+-------+
INFO: Dashboard Link:
http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/
INFO: Fetching authentication token...
# A long token will go here
```

> Note. If `Dasboard Status` says "Up but not ready", the k3s dashboard is still likely in the process of coming online. Wait a few moments and try the info command again.

Take note of the authentication token given. To open the dashboard, you may click on the link provided by the info command or use the following command to automaticallly open in browser.

```
you@your-laptop:~$ cms pi k3 dashboard
pi k3 dashboard
Opening dashboard...
```

When ready, you can then disconnect from your dashboard with the following:

```
you@your-laptop:~$ cms pi k3 dashboard disconnect
```

## 9. Adding a new machine to the cluster

We will add a new machine red04 to be an agent of the red hosted cluster.

```
you@your-laptop:~$ cms pi k3 install agent red04 red
pi k3 install agent red04 red
INFO: Installing K3s on red04 as agent of red
INFO: Fetching the server token
+-------+---------+--------------------------------------------------+
| host  | success | stdout                                           |
+-------+---------+--------------------------------------------------+
| red04 | True    | [INFO]  Finding release for channel stable       |
|       |         | [INFO]  Using v1.20.5+k3s1 as release            |
|       |         | [INFO]  Downloading hash https://github.com/k3s- |
|       |         | io/k3s/releases/download/v1.20.5+k3s1/sha256sum- |
|       |         | arm.txt                                          |
|       |         | [INFO]  Downloading binary https://github.com/k3 |
|       |         | s-io/k3s/releases/download/v1.20.5+k3s1/k3s-armh |
|       |         | f                                                |
|       |         | [INFO]  Verifying binary download                |
|       |         | [INFO]  Installing k3s to /usr/local/bin/k3s     |
|       |         | [INFO]  Creating /usr/local/bin/kubectl symlink  |
|       |         | to k3s                                           |
|       |         | [INFO]  Creating /usr/local/bin/crictl symlink   |
|       |         | to k3s                                           |
|       |         | [INFO]  Creating /usr/local/bin/ctr symlink to   |
|       |         | k3s                                              |
|       |         | [INFO]  Creating killall script                  |
|       |         | /usr/local/bin/k3s-killall.sh                    |
|       |         | [INFO]  Creating uninstall script                |
|       |         | /usr/local/bin/k3s-agent-uninstall.sh            |
|       |         | [INFO]  env: Creating environment file           |
|       |         | /etc/systemd/system/k3s-agent.service.env        |
|       |         | [INFO]  systemd: Creating service file           |
|       |         | /etc/systemd/system/k3s-agent.service            |
|       |         | [INFO]  systemd: Enabling k3s-agent unit         |
|       |         | [INFO]  systemd: Starting k3s-agent              |
+-------+---------+--------------------------------------------------+
```

## 10. Uninstall the K3S Cluster

We can also easily uninstall the K3S cluster.

```
you@your-laptop:~$ cms pi k3 uninstall cluster red,red0[1-3]
pi k3 uninstall cluster red,red0[1-3]
INFO: Uninstalling agent install of K3s on ['red', 'red01', 'red02', 'red03', red04']
+-------+---------+--------------------------------------------------+
| host  | success | stdout                                           |
+-------+---------+--------------------------------------------------+
| red   | True    | /usr/bin/systemctl                               |
|       |         | Additional k3s services installed, skipping      |
|       |         | uninstall of k3s                                 |
| red01 | True    | /usr/bin/systemctl                               |
| red02 | True    | /usr/bin/systemctl                               |
| red03 | True    | /usr/bin/systemctl                               |
| red04 | True    | /usr/bin/systemctl                               |
+-------+---------+--------------------------------------------------+
INFO: Uninstalling server install of K3s on red
+------+---------+--------------------+
| host | success | stdout             |
+------+---------+--------------------+
| red  | True    | /usr/bin/systemctl |
+------+---------+--------------------+
```

## 11. Add a New Standalone K3S Server

Now we will create a new standalone K3s server on red05.

```
you@your-laptop:~$ cms pi k3 install server red05
pi k3 install server red05
INFO: Installing K3s as stand-alone server on ['red05']
+-------+---------+--------------------------------------------------+
| host  | success | stdout                                           |
+-------+---------+--------------------------------------------------+
| red05 | True    | [INFO]  Finding release for channel stable       |
|       |         | [INFO]  Using v1.20.5+k3s1 as release            |
|       |         | [INFO]  Downloading hash https://github.com/k3s- |
|       |         | io/k3s/releases/download/v1.20.5+k3s1/sha256sum- |
|       |         | arm.txt                                          |
|       |         | [INFO]  Downloading binary https://github.com/k3 |
|       |         | s-io/k3s/releases/download/v1.20.5+k3s1/k3s-armh |
|       |         | f                                                |
|       |         | [INFO]  Verifying binary download                |
|       |         | [INFO]  Installing k3s to /usr/local/bin/k3s     |
|       |         | [INFO]  Creating /usr/local/bin/kubectl symlink  |
|       |         | to k3s                                           |
|       |         | [INFO]  Creating /usr/local/bin/crictl symlink   |
|       |         | to k3s                                           |
|       |         | [INFO]  Creating /usr/local/bin/ctr symlink to   |
|       |         | k3s                                              |
|       |         | [INFO]  Creating killall script                  |
|       |         | /usr/local/bin/k3s-killall.sh                    |
|       |         | [INFO]  Creating uninstall script                |
|       |         | /usr/local/bin/k3s-uninstall.sh                  |
|       |         | [INFO]  env: Creating environment file           |
|       |         | /etc/systemd/system/k3s.service.env              |
|       |         | [INFO]  systemd: Creating service file           |
|       |         | /etc/systemd/system/k3s.service                  |
|       |         | [INFO]  systemd: Enabling k3s unit               |
|       |         | [INFO]  systemd: Starting k3s                    |
+-------+---------+--------------------------------------------------+
```

To subsequently add this server as an agent to itself, you will need to run

```
you@your-laptop:~$ cms pi k3 install agent red05 red05
```

## 12. Uninstall a specific K3S server

```
you@your-laptop:~$ cms pi k3 uninstall server red05
```

## 13. Uninstall a Specific K3S Agent

```
you@your-laptop:~$ cms pi k3 uninstall agent red06
```

## 14. Kill all K3S Services and Containers on Hosts

This command runs the K3s provided `k3s-kill-all.sh` script that "cleans up containers, K3s directories, and networking components while also removing the iptables chain with all the associated rules. The cluster data will not be deleted."

```
you@your-laptop:~$ cms pi k3 kill red,red0[1-3]
pi k3 kill red,red0[1-3]
INFO: Stopping k3s services and containers on ['red01', 'red02', 'red03']
+-------+---------+--------+
| host  | success | stdout |
+-------+---------+--------+
| red01 | True    |        |
| red02 | True    |        |
| red03 | True    |        |
+-------+---------+--------+
INFO: Stopping k3s services and containers on red
+------+---------+--------+
| host | success | stdout |
+------+---------+--------+
| red  | True    |        |
+------+---------+--------+
```

## 15. Start the K3S Cluster Services

This command starts systemd the services `k3s` for the server and `k3s-agent`
for
the agents.

```
you@your-laptop:~$ cms pi k3 start cluster red,red0[1-3]
pi k3 start cluster red,red0[1-3]
INFO: Starting server on red
+------+---------+--------+
| host | success | stdout |
+------+---------+--------+
| red  | True    |        |
+------+---------+--------+
INFO: Starting agent on ['red', 'red01', 'red02', 'red03']
+-------+---------+--------+
| host  | success | stdout |
+-------+---------+--------+
| red   | True    |        |
| red01 | True    |        |
| red02 | True    |        |
| red03 | True    |        |
+-------+---------+--------+
```

## 16. Stop the K3S Cluster Services

This command stops the systemd services `k3s` for the server and `k3s-agent`
for
the agents.

```
you@your-laptop:~$ cms pi k3 stop cluster red,red0[1-3]
pi k3 stop cluster red,red0[1-3]
INFO: Stopping server on red
+------+---------+--------+
| host | success | stdout |
+------+---------+--------+
| red  | True    |        |
+------+---------+--------+
INFO: Stopping agent on ['red', 'red01', 'red02', 'red03']
+-------+---------+--------+
| host  | success | stdout |
+-------+---------+--------+
| red   | True    |        |
| red01 | True    |        |
| red02 | True    |        |
| red03 | True    |        |
+-------+---------+--------+
```

## 17. Remove a Node from the Cluster

Let us remove red01 from the K3s cluster server red.

```
you@your-laptop:~$ cms pi k3 remove node red01 red
pi k3 remove node red01 red
INFO: Removing agents red01 from server red
INFO: Draining agent red01
+------+---------+---------------------+
| host | success | stdout              |
+------+---------+---------------------+
| red  | True    | node/red01 cordoned |
|      |         | node/red01 drained  |
+------+---------+---------------------+
INFO: Deleting agents red01
+------+---------+----------------------+
| host | success | stdout               |
+------+---------+----------------------+
| red  | True    | node "red01" deleted |
+------+---------+----------------------+
```

repository: CoopYoung/pi

branch_name: refs/heads/main

repo_name: CoopYoung/pi


text:
# WT Booking API

[![Greenkeeper badge](https://badges.greenkeeper.io/windingtree/wt-booking-api.svg)](https://greenkeeper.io/)

A sample implementation of the WT booking API specification in node.js.

This server is assumed to handle booking requests for a single
hotel. Within this scope, it:

- Validates booking requests against hotel data in WT (rate plans,
  cancellation policies, available rooms)

- Checks the sender's trustworthiness and message integrity based on
  configurable trust clues and lists.

- Performs the necessary bookkeeping directly in the WT platform
  (i.e. it updates availability data based on accepted booking
  requests). This implementation does not change availability
  for the date of departure.

**Note: we do not expect this API implementation to be run in
production "as is"; instead, we assume that it should serve more
as an inspiration or as a basis on which actual integrations
between existing systems and Winding Tree can be built.**

## Requirements
- Nodejs 10.x

## Development
In order to install and run tests, we must:
```
git clone git@github.com:windingtree/wt-write-api.git
nvm install
npm install
npm run resolve-swagger-references
npm test
```

### Running in dev mode

To run the server, you need to go through the following steps:

1. Make sure you have access to a running instance of [wt-read-api](https://github.com/windingtree/wt-read-api) and
   [wt-write-api](https://github.com/windingtree/wt-write-api).
   Currently, version 0.8.x of wt-read-api is assumed.
2. If you do not have one yet, create an account in the write API
   (see the [README](https://github.com/windingtree/wt-write-api) for instructions).
3. If you have not done that yet, register your hotel in WT
   using the write API. Do not forget to upload the rate plans and
   initial availability data.
4. Based on `src/config/dev.js`, prepare a new configuration
   file with the appropriate settings (read/write
   API urls, access keys, hotel ID, etc.). Let's assume you will
   store it as `src/config/prod.js`.
5. Now you can run the server with the newly created
   configuration:

   ```sh
   WT_CONFIG=prod node src/index.js
   ```

## Running this server

### Docker

You can run the whole API in a docker container, and you can
control which config will be used by passing an appropriate value
to WT_CONFIG variable at runtime. Database will be setup during the
container startup in the current setup. You can skip this with
`SKIP_DB_SETUP` environment variable.

```sh
$ docker build -t windingtree/wt-booking-api .
$ docker run -p 8080:8935 -e WT_CONFIG=playground windingtree/wt-booking-api
```
After that you can access the wt-booking-api on local port `8080`.

### NPM

You can install and run this from NPM as well:

```sh
$ npm install -g @windingtree/wt-booking-api
$ WT_CONFIG=playground wt-booking-api
```

This will also create a local SQLite instance in the directory
where you run the `wt-booking-api` command. To prevent that,
you can suppress DB creation with `SKIP_DB_SETUP` environment
variable.

### Running in production

You can customize the behaviour of the instance by many environment
variables which get applied if you run the API with `WT_CONFIG=envvar`.
These are:

- `BASE_URL` - Base URL of this API instance, for example `https://booking-mazurka.windingtree.com`.
- `DB_CLIENT` - [Knex](https://knexjs.org/) database client name, for example `sqlite3`.
- `DB_CLIENT_OPTIONS` - [Knex](https://knexjs.org/) database client options as JSON string, for
example `{"filename": "./envvar.sqlite"}`.
- `READ_API_URL` - URL of [wt-read-api](https://github.com/windingtree/wt-read-api) instance.
- `WRITE_API_URL` - URL of [wt-write-api](https://github.com/windingtree/wt-write-api) instance.
- `SUPPLIER_ID` - On-chain Address of the hotel or airline.
- `WRITE_API_KEY` - Access Key for wt-write-api instance.
- `WALLET_PASSWORD` - Password for an Ethereum wallet associated with used wt-write-api key.
- `LOG_LEVEL` - Set log level for [winston](https://www.npmjs.com/package/winston).
- `WT_SEGMENT` - Choose segment (`hotels`, `airlines`) this instance is intended for. Defaults to `hotels`.
- `THROTTLING_ALLOW` - Allows only 10 bookings and cancellation in one hour if allowed. Defaults to `true`.
- `ALLOW_UNSIGNED_BOOKING_REQUESTS` - Accept only signed booking requests when false. Defaults to `true`.
- `SPAM_WHITELIST` - Comma separated list of eth addresses to always allow.
  Defaults to empty list.
- `SPAM_BLACKLIST` - Comma separated list of eth addresses to always
  reject. Defaults to empty list.

The following options are optional.

#### Checking

- `CHECK_AVAILABILITY` - If false, no restrictions and no room quantity is checked. This may lead
to overbooking. Defaults to true.
- `CHECK_CANCELLATION_FEES` - If false, passed cancellation fees are not validated. This may lead
to conditions unfavourable for a hotel. Defaults to true.
- `CHECK_TOTAL_PRICE` - If false, the price is not validated against ratePlans. This may lead
to conditions unfavourable for a hotel. Defaults to true.
- `DEFAULT_BOOKING_STATE` - This state is assigned to every accepted booking. Can be `confirmed`
or `pending`. Defaults to `confirmed`.

#### Data modification

- `UPDATE_AVAILABILITY` - If false, availability is not updated in data stored in WT platform. This
makes sense with using `DEFAULT_BOOKING_STATE` with `pending` value when you have to process the
booking manually anyway. Defaults to true.
- `ALLOW_CANCELLATION` - If false, booking cancellation is not allowed. Defaults to true.

#### Mailing

- `MAIL_SUPPLIER_CONFIRMATION_SEND` - If true, a summary of each accepted booking is sent to
`MAIL_SUPPLIER_CONFIRMATION_ADDRESS`. Requires configured mailer and that address. Defaults to false.
- `MAIL_CUSTOMER_CONFIRMATION_SEND` - If true, a summary of each accepted booking is sent
to the customer. Requires configured mailer. Defaults to false.
- `MAIL_SUPPLIER_CONFIRMATION_ADDRESS` - E-mail address to which the hotel confirmations will be
sent.
- `MAIL_PROVIDER` - Denotes which mailing provider should be used. Supported values are `dummy`
and `sendgrid`. Defaults to undefined.
- `MAIL_PROVIDER_OPTIONS` - JSON string with options of any given mailing provider. For example
`{"from"<EMAIL_ADDRESS>See providers implementation for particular options.

For boolean flags, any of '1', '0', 'true', 'false', 'yes', 'no' should work (case insensitive).

**The `CHECK_*` options are good for testing or APIs that actually pass data to humans that are
responsible for data validation.
Database will also be setup during the container startup in the current setup.
You can skip this with `SKIP_DB_SETUP` environment variable.

## Examples

### Book rooms

To perform a booking, you can send a request like this (just
make sure that the specifics, such as hotel ID or room type IDs,
are correct with respect to your hotel).

```sh
$ curl -X POST localhost:8935/booking -H 'Content-Type: application/json' --data '
{
  "hotelId": "0xe92a8f9a7264695f4aed8d1f397dbc687ba40299",
  "customer": {
    "name": "Sherlock",
    "surname": "Holmes",
    "address": {
      "line1": "221B Baker Street",
      "city": "London",
      "country": "GB"
    },
    "email"<EMAIL_ADDRESS>  },
  "pricing": {
    "currency": "GBP",
    "total": 221,
    "cancellationFees": [
      { "from": "2018-12-01", "to": "2019-01-01", "amount": 50 }
    ]
  },
  "booking": {
    "arrival": "2019-01-01",
    "departure": "2019-01-03",
    "rooms": [
      {
        "id": "single-room",
        "guestInfoIds": ["1"]
      },
      {
        "id": "single-room",
        "guestInfoIds": ["2"]
      }
    ],
    "guestInfo": [
      {
        "id": "1",
        "name": "Sherlock",
        "surname": "Holmes"
      },
      {
        "id": "2",
        "name": "John",
        "surname": "Watson"
      }
    ]
  }
}'
```

If everything went well, you should get a response with the
status code "200" and you should see a change in the hotel's
availability data.

There are more optional details you can send with the booking. You can check
it in the [API defintion](docs/swagger.yaml).

The [swagger definition](docs/swagger.yaml) for airlines is just a bit different:

```sh
$ curl -X POST localhost:8935/booking -H 'Content-Type: application/json' --data '
{
  "airlineId": "0xe92a8f9a7264695f4aed8d1f397dbc687ba40299",
  "customer": {
    "name": "Sherlock",
    "surname": "Holmes",
    "address": {
      "line1": "221B Baker Street",
      "city": "London",
      "country": "GB"
    },
    "email"<EMAIL_ADDRESS>  },
  "pricing": {
    "currency": "GBP",
    "total": 221,
    "cancellationFees": [
      { "from": "2018-12-01", "to": "2019-01-01", "amount": 50 }
    ]
  },
  "booking": {
    "flightNumber": "OK0965",
    "flightInstanceId": "IeKeix6G",
    "bookingClasses": [
      "bookingClassId": "business",
      "passengers": [
        "name": "John",
        "surname: "Watson",
      ],
    ],
  }
}'
```

## Spam protection
Exposing booking API openly to the wild is vulnerable to spamming and
other kinds of booking/cancellation requests by bad actors. We provide
several methods which can be combined to prevent this.

### Trust clues
An extensible list of trust clues allows you to evaluate virtually any
desirable condition in order to determine whether to trust the sender or
not. Please see documentation on the
[developer portal](https://github.com/windingtree/developers/blob/0bf96a7e5d8bda93e93b4b70ad97950e4d20bb20/book/tutorials/how-to-earn-trust.md#trust-clues)
to learn more about trust clues.
<!-- TODO change link to developers.wt.com when merged -->

### Access lists
Beside trust clues - which may be complicated to set up and take time to
evaluate (e.g. chain-based clues) - a simpler method of spam protection
is provided in the form of `SPAM_WHITELIST` and `SPAM_BLACKLIST`
envvars. All requests (both booking and cancellation) originated by
addresses on blacklist will be rejected and whitelisted addresses will
be accepted. For the rest the trust clues will be evaluated and request
will be accepted if all clues evaluate to true. Request will be accepted
if no trust clues are set up.

Lists can also be set via environment config files in `/src/config`.

> Note that unless `ALLOW_UNSIGNED_BOOKING_REQUESTS` is set to false,
> caller may bypass blacklist by not sending its `originAddress`.

### Message signing
To ensure the booking request has been sent by the declared party and not
modified in transfer, it is recommended (and can be enforced by setting
`ALLOW_UNSIGNED_BOOKING_REQUESTS = false`) to use signed requests.

A signed request contains an extra header (`x-wt-signature`)
containing a signature generated using sender's private key.
Signing can be done either using WtJsLibs.wallet.signData convenience method
or directly with [web3.eth_sign](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign).

The API verifies  the signature against the origin address and request data
thus proving immutability and accountability of the request.

`originAddress` is an ETH address of  the sender that serves as a public key.
Signed data mean:
- string representation of the body of a POST/PUT request (e.g. `HotelBooking` or `AirlineBooking` when creating a booking)
- URI of a GET/DELETE request (e.g. `https://booking.api/booking/1` when cancelling a booking)

> #### POST and PUT methods
> A raw string representation has to be used for both signing and verification as
> JSON serialization is ambiguous. You'll probably need to set the `content-type` header
> explicitly, depending on your HTTP request library.

> #### GET and DELETE methods
> As GET and DELETE HTTP methods should not contain request body, a different approach is used.
The hash is computed from the URI. In this case the origin address is not part of
the message and needs to be sent in a `x-wt-origin-address` header.
>
> Upon verification the hash is also computed based on the URI (instead of the raw request body) and
compared to the origin address from headers.

## Creating a booking
```js
const Web3Utils = require('web3-utils');
const wallet = wtJsLibs.createWallet(walletData);
wallet.unlock(walletPassword);

let booking = getBooking();  // HotelBooking or AirlineBooking according to docs/source.yaml
booking.originAddress = wallet.address;
let serializedData = JSON.stringify(booking);
let dataHash = Web3Utils.soliditySha3(serializedData);
let signature = await wallet.signData(dataHash);
request.post({
  uri: '/booking',
  body: serializedData,
  headers: {
    'x-wt-signature': signature,
    'content-type': 'application/json',
  }
});
```
Check
[hotel explorer code](https://github.com/windingtree/wt-hotel-explorer/blob/develop/src/actions/booking.jsx#L127)
for a working example and `src/services/signing/index.js` for
convenience methods.

## Cancelling a booking
```js
const Web3Utils = require('web3-utils');
const wallet = wtJsLibs.createWallet(walletData);
wallet.unlock(walletPassword);

let uri = `${bookingApi}/booking/${bookingId}`;
let dataHash = Web3Utils.soliditySha3(uri);
let signature = await wallet.signData(dataHash);
request.delete({
  uri: uri,
  headers: {
    'x-wt-signature': signature,
    'x-wt-origin-address': wallet.address,
  }
});
```

Further instructions on how to create a signed request are described in
[the developer's portal](https://github.com/windingtree/developers/blob/0bf96a7e5d8bda93e93b4b70ad97950e4d20bb20/book/tutorials/how-to-earn-trust.md#identity-and-message-signing).
<!-- TODO change link to developers.wt.com when merged -->

See our [blog post](https://blog.windingtree.com/building-trust-on-a-trustless-blockchain-ba71872f8541) for
a detailed explanation.

repository: jamesoshea/wt-booking-api

repo_name: jamesoshea/wt-booking-api


text:
# Covid-Project

## Description
The Covid Project is a website that contains the lastest statistics on the Covid-19 Pandemic. It contains a page where you can see each individual state's confirmed cases, total deaths, total vaccinations and percentage of people who are fully vaccinated. You can also find the nearest testing center.

## Team Members
- Sam Funk
- Mike Voynovich
- Dan Bohn

## Screenshots

## Deployment
https://covid-project1.herokuapp.com/

## Tools and APIs
- HTML
- CSS
- JQUERY Handlebars
- Node.js
- Express
- Sequelize
- api.positionstack.com
- Fast-csv and multer
- Axios

gha_language: JavaScript


text:
---
layout: default
---

# 1996-10-09 - "Forward Privacy" for ISPs and Customers

## Header Data

From: "Timothy C. May"<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Message Hash: 1444f41b4156d9411bf13ba73af4f774ca895414310a2686a04df268eccf9643

Message ID<EMAIL_ADDRESS>Reply To<EMAIL_ADDRESS>UTC Datetime: 1996-10-09 17:03:57 UTC

Raw Date: Wed, 9 Oct 1996 10:03:57 -0700 (PDT)

## Raw message

```
{% raw  %}From: "Timothy C. May"<EMAIL_ADDRESS>Date: Wed, 9 Oct 1996 10:03:57 -0700 (PDT)
To<EMAIL_ADDRESS>Subject: "Forward Privacy" for ISPs and Customers
In-Reply-To<EMAIL_ADDRESS>Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

IANAL, and I have been skimmming over most of the Bell v. Unicorn v. Nuri
debates about the legality of wiretapping, but something jumped out at me:

At 1:37 AM -0400 10/9/96, Black Unicorn wrote:

>include ISPs.  Constitutional arguments that ISPs are somehow different
>from phone companies and therefore not required to comply with wiretap
>orders?  Good luck.
>
>I know its fun to make the argument that ISPs and E-mail and NetPhone are
>all new technologies and so it must be unconstitutional to regulate them
>but the amusement in these cases stems from a wish that it was so, not
>fact or reason.

I agree that ISPs look a lot like phone companies for the purposes of
regulations and wiretaps. My ISP sells me some connectivity, sends me a
bill, etc.

Thus, if it is constitutionally OK (a technical term) for courts to order
phone logs to be turned over to law enforcement, why not logs of e-mail? Or
logs of Web sites visited, for example? I see no basis for a special
distinction. Records are records, and businesses routinely have to turn
over various records under court order.

However, there are certain things my phone company does *not* do. They
don't keep _copies_ (recordings) of my phone conversations. This means a
court order can't yield copies of past conversations. They also don't track
incoming phone calls to me. (I don't believe such records of incoming phone
calls are kept; maybe I'm wrong. Certainly with Caller ID, storing incoming
phone numbers is possible....I just don't think local or regional phone
companies care about such records, and hence don't bother to accumulate
them.)

Now, should the phone company keep such records, they would be accessible
via court order.

My point? ISPs are currently in a position to turn over *far* more
information than phone companies are able to turn over. It's as if the
phone companies kept audio recordings of all conversations, without even
the need for law enforcement to do a wiretap or pen register or whatnot. It
would be trivial for law enforcement to say: "Phone Company, here's a
subpoena/court order for the last 6 months of phone conversations Tim May
has had. Please ship the tapes via FedEx."

This makes the ISP case a bit different. Not legally, but technologically.

There are some fixes.

Something ISPs could do--and may do if there is sufficient customer
pressure--is to adopt a policy of "forward secrecy" (to slightly abuse this
technical term). That is, to have an explicit policy--implemented in the
software--of _really_ deleting the back messages once a customer downloads
them to his site. This means that _backups_ must be done in a careful
manner, such that even the backup tapes or disks are affected by a removal.

(Recall that Ollie North thought he had deleted his incriminating White
House PROFS messsages, but that they were faithfully preserved on backup
tapes, and could be retrieved.)

 An
option for users could be something like "Don't make longterm backups of my
account, and leave no copies whatsoever once I have downloaded my messages."

This would make the job of a law enforcement or TLA a lot more difficult
than it is now, where the e-mail and logs are ready to be handed over on a
silver platter, all nicely accumulated and human-readable.

Back to the legal issue. Perhaps the Digital Telephony Act will be
interpreted to require ISPs to make their systems "tappable," possibly by
adding message logging. possibly just by offering access to the T1s and T3s
only ("OK, Feds, here's where the T3 enters the building...be careful you
don't cut the core, OK?").

But if no logs and backup tapes of mail are kept, at least the job of
gaining access to communications is made more difficult.

And, I'm sure the lawyers will agree, while ISPs may be treated essentially
the same as telephone companies, absolutely *nothing* requires either to
keep specific kinds of account records (*), to "know their customer" (a la
banking laws, supposedly), or to record all traffic.

(* Prepaid phone cards, paid for in cash, and payphones, tell us that True
Names are not needed with the phone companies. And so on.)

We don't have to make it easy for them.

--Tim May

"The government announcement is disastrous," said Jim Bidzos,.."We warned IBM
that the National Security Agency would try to twist their technology."
[NYT, 1996-10-02]
We got computers, we're tapping phone lines, I know that that ain't allowed.
---------:---------:---------:---------:---------:---------:---------:----
Timothy C. May              | Crypto Anarchy: encryption, digital money,
<EMAIL_ADDRESS>408-728-0152 | anonymous networks, digital pseudonyms, zero
W.A.S.T.E.: Corralitos, CA  | knowledge, reputations, information markets,
Higher Power: 2^1,257,787-1 | black markets, collapse of governments.
"National borders aren't even speed bumps on the information superhighway."

{% endraw %}
```

## Thread

+ Return to [October 1996](/archive/1996/10)

+ Return to "[attila <attila@primenet.com>](/authors/attila_attila_at_primenet_com_)"
+ Return to "[Black Unicorn <unicorn@schloss.li>](/authors/black_unicorn_unicorn_at_schloss_li_)"
+ Return to "[David Lesher <wb8foz@nrk.com>](/authors/david_lesher_wb8foz_at_nrk_com_)"
+ Return to "[Declan McCullagh <declan@eff.org>](/authors/declan_mccullagh_declan_at_eff_org_)"
+ Return to "[jim bell <jimbell@pacifier.com>](/authors/jim_bell_jimbell_at_pacifier_com_)"
+ Return to "[Kevin L Prigge <Kevin.L.Prigge-2@tc.umn.edu>](/authors/kevin_l_prigge_kevin_l_prigge2_at_tc_umn_edu_)"
+ Return to "["Mark M." <markm@voicenet.com>](/authors/mark_m__markm_at_voicenet_com_)"
+ Return to "[Scott McGuire <svmcguir@syr.edu>](/authors/scott_mcguire_svmcguir_at_syr_edu_)"
+ Return to "["Timothy C. May" <tcmay@got.net>](/authors/timothy_c_may_tcmay_at_got_net_)"

+ 1996-10-09 (Wed, 9 Oct 1996 12:06:00 +0800) - [Re: Put up or shut up](/archive/1996/10/6459dc1d06be04c7a8a5143008f54d2f8d8fbec6a6b4dd6a48735b8e90ccf87a) - _jim bell<EMAIL_ADDRESS>  + 1996-10-09 (Wed, 9 Oct 1996 17:46:04 +0800) - [Creative Wiretap Arguments [Was :Re: Put up or shut up]](/archive/1996/10/de01d96d0c90d800d90fbf4357d8d784b75f998ccc4853ee1bc059dc6f098ec9) - _Black Unicorn<EMAIL_ADDRESS>    + 1996-10-12 (Fri, 11 Oct 1996 21:54:04 -0700 (PDT)) - [is there no end to AP & Creative Wiretap Arguments?](/archive/1996/10/62df0f8133bd8ba4e795b202bcac54e4516a01c24f84da226acf6616b3338e77) - _attila<EMAIL_ADDRESS>  + 1996-10-09 (Wed, 9 Oct 1996 10:03:57 -0700 (PDT)) - "Forward Privacy" for ISPs and Customers - _"Timothy C. May"<EMAIL_ADDRESS>    + 1996-10-09 (Wed, 9 Oct 1996 14:25:40 -0700 (PDT)) - [Re: "Forward Privacy" for ISPs and Customers](/archive/1996/10/ce5f40954ea142fb3f39e5df3f9cd4d0ed8cddbc41a8c64b403bb3b44249c5d7) - _"Mark M."<EMAIL_ADDRESS>      + 1996-10-10 (Thu, 10 Oct 1996 05:54:52 -0700 (PDT)) - [Re: "Forward Privacy" for ISPs and Customers](/archive/1996/10/fec1cc8629e75d4cfe0e3a6693aaab00593fa6fc398332388597183efde64f46) - _Declan McCullagh<EMAIL_ADDRESS>        + 1996-10-10 (Thu, 10 Oct 1996 13:21:19 -0700 (PDT)) - [Re: "Forward Privacy" for ISPs and Customers](/archive/1996/10/670e56110dfc0f30886caf0675c8d300a3b4b6669b9b736ea5351394f169bbd9) - _"Mark M."<EMAIL_ADDRESS>          + 1996-10-11 (Thu, 10 Oct 1996 21:06:54 -0700 (PDT)) - [Re: "Forward Privacy" for ISPs and Customers](/archive/1996/10/81a17ca6353087fe9d10de3cc20dab196dfdac1bb3ee31df4b106786c8ceb5c5) - _Declan McCullagh<EMAIL_ADDRESS>    + 1996-10-09 (Wed, 9 Oct 1996 15:26:49 -0700 (PDT)) - [Re: "Forward Privacy" for ISPs and Customers](/archive/1996/10/682059c603f5c98c3fdb4a2cbc5bf57aa428ef01ac7b0a983b844423e53092e5) - _Kevin L Prigge<EMAIL_ADDRESS>      + 1996-10-10 (Wed, 9 Oct 1996 21:36:43 -0700 (PDT)) - [Re: "Forward Privacy" for ISPs and Customers](/archive/1996/10/5d4f720bda97fa5e885c53d002f28edd3845af7c19985ef8132b08ff8ab592f6) - _David Lesher<EMAIL_ADDRESS>      + 1996-10-10 (Thu, 10 Oct 1996 16:24:15 -0700 (PDT)) - [Re: "Forward Privacy" for ISPs and Customers](/archive/1996/10/d8b272d2d48a623cd6b15183355694f1152b3378b2768b71cead20ffa38a8bd7) - _Scott McGuire<EMAIL_ADDRESS>    + 1996-10-10 (Wed, 9 Oct 1996 19:08:04 -0700 (PDT)) - [Re: "Forward Privacy" for ISPs and Customers](/archive/1996/10/fd23d08be03abf7e1deff0176f978e714a3640a0fd11157b61d8c9177f37cbc5) - _"Timothy C. May"<EMAIL_ADDRESS>    + 1996-10-11 (Fri, 11 Oct 1996 14:02:30 -0700 (PDT)) - [Re: "Forward Privacy" for ISPs and Customers](/archive/1996/10/72eb412228aa4aab5500b6fd0fb5c5cf388934eb8c18908e17d24da3a35f9062) - _attila<EMAIL_ADDRESS>


text:
[![Build Status](https://travis-ci.org/JaroslawPokropinski/screen-sharing-web.svg?branch=master)](https://travis-ci.org/JaroslawPokropinski/screen-sharing-web)
[![Netlify Status](https://api.netlify.com/api/v1/badges/e9ff8406-7667-46c1-8d70-798cf9eaa744/deploy-status)](https://app.netlify.com/sites/screensharing/deploys)

# screen-sharing-web

Screen-sharing-web is an app written in web technologies allowing users to share their screen in browser.

## Usage

Use node 12.

```npm i
npm run build
npm start
```

repository: JaroslawPokropinski/screen-sharing-web

repo_name: JaroslawPokropinski/screen-sharing-web


text:
# Project Title

Sample React project with SignalR, signin, and a dumb dashboard

## Getting Started

This project isn't meant to be runnable. It's simply an example of various basic code patterns leveraging components, SignalR for communication instead of the standard AJAX/Axios/Fetch.

Notes:

* The Counter and Weather came with the template.

### Prerequisites

```
n/a
```

### Installing

```
n/a
```

## Authors

* **sanfran627** - *Initial work*

## License

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details


text:
# OXID cookie compliance modul for OXID 6

Free OXID eShop module for GDRP compliance.

## Installation
- Get module by composer `composer require aggrosoft/oxid-cookie-compliance`

## Configuration
- See module settings
- Activate "Lern-Modus" and make an test order, after this deacticate "Lern-Modus"
- Change cookie settings in general shop data --> cookies
- add `[{include file="widget/cookieinfos.tpl"}]` to `oxsecurityinfo` cms-page

## Notice
- Template compatibility only for wave theme, feel free to contribute for other themes ;-)

repository: proudcommerce/oxid-cookie-compliance

repo_name: proudcommerce/oxid-cookie-compliance


text:
1. Download [ontology-ts-sdk](https://github.com/ontio/ontology-ts-sdk).

2. Install ts-sdk based on the instruction.

3. Copy the ```register_tool``` folder into  ```./ontology-ts-sdk/test/``` folder.

4. Open the terminal, make sure your current is under ```./ontology-ts-sdk``` folder.

5. Run the invoking script within the ```register.test.ts``` file, before run the script, make sure you open the ```register.test.ts``` file,
replace the parameters ```base58Addr```, ```privateKey```, ```ontId```, and ```contractAddr``` with yours.

5.1 In order to bind your answer(contract address) with your ```account``` and ```ontId```, then
run the following command.

```
jest .\\test\\register_tool\\register.test.ts -t 'test_bindContract'

Or

jest .\test\register_tool\register.test.ts -t 'test_bindContract'

```

5.2 In order to check that you have bound your answer(contract address) with your ```account``` and ```ontId```, then
run the following command.

```
jest .\\test\\register_tool\\register.test.ts -t 'test_getBindContract'

Or

jest .\test\register_tool\register.test.ts -t 'test_getBindContract'

```

6. Congrats, you have bound your answer with your ```account``` and ```ontId```, and nobody CAN modify that.

7. If you have to submit your answer (contract hash) more than one time, just do it.

repository: ontio/Anniversary

gha_language: Go

repo_name: ontio/Anniversary


text:
# greenhouse
We use the tried-and-true software stack of Apache, MySQL, and PHP, on both Windows 10 and Linux (Ubuntu 18.04). Below we have documented our progress, taking note of any software changes we have made down the line.
# setting up the server
## Windows
Install XAMPP with defaults. Change port of MySQL instance to 3007 if another MySQL instances is installed.
## Ubuntu 18.04
Run the command `sudo apt-get install apache2 mysql php`. Add a global `ServerName localhost` directive to the `/etc/apache2/apache2.conf`; file. Also add the following code to the bottom:
```
<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>
```
Then run the command `sudo a2dismod mpm_event && sudo a2enmod mpm_prefork && sudo a2enmod php7.2`. If your version of php is incorrect, run the command a2enmod and look through the list. Place files in the `/var/www/html/` directory.

## Semester 2
# Django
The website/ directory contains our server-side code written in the Django framework. The server can be started from within the website/ directory with the `python{3} manage.py runserver`. On initial startup, you can ignore the warning for unapplied migrations. This can be fixed by running the command `python{3} manage.py makemigrations`. Django introduces a view interface that routes urls to HTML pages, which is outlined below. ![image](img/django-http.png)

repository: ajpasic/greenhouse

repo_name: ajpasic/greenhouse


text:
# Anka Buildkite Plugin

A [Buildkite plugin](https://buildkite.com/docs/agent/v3/plugins) for running pipeline steps in [Anka](https://ankadoc.bitbucket.io/#introduction) virtual machines.

- By default, cloned VMs will be deleted on pipeline cancellation, failure, or success.
- At this time, this plugin does not automatically mount the `buildkite-agent` or inject any `BUILDKITE_` environment variables.
- A lock file (`/tmp/anka-buildkite-plugin-lock`) is created around pull and cloning. This prevents collision/ram state corruption when you're running two different jobs and pulling two different tags on the same anka node. The error you'd see otherwise is `state_lib/b026f71c-7675-11e9-8883-f01898ec0a5d.ank: failed to open image, error 2`

## Example

```yml
steps:
  - command: make test
    plugins:
      - chef/anka#v0.5.7:
          vm-name: macos-base-10.14
```

## Best Practices
### Shared Folders

[Veertu](https://veertu.com) states that the performance of using shared folders is not completely optimized, so it is best practice to disable this.
As an alternative, it is suggested to clone and pull the repository as the first commands in the pipeline step.

Example:
```yml
steps:
  - commands:
      - git clone $BUILDKITE_REPO && cd repo-folder && git checkout -f $BUILDKITE_COMMIT
      - cd repo-folder; ./build.sh
    plugins:
      - thedyrt/skip-checkout#v0.1.1: ~
      - chef/anka#v0.5.7:
          vm-name: base-vm-mojave
          no-volume: true
          wait-network: true
```

## Configuration

### `vm-name` (required)

The name of the Anka virtual machine to use as the base. The plugin will create a step-specific clone prior to execution.

Example: `macos-base-10.14`

### `vm-registry-tag` (optional)

A tag associated with the VM you wish to pull from the Anka Registry.

Example: `latest`

### `vm-registry-version` (optional)

A version associated with the VM you wish to pull from the Anka Registry.

Example: `1`

### `always-pull` (optional)

By default, the `anka-buildkite-plugin` will only pull the VM from the Anka Registry is missing. Set this value to `true` if you wish to pull the VM for every step.

 This prevents your registry from being a single point of failure for pipelines. We suggest monitoring for registry availability or failures.
- You can also use `"shrink"` to remove other local tags for the vm-name, optimizing the footprint.

Example: `true`

### `inherit-environment-vars` (optional)

Set this to `true` to inject the environment variables set on your host into the Anka VM.

Example: `true`

### `environment-file` (optional)

The path to a file containing environment variables you wish to inject into you Anka VM.

Example: `./my-env.txt`

### `no-volume` (optional)

Set this to `true` if you do not wish to mount the current directory into the Anka VM.

Example: `true`

### `volume` (optional)

The path to a directory, other than the current directory, you wish to mount into the Anka VM.

Example: `/some/directory`

### `wait-network` (optional)

Set this to `true` if you wish to delay the execution of your `command` until networking has been established in the Anka VM.

Example: `true`

### `workdir` (optional)

The fully-qualified path of the working directory inside the Anka VM.

Example: `/some/directory`

### `debug` (optional)

Set this to `true` to enable debug output within the plugin.

Example: `true`

### `anka-debug` (optional)

Set this to `true` to enable anka --debug output when running anka commands.

- You will need to run your buildkite agent with `cancel-grace-period=60`, as the [default 10 seconds is not enough time](https://forum.buildkite.community/t/problems-with-anka-plugin-and-pre-exit/365/7).

Example: `false`

### `bash-interactive` (optional)

This allows you to execute commands through anka run with an interactive shell (`anka run` does not support tty/interactive shell by default).

Example: `true`

### `pre-commands` (optional) (DANGEROUS)

Commands to run on the HOST machine BEFORE any guest/anka run commands. Useful if you need to download buildkite artifacts into the current working directory from a previous step. This can destroy your host. Be very careful what you do with it.

- Be sure to double escape variables you don't want eval to try and interpolate too soon.

Example:
```
    plugins:
    - chef/anka . . .
        pre-commands:
          - 'echo 123 && echo 456'
          - 'buildkite-agent artifact download "build.tar.gz" . --step ":aws: Amazon Linux 1 Build"'
          - 'echo \\$variableOnTheHost'
```

### `post-commands` (optional) (DANGEROUS)

Commands to run on the HOST machine AFTER any guest/anka run commands. Useful if you need to upload artifacts created in the build/test process. This can destroy your host. Be very careful what you do with it.

Example: A list, similar to pre-commands.

### `failover-registries` (optional)

Should the default registry not be available, the failover registries you specify will be used. It will go through each in the list and use the first available.

Example:
```
    plugins:
    - chef/anka#v0.5.7:
        failover-registries:
          - 'registry_1'
          - 'registry_2'
          - 'registry_3'
```

### `pre-execute-sleep` (optional)

Will execute a sleep with the value you specify within anka run and before the first command. Useful if you need to ensure that certain processes and networking are fully functional before running your commands in the VM.

Example: `5` (seconds)

### `pre-execute-ping-sleep` (optional)

Will execute a ping while loop sleep with the ip you specify before any commands run in the VM. Useful if you need to ensure that certain processes and networking are fully functional before running your commands in the VM.

Example: `<IP_ADDRESS>`

## Anka Modify ---

### `modify-cpu` (optional)

Will stop the VM, set CPU cores, and then execute commands you've specified.

Example: `6`

### `modify-ram` (optional)

Will stop the VM, set memory size, and then execute commands you've specified.

- Input is interpreted as G; if you input 32, it will use 32G in the anka modify command.

Example: `32`

## Anka Start ---

### `start-devices` (optional)

Will stop the VM, then start it with the USB device(s).

- Input should be the USB device ID/Location and should already be claimed.

Example: `341835776`

## License

|                      |                                          |
|:---------------------|:-----------------------------------------|
| **Author:**          | Tom Duffield<EMAIL_ADDRESS>| **Copyright:**       | Copyright 2018, Chef Software, Inc.
| **License:**         | Apache License, Version 2.0

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

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

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

repository: frankh/anka-buildkite-plugin

repo_name: frankh/anka-buildkite-plugin


text:
# Create Your Own Text to Speech synthesizer with Ossian

## Introduction

There is growing demand for text-to-speech (TTS) in various industries as the world moves towards technologies that can interact with users more naturally. Many industries including gaming, film, appliances, and accessibility. As a result, there is a lot of needs to produce a variety of good quality voices in different languages. The TTS problem is challenging especially for low-resourced languages, because of the lack of data. Smaller text and audio corpora imply that more experiments might need to be done in order to get the most out of the available resources.

Tackling this problem for low-resourced languages usually requires close collaboration between computer scientists, who understand the algorithms and know how to utilize the tools, and linguists, who understand linguistic phenomena and can help provide linguistic resources required to improve the voices.

From our experience building voices for low-resourced languages, we have observed many pain points that prevent these researchers from conducting quick experiments and iterating on their existing baseline voices. These pain points include (i) the complexity of setting up initial voice building infrastructure, which often requires fairly strong technical background to setup and maintain (ii) the heterogeneous nature of different tools, which requires a non-trivial amount of effort to stitch the required pieces together to form a working pipeline for TTS research.

Text to speech synthesis is the process of converting a text string into a waveform. A conventional TTS system is usually made up of several components connected through a pipeline that includes a front-end-text-analyzer and a backend speech synthesizer. Each of the front end and backend is composed of several parts each performing one or more tasks. The front end is responsible for text analysis while the backend is responsible for converting features into audio.

The front end consists of text normalizers and a text-to-phoneme converter. Text normalizers tokenize phrases and convert numbers and texts in the raw text into written words. Text to phoneme converters takes the normalized text as an input and outputs phonemes which are symbolic representations of how the text is pronounced.

The output from the front end acts as an input for the backend which then converts the input into audio features then into sound. For example, for the statistical parametric speech synthesis, the backend uses statistical acoustic models to map linguistic features from the analyzer into compact acoustic features. These acoustic features are then inputted into a vocoder that converts these features to a waveform.

## Ossian
Ossian is a python based tool for automatically building speech synthesis front ends.The framework consists of a sequence of utterance processors, each of which accepts and enriches an XML representation of an utterance. The framework is designed to be flexible so that the nature and  number of processors and their roles can be configured by a user. A range of processors are supplied by the system, but it is also relatively easy to code new ones, Ossian supports the use of NN trained with the Merlin toolkit as duration and acoustic models. You can also use the HTS toolkit to build HMM.

### Ossian default processors

* proc no. 1  (word_splitter)
* proc no. 2  (segment_adder)
* proc no. 3  (word_vector_tagger)
* proc no. 4  (feature_dumper)
* proc no. 5  (acoustic_feature_extractor)
* proc no. 6  (aligner)
* proc no. 7  (pause_predictor)
* proc no. 8  (phrase_maker)
* proc no. 9  (duration_data_maker)
* proc no. 10 (labelmaker)
* proc no. 11 (duration_predictor)
* proc no. 12 (dnn_labelmaker)
* proc no. 13 (acoustic_predictor)

**In the next steps we will discuss how to install Ossian and train a model in a few minutes**

### Dependencies

**Perl 5** is required.

**Python 2.7** is required.

First of all you should do all following steps with **Python 2.7** not **Python 3.7**

### Getting the tools

Clone the Ossian github repository as follows:

```
git clone https://github.com/AhmedMadbouly/Ossian.git
```

This will create a directory called ```Ossian```, Let's move to ```Ossian``` directory ```cd Ossian```

Taking a look inside to see what you just cloned:
```
ahmed@ml:~/ossian$ ls
0_README.txt      LICENSE          remove-voice.sh  test-voice.sh
config_templates  make_release.sh  rules            tools
corpus            play-voice.sh    scripts          train-cpu.sh
doc               README.md        test             train-gpu.sh
install.sh        recipes          test_release.sh
```

** Instead of following the official documentation I wrote some scripts which will make all the next steps much easier also you may notice that there are Some Data ```corpus``` which we will use during the demo**

```
corpus/
└── en
    └── speakers
        └── lisa
            ├── txt
            │   ├── livingalone_01_benson_00014.txt
            │   ├── livingalone_01_benson_00016.txt
            │   ├── livingalone_01_benson_00018.txt
            │   ├── livingalone_01_benson_00024.txt
            │   ├── ****
            │   ├── ****
            │   ├── ****
            │   ├── livingalone_01_benson_00066.txt
            │   └── livingalone_01_benson_00169.txt
            └── wav
                ├── livingalone_01_benson_00014.wav
                ├── livingalone_01_benson_00016.wav
                ├── livingalone_01_benson_00018.wav
                ├── livingalone_01_benson_00024.wav
                ├── ****
                ├── ****
                ├── ****
                ├── livingalone_01_benson_00166.wav
                └── livingalone_01_benson_00169.wav
```

**```install.sh```**: Install and Compile Ossian

**```train-cpu.sh```** : Train Ossian Model on a CPU

**```train-gpu.sh```**: Train Ossian Model on a GPU

**```test-voice.sh```**: Synthesis new wave

**```play-voice.sh```**: Play new wave

**```remove-voice.sh```**: Remove Ossian Model

### Compile Ossian

Our configuration and compiling will be done by the ```install.sh``` script.

```
ahmed@ml:~/ossian$ ./install.sh
...
...
...
Compile Ossian.......
Cloning into 'merlin'...
remote: Enumerating objects: 19, done.
remote: Counting objects: 100% (19/19), done.
remote: Compressing objects: 100% (19/19), done.
remote: Total 3502 (delta 6), reused 2 (delta 0), pack-reused 3483
Receiving objects: 100% (3502/3502), 6.68 MiB | 164.00 KiB/s, done.
Resolving deltas: 100% (2012/2012), done.
mkdir -p ./build/objs
g++ -O1 -g -Wall -fPIC -Isrc -o "build/objs/cheaptrick.o" -c "src/cheaptrick.cpp"
mkdir -p ./build/objs
g++ -O1 -g -Wall -fPIC -Isrc -o "build/objs/common.o" -c "src/common.cpp"
mkdir -p ./build/objs
g++ -O1 -g -Wall -fPIC -Isrc -o "build/objs/d4c.o" -c "src/d4c.cpp"
mkdir -p ./build/objs
g++ -O1 -g -Wall -fPIC -Isrc -o "build/objs/dio.o" -c "src/dio.cpp"
mkdir -p ./build/objs
g++ -O1 -g -Wall -fPIC -Isrc -o "build/objs/fft.o" -c "src/fft.cpp"
mkdir -p ./build/objs
g++ -O1 -g -Wall -fPIC -Isrc -o "build/objs/matlabfunctions.o" -c "src/matlabfunctions.cpp"
mkdir -p ./build/objs
g++ -O1 -g -Wall -fPIC -Isrc -o "build/objs/stonemask.o" -c "src/stonemask.cpp"
...
...
...
...
...
/usr/bin/install -c 'wav2raw.sh' '/home/ahmed/ossian/scripts/..//tools/bin/wav2raw.sh'
make[2]: Nothing to be done for 'install-data-am'.
make[2]: Leaving directory '/home/ahmed/ossian/tools/downloads/SPTK-3.6/script'
make[1]: Leaving directory '/home/ahmed/ossian/tools/downloads/SPTK-3.6/script'
make[1]: Entering directory '/home/ahmed/ossian/tools/downloads/SPTK-3.6'
make[2]: Entering directory '/home/ahmed/ossian/tools/downloads/SPTK-3.6'
make[2]: Nothing to be done for 'install-exec-am'.
test -z "/home/ahmed/ossian/scripts/..//tools/include" || /bin/mkdir -p "/home/ahmed/ossian/scripts/..//tools/include"
 /usr/bin/install -c -m 644 'include/SPTK.h' '/home/ahmed/ossian/scripts/..//tools/include/SPTK.h'
make[2]: Leaving directory '/home/ahmed/ossian/tools/downloads/SPTK-3.6'
make[1]: Leaving directory '/home/ahmed/ossian/tools/downloads/SPTK-3.6'
165
Installation completed.
```

This script has installed all dependencies and compiled ```Ossian```, cloned and compiled ```Merlin```, downloaded and compiled ```HTK```, and put everything in the tools directory. At this point, if you didn’t run into any problems, you should have a working installation of Ossian which can call both Merlin and HTK.

### Train Ossian Model

We’re going to train both an acoustic and duration model to train fancy-dancy DNNs for our speech synthesizer then it will take the Merlin DNNs we just made and format them for Ossian.

It will be done by ```train-gpu.sh``` or ```train-cpu.sh``` script. which takes two main arguments:

* The speaker dir name
* The language dir name

e.g.
```
ahmed@ml:~/ossian$ ./install.sh  $LANG  $SPEAKER
```

```
ahmed@ml:~/ossian$ ./install.sh en lisa
 -- Gather corpus
 -- Train voice
/home/ahmed/ossian/train//en/speakers/lisa/naive_01_nn
/home/ahmed/ossian/voices//en/lisa/naive_01_nn
try loading config from python...
/home/ahmed/ossian/recipes/naive_01_nn.cfg
***
***
***
***
2.374075   2.0863028  1.664159   1.4150871  1.0233809  1.0554826
0.9608512  0.77851677 3.5460434  2.92667    3.0400178  2.826391
2.3268406 ]
Lock freed
Training Done.
```

### Synthesize New Audio

Now we’ve got everything in place to synthesize some speech with Ossian! We can use a sample sentence (text) to make synthesis new wave:

We will use ```test-voice.sh``` script. which takes three main arguments:

* The speaker dir name
* The language dir name
* Test file

```
ahmed@ml:~/ossian$ ./test-voice.sh en lisa english.txt

/home/ahmed/ossian/train//en/speakers/lisa/naive_01_nn
/home/ahmed/ossian/voices//en/lisa/naive_01_nn
try loading config from python...

***
***
***
***

=  proc no. 1 (word_splitter)  ==
p
==  proc no. 2 (segment_adder)  ==
p
==  proc no. 3 (word_vector_tagger)  ==
p
==  proc no. 4 (pause_predictor)  ==
p
==  proc no. 5 (phrase_maker)  ==
p
==  proc no. 6 (labelmaker)  ==
p
==  proc no. 7 (duration_predictor)  ==
p 1

***
***
***

/home/ahmed/ossian//tools/bin//synth 2048.0 48000 /tmp/tmp_d.lf0 /tmp/tmp.spec /tmp/tmp_d.bap /tmp/tmp.resyn.wav
complete /tmp/tmp.resyn.wav.
Produced /home/ahmed/ossian/voices//en/lisa/naive_01_nn/output/wav/temp.wav
Warning: no lab produced for this utt
                     --> took 4.18 seconds
Done.
```

Now, You can listen to your beautiul new English speech inside the file ```./test/wav/```

Also you able to listen to your speech without saving it by runing  ```play-voice.sh```

which takes three main arguments:

* The speaker dir name
* The language dir name
* text file

```
ahmed@ml:~/ossian$ ./play-voice.sh en lisa "Hi, How are you today"

/home/ahmed/ossian/train//en/speakers/lisa/naive_01_nn
/home/ahmed/ossian/voices//en/lisa/naive_01_nn
try loading config from python...

***
***
***
***

=  proc no. 1 (word_splitter)  ==
p
==  proc no. 2 (segment_adder)  ==
p
==  proc no. 3 (word_vector_tagger)  ==
p
==  proc no. 4 (pause_predictor)  ==
p
==  proc no. 5 (phrase_maker)  ==
p
==  proc no. 6 (labelmaker)  ==
p
==  proc no. 7 (duration_predictor)  ==
p 1

***
***
***

/home/ahmed/ossian/voices/en/lisa/naive_01_nn/output/wav/temp.wav:

 File Size: 117k      Bit Rate: 768k
  Encoding: Signed PCM
  Channels: 1 @ 16-bit
Samplerate: 48000Hz
Replaygain: off
  Duration: 00:00:01.22

In:100%  00:00:01.22 [00:00:00.00] Out:58.3k [      |      ] Hd:0.0 Clip:0
Done.
                     --> took 2.15 seconds
Done.
```

### Remove Ossian Model

Sometimes you may need to make some updates on your model and retrain it therefore you are required to remove the previour model from ```train``` and ```voices``` directory

You can use ```remove-voice.sh``` script. which takes two main arguments:

* The speaker dir name
* The language dir name

```
ahmed@ml:~/ossian$ ./remove-voice.sh en lisa

```

repository: robocomp/web

gha_language: SCSS

repo_name: robocomp/web


text:
My robot does not move
----------------------
Those are the possible causes:

1. No power
2. 'Brain' not fully functional
3. Motors not connected
4. Issue with the H-Bridge IC (U2, L293D)

Procedure to Fix:

1. Verify that power is Ok
   The center LED should be on. If not, you have no power.
   If the LED is on, use multimeter (at V-DC-20V position) to measuer the input voltage. It should be atleast 4.8V. If less, you probably have to change the battries.
   If there is no voltage, start measuring voltage from the battries, until you find where is the disconnect.

2. Verify brain works Ok
   We proceed to this state assuming we verified that power is Ok.
   The easiest way to verify that the brain is fully functional is to switch termorarirly to brain from a known-to-be-working robot. If another, known-to-work, brain is not available, the best way is to continue the procedure, while watching carfully the performance of the brain. Another possiblity is to reflash the brain (rarly needed) and reload all the files.

NEED TO ADD LINK TO FLASHING THE FILES

3.  Verify that the motors are connected
   This one is easy: Using your hand, turn one wheel both ways. One of the two LEDs associated with each whell should light momentarily. Repeate for the other wheel. Fix any issue found.

4. Verify the correct operation of the H-bridge.
   Issues with the H-bridge are the most common reason why robot won't move.
   Here are the steps to debug this IC:
   4.1. Open the schematics and zoom on U2. The schematic is at NEED TO ADD LINK TO SCHEMA
   4.2  Get a multimeter, and set it to measure Volts-DC-20V. Connect the "-"/black probe to one of the ground point of the robot, for example at the battries "-" terminal.
   4.3 Look at the schema. The H-bridge IC has two connections to the power-supply. Check that both of those connections are connected to the 5V or so comming from the battries.
   4.4 Verify connection from the brain to the pwmLeft and pwmRight points
       NEED TO ADD CODE
       NEED  TO ADD LINK TO PROCEDURE TO GET REPL (Python prompt).


text:
---
name: Geoff Revill
pronoun: He/Him
title: Tech entrepreneur
company: Krowdthink Ltd
talk-title: Building an unhackable social platform
headshot: /assets/images/headshots/head-geoff-revill.jpg
track: "2"
timeslot: "15.00"
type: Talk, 30 minutes
level: 2
twitter:
-  krowdthink
# linkedin:
takeaways:
 - Guidance on reducing cyber security risk
 - Help making it easy to build GDPR ready apps and platforms
 - Ideas on how to innovate a safer internet

---
Sounds implausible? not quite.

Sure, any system can be taken down, the key question is whether personal data is lost. Article 25 of the GDPR demands we build platforms while seeking to to minimize personal data use.  If you decide to make data minimization your point of innovation, you can, amazingly, build a social platform with almost zero personal data (in our case study, 5 maximum!)

In this paper we will discuss how to build valuable functions without collating personal data. We will discuss what Mozilla calls 'lean data' systems and how to build them, thereby making your system cybersecure by design, and beneficially also being easy to slip through the quagmire of GDPR regulations.

{% include speakers-takeaways.html %}

Bio

Geoff has 35+ years tech experience at every level, from programmer, system designer and architect thru to product management and marketing of high tech innovations. He also has a high degree of understanding of the tightening regulatory environment and how to work within it yet keep innovating cyber-securely.


text:
---
author: Jens-Christian Fischer
categories: ["musings"]
comments: true
date: 2003-09-17 23:45:47+00:00
layout: post
link: https://invisible.ch/2003/09/17/free-the-last-mile/
slug: free-the-last-mile
tags: ["blog"]
title: Free the last mile
type: post
wordpress_id: 179
---

Today I got regular mail from my ADSL ISP ([Econophone](https://www.econophone.ch)): [Swisscom](https://www.swisscom.ch) is changing ADSL speeds and I have to choose my new connection speed.

At the office, I currently have 1024/256 which I find is a great ratio for downloads and for keeping all my servers running and responisve. (This blog is served through that line). I pay 145 CHF / month which I find a reasonable price. Now Swisscom obviously thinks, that this speed is cutting into their leased line business, so that speed combination is no longer after October 1st. I have two choices: Downgrade to 600/100 for CHF 74 / month (which is unacceptable for servers) or downgrade/upgrade to 512/512 (for CHF 195 / month). The more interesting speed 1024/512 is priced at 245 / month.

After gnashing my teeth I decided to go the 512/512 route. My internet cost is going up around 30%, I loose 50% of my download speed and get more upload speed. I AM NOT HAPPY about this.

Free the last mile

(and I guess, I can reinstall my old [Freenet Node](https://freenetproject.org) now that I have ample bandwith, or maybe offload my MP3 collection to the office? Other ideas on what to do with that bandwith? Let me know!)


text:
+++
# Selected Talks widget.
widget = "talks_selected"
active = false
date = 2016-04-20T00:00:00

title = "Welcome"
subtitle = ""

# Order that this section will appear in.
weight = 29

# List format.
#   0 = Simple
#   1 = Detailed
#   3 = Stream
list_format = 0

+++
The primary focus of the project is to identify potential data, compile and provide access to appropriate data, and develop analytical models consistent with CVPIA fish doubling goals within the framework of Structured Decision Making. This effort will be coordinated and revised with the resource agencies and stakeholders. It is anticipated that agency and stakeholder representatives will provide the majority of the biological expertise and institutional knowledge.

Biological expertise and institutional knowledge is transferred to the SDM process through a series of regularly-scheduled conference calls and in-person meetings. Records of previous meetings are available for review.

[Background Information on Team Guidelines](https://drive.google.com/file/d/1DJSuOWBipOt819ORTECXvIjAogAb6mxu/view)

[Five Year Restoration Strategy](https://drive.google.com/file/d/1qqh1vbTY9ydFBhPtiyfqRYFCj4k5KeWZ/view)

[FY18 Model Activities](https://drive.google.com/file/d/1BlvUrV5pkcqp-CJcp5WFEh7PnxzknSMH/view)

[2019 Priorities Technical Memorandum](https://drive.google.com/file/d/1Ec3qn0Wk-PiygfZm-ZsdnYOUhdRl2sPd/view)

repository: FlowWest/cvpia-website

gha_language: HTML

repo_name: FlowWest/cvpia-website


text:
# FortranStrings

[![Build Status](https://travis-ci.com/denius/FortranStrings.jl.svg?branch=master)](https://travis-ci.com/denius/FortranStrings.jl)
[![Coverage](https://codecov.io/gh/denius/FortranStrings.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/denius/FortranStrings.jl)

`FortranStrings.jl` is a datatype for Fortran strings emulation. These strings have two main points:
* `FortranString` is mutable (but not resizable)
* flexibility in assignment: can truncate or fill the right side with spaces if the length is not coincide.

The original Fortran strings are composed of the 1-byte elements. To create such strings:
```julia
s = FortranString{UInt8}("ABC")
```
or, the same with the shorthand macro `@F8_str`:
```julia
s = F8"ABC"
```
It is also possible to create strings with `Char` elements, or any other:
`str = FortranString{Char}("ABC")` (or `str = F"ABC"`), `S = FortranString{UInt64}("ABC")`.

Assignment must be done element-wise with `.=`.

## Quotes escaping
In Fortran strings, the quotes with which the strings were created must be escaped by doubling, for example Fortran's: `'Can''t be with only single quote inside'` or `"Should be ""doubled"""`. To simplify conversion from Fortran the escape flag `qq` or `d` has been introduced:
```julia
julia> str = F"Should be \"\"doubled\"\""d
F"Should be \"doubled\""
```
Similarly, using the `q` flag, single quotes should be doubled:
```julia
julia> s = F"Can''t be with only single quote inside"
F"Can't be with only single quote inside"
```
Although, in both cases, the escaping-doubling is not necessary when using the `q` or` qq` flags, because single `'` or `"` produce single ones.

All this escaping only works when the `FortranString` is created from `String`, and this does not apply when a string is created from an `Vector`:
```julia
julia> FortranString{Char}([0x27, 0x27, 0x61, 0x62, 0x63, 0x27, 0x27])
F"''abc''"
```