text:
# Beacons

This API endpoint provides access to the application Beacons.

## List of Beacons

### Endpoint

```
GET /s2s_api/v1/beacons
```

### Request parameters

| Name | Required? | Example | Comments |
| ---- | --------- | ------- | -------- |
| name | no | ```Beacon1``` | Filter beacons by name containing given string, case sensitive |

### Examples of requests

```
GET /s2s_api/v1/beacons
```

```
GET /s2s_api/v1/beacons?name=Beacon
```

### JSON Response

Hash with ```ranges``` key containing array of beacons

| Name | Optional? | Example | Comments
| ---- | --------- | ------- | -------- |
| id | no | ```1``` | ID of Beacon in database |
| name | no | ```Beacon 1``` | |
| proximity_id | no | ```F7826DA6-4FA2-4E98-8024-BC5B71E0893E+53238+25345``` | Beacon location proximity |
| location[lat] | no | ```53.127383``` | Beacon location geographic latitude |
| location[lng] | no | ```23.117402``` | Beacon location geographic longitude |
| location[floor] | no | ```1```, ```null``` | Beacon location floor number, can be empty or number in range 0-10 |
| zone[] | yes | Object | Zone object, may be null |
| zone[id] | - | ```1``` | Zone id |
| zone[name] | - | ```Zone name``` | Zone id |
| zone[color] | - | ```ffaa33``` | Zone color |
| zone[hex_color] | - | ```#ffaa33``` | Zone color as hex|

### Example of response

```json
// HTTP 200 OK

{
    "ranges": [
        {
            "id": 1,
            "name": "Beacon 1",
            "proximity_id": "F7826DA6-4FA2-4E98-8024-BC5B71E0893E+53238+25345",
            "location": {
              "lat": "53.127383",
              "lng": "23.117402",
              "floor": null
            },
            "zone": {
              "id": 1,
              "name": "Zone 1",
              "color": "ffaa33",
              "hex_color": "#ffaa33"
            }
        },
        {
            "id": 3,
            "name": "",
            "proximity_id": "00000000-0000-0000-0000-000000000000+9+9",
            "location": {
              "lat": null,
              "lng": null,
              "floor": 1
            },
            "zone": {
              "id": 1,
              "name": "Zone 1",
              "color": "ffaa33",
              "hex_color": "#ffaa33"
            }
        }
    ]
}
```

## Create Beacon

### Endpoint

```
POST /s2s_api/v1/beacons
```

### Request parameters

| Name | Required? | Example | Comments |
| ---- | --------- | ------- | -------- |
| beacon[name] | no | ```Beacon 1``` |  |
| beacon[uuid] | yes | ```F7826DA6-4FA2-8024-4E98-BC5B71E0893E``` | Beacon location proximity, in UUID format |
| beacon[major] | yes | ```64345``` | Number used to differentiate a large group of related beacons |
| beacon[minor] | yes | ```62643`` | Number used to distinguish a smaller subset of beacons within the larger group |
| beacon[lat] | no | ```53.127383``` | Beacon location geographic latitude |
| beacon[lng] | no | ```23.117402``` | Beacon location geographic longitude |
| beacon[floor] | no | ```1``` | Beacon location floor number in range 0-10 |
| beacon[zone_id] | no | ```1``` | ID of zone to assign beacon to* |
| beacon[activity][name] | no | ```Test notification``` | Name for test notification |
| beacon[activity][trigger_attributes][test] | no | ```true``` | Must be ```true```, notification won't be created otherwise |
| beacon[activity][trigger_attributes][event_type] | no | ```enter``` | Only [valid options](activities.html#notes) for ```BeaconTrigger``` allowed |
| beacon[activity][custom_attributes_attributes][][name] | no | ```foo``` | Name of [custom attribute](activities.html#activity-attributes) |
| beacon[activity][custom_attributes_attributes][][value] | no | ```Foo``` | Value for [custom attribute](activities.html#activity-attributes) |

*Note1:* Test notification could be crateted along with new beacon. To do so, ```activity``` parameters must be provided with ```test``` flag set to ```true```.

### Example of request

```json
{
    "beacon": {
        "name": "Beacon 1",
        "uuid": "F7826DA6-4FA2-8024-4E98-BC5B71E0893E",
        "major": 64345,
        "minor": 62643,
        "lat": 53.127383,
        "lng": 23.117402,
        "floor": 1,
        "zone_id": 1
    }
}
```

```json
{
    "beacon": {
        "name": "Beacon 1",
        "uuid": "F7826DA6-4FA2-8024-4E98-BC5B71E0893E",
        "major": 64345,
        "minor": 62643,
        "lat": 53.127383,
        "lng": 23.117402,
        "floor": 1,
        "zone_id": 1,
        "activity": {
          "name": "Test notification",
          "trigger_attributes": {
            "test": true,
            "event_type": "enter"
          },
          "custom_attributes_attributes": [
            {
              "name": "foo",
              "value": "Foo"
            },
            {
              "name": "bar",
              "value": "Bar"
            }
          ]
        }
    }
}
```

### Examples of responses

```json
// HTTP 201 Created

{
    "range": {
        "id": 11,
        "name": "Beacon 1",
        "proximity_id": "F7826DA6-4FA2-8024-4E98-BC5B71E0893E+64345+62643",
        "location": {
          "lat": "53.127383",
          "lng": "23.117402",
          "floor": 1
        },
        "zone": {
          "id": 1,
          "name": "Zone 1",
          "color": "ffaa33",
          "hex_color": "#ffaa33"
        }
    }
}
```

```json
// HTTP 422 Unprocessable Entity

{
    "errors": {
        "uuid": [
            "is invalid"
        ],
        "minor": [
            "can't be blank",
            "is not a number"
        ],
        "major": [
            "is not a number"
        ],
        "floor": [
            "is not included in the list"
        ],
        "zone_id": [
            "is not included in the list"
        ]
    }
}
```

```json
// HTTP 422 Unprocessable Entity

{
    "errors": {
        "uuid": [],
        "minor": [],
        "major": [],
        "test_activity": [
            {
                "name": [
                    "can't be blank"
                ],
                "trigger.beacons": [
                    "is invalid"
                ]
            }
        ]
    }
}
```

## Update Beacon

### Endpoint

```
PUT|PATCH /s2s_api/v1/beacons/:id
```

### Request parameters

| Name | Required? | Example | Comments |
| ---- | --------- | ------- | -------- |
| beacon[name] | no | ```Beacon 1``` |  |
| beacon[uuid] | no | ```F7826DA6-4FA2-8024-4E98-BC5B71E0893E``` | Beacon location proximity, in UUID format. If provided, cannot be empty |
| beacon[major] | no | ```64345``` | If provided, cannot be empty |
| beacon[minor] | no | ```62643``` | If provided, cannot be empty |
| beacon[lat] | no | ```53.127383```, ```null``` | Beacon location geographic latitude |
| beacon[lng] | no | ```23.117402```, ```null``` | Beacon location geographic longitude |
| beacon[floor] | no | ```1```, ```null``` | Beacon location floor number in range 0-10 |
| beacon[zone_id] | no | ```1```, ```null``` | ID of zone to assign beacon to (or remove)* |
| beacon[activity][name] | no | ```Test notification``` | Name for test notification |
| beacon[activity][trigger_attributes][test] | yes | ```true``` | Must be ```true```, notification won't be created/updated otherwise |
| beacon[activity][trigger_attributes][event_type] | no | ```leave``` | Only [valid options](activities.html#notes) for ```BeaconTrigger``` allowed |
| beacon[activity][custom_attributes_attributes][][name] | no | ```foo``` | Name of [custom attribute](activities.html#activity-attributes) |
| beacon[activity][custom_attributes_attributes][][value] | no | ```Foo``` | Value for [custom attribute](activities.html#activity-attributes) |

### Example of request

```
PUT /s2s_api/v1/beacons/2
```

```json
{
    "beacon": {
        "uuid": "00000000-0000-0000-0000-000000000000",
        "major": 1,
        "minor": 2
    }
}
```

```json
{
    "beacon": {
        "activity": {
          "trigger_attributes": {
            "event_type": "leave"
          },
          "custom_attributes": [
            {
              "name": "baz",
              "value": "Baz"
            }
          ]
        }
    }
}
```

### Examples of responses

```json
// HTTP 204 No Content
```

```json
// HTTP 422 Unprocessable Entity

{
    "errors": {
        "uuid": [
            "is invalid"
        ],
        "minor": [
            "can't be blank"
        ],
        "major": [
            "is not a number"
        ]
    }
}
```

```json
// HTTP 422 Unprocessable Entity

{
    "errors": {
        "test_activity": [
            {
              "name": [
                  "can't be blank"
              ],
              "trigger.beacons": [
                  "is invalid"
              ]
            }
        ]
    }
}
```

## Remove Beacon

### Endpoint

```
DELETE /s2s_api/v1/beacons/:id
```

### Example of request

```
DELETE /s2s_api/v1/beacons/2
```

### Examples of responses

```
// HTTP 204 No Content
```

```
// HTTP 404 Not Found
```

## Remove batch of Beacons

### Endpoint

```
DELETE /s2s_api/v1/beacons
```

### Request parameters

| Name | Required? | Example | Comments |
| ---- | --------- | ------- | -------- |
| ids | yes | ```[1,2,3]``` | Array of beacons IDs |

### Examples of requests

```
DELETE /s2s_api/v1/beacons?ids[]=1&ids[]=2&ids[]=3
```

```json
// DELETE /s2s_api/v1/beacons

{
    "ids": [1,2,3]
}
```

### Example of response

```
// HTTP 204 No Content
```

repository: linhnv/BeaconControl

gha_language: Ruby

repo_name: linhnv/BeaconControl


text:
---
title: "Midnight - Asylum Jam 2017 - Post Mortem"
aliases: [/v/AMlw0xCGVn4/]
date: 2017-11-08
featured_image: https://i.ytimg.com/vi/AMlw0xCGVn4/mqdefault.jpg
tags: [ hackathon,game,unity3d ]

---

{{% youtube id="AMlw0xCGVn4" %}}

Midnight is a game built in 48 hours for the Asylum Jam. The asylum jam emphasizes horror without the stigma of mental illness, including the use of asylum's, hospitals etc.

Midnight makes heavy use of light to build an atmosphere that's both dark and mysterious. The game isn't done and there aren't many puzzles in it in the current form but it's a good start to something really fun. A lot of the mechanics are things that can be brought forward into more complete projects and the atmosphere feels good to me.

The idea was to use story to drive the horror. That part absolutely did not work. It's a dark puzzle game. Not really a horror game. On that I think this missed the mark, something to improve on with time.

Download Midnight to play it yourself here: https://gamejolt.com/games/midnight/294831

3rd Party Assets used in the game:
Everloop: Background Music
Little Dragons: Textures/Models
HX Volume Lighting: Volumetric Lighting Effects
Unity Post Processing Effects: Bloom and other post Effects
Probuilder: Prototyping puzzles and some in game Models
Rewired: Input
Manufactura K4 Top-Down Sci-Fi: Level Models and Environment
UBER: Shaders

Discord: https://discord.gg/hU5Kq2u

license: MIT

repository: WorldOfZero/dotcom

branch_name: refs/heads/master

extension: md

gha_language: C#

gha_license_id: MIT

license_type: permissive

repo_name: WorldOfZero/dotcom


text:
### jsoncons::wojson

```cpp
#include <jsoncons/json.hpp>

typedef basic_json<wchar_t,
                   Policy = order_preserving_policy,
                   Allocator = std::allocator<wchar_t>> wojson
```
The `wojson` class is an instantiation of the [basic_json](basic_json.md) class template that uses `wchar_t` as the character type. The original insertion order of an object's name/value pairs is preserved.

`wojson` behaves similarly to [wjson](wjson.md), with these particularities:

- `wojson`, like `wjson`, supports object member `insert_or_assign` methods that take an `object_iterator` as the first parameter. But while with `wjson` that parameter is just a hint that allows optimization, with `wojson` it is the actual location where to insert the member.

- In `wojson`, the `insert_or_assign` members that just take a name and a value always insert the member at the end.

### See also

[wjson](wjson.md) constructs a wide character json value that sorts name-value members alphabetically

[json](json.md) constructs a utf8 character json value that sorts name-value members alphabetically

[ojson](ojson.md) constructs a utf8 character json value that preserves the original insertion order of an object's name/value pairs

repository: danielaparker/jsoncons

gha_license_id: NOASSERTION

repo_name: danielaparker/jsoncons


text:
# Fastly::DirectorBackendApi

```ruby
require 'fastly'
api_instance = Fastly::DirectorBackendApi.new
```

## Methods

| Method | HTTP request | Description |
| ------ | ------------ | ----------- |
| [**create_director_backend**](DirectorBackendApi.md#create_director_backend) | **POST** /service/{service_id}/version/{version_id}/director/{director_name}/backend/{backend_name} | Create a director-backend relationship |
| [**delete_director_backend**](DirectorBackendApi.md#delete_director_backend) | **DELETE** /service/{service_id}/version/{version_id}/director/{director_name}/backend/{backend_name} | Delete a director-backend relationship |
| [**get_director_backend**](DirectorBackendApi.md#get_director_backend) | **GET** /service/{service_id}/version/{version_id}/director/{director_name}/backend/{backend_name} | Get a director-backend relationship |

## `create_director_backend()`

```ruby
create_director_backend(opts): <DirectorBackend> # Create a director-backend relationship
```

Establishes a relationship between a Backend and a Director. The Backend is then considered a member of the Director and can be used to balance traffic onto.

### Examples

```ruby
api_instance = Fastly::DirectorBackendApi.new
opts = {
    director_name: 'director_name_example', # String | Name for the Director.
    service_id: 'service_id_example', # String | Alphanumeric string identifying the service.
    version_id: 56, # Integer | Integer identifying a service version.
    backend_name: 'backend_name_example', # String | The name of the backend.
}

begin
  # Create a director-backend relationship
  result = api_instance.create_director_backend(opts)
  p result
rescue Fastly::ApiError => e
  puts "Error when calling DirectorBackendApi->create_director_backend: #{e}"
end
```

### Options

| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **director_name** | **String** | Name for the Director. |  |
| **service_id** | **String** | Alphanumeric string identifying the service. |  |
| **version_id** | **Integer** | Integer identifying a service version. |  |
| **backend_name** | **String** | The name of the backend. |  |

### Return type

[**DirectorBackend**](DirectorBackend.md)

[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to README]](../../README.md)
## `delete_director_backend()`

```ruby
delete_director_backend(opts): <InlineResponse200> # Delete a director-backend relationship
```

Deletes the relationship between a Backend and a Director. The Backend is no longer considered a member of the Director and thus will not have traffic balanced onto it from this Director.

### Examples

```ruby
api_instance = Fastly::DirectorBackendApi.new
opts = {
    director_name: 'director_name_example', # String | Name for the Director.
    service_id: 'service_id_example', # String | Alphanumeric string identifying the service.
    version_id: 56, # Integer | Integer identifying a service version.
    backend_name: 'backend_name_example', # String | The name of the backend.
}

begin
  # Delete a director-backend relationship
  result = api_instance.delete_director_backend(opts)
  p result
rescue Fastly::ApiError => e
  puts "Error when calling DirectorBackendApi->delete_director_backend: #{e}"
end
```

### Options

| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **director_name** | **String** | Name for the Director. |  |
| **service_id** | **String** | Alphanumeric string identifying the service. |  |
| **version_id** | **Integer** | Integer identifying a service version. |  |
| **backend_name** | **String** | The name of the backend. |  |

### Return type

[**InlineResponse200**](InlineResponse200.md)

[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to README]](../../README.md)
## `get_director_backend()`

```ruby
get_director_backend(opts): <DirectorBackend> # Get a director-backend relationship
```

Returns the relationship between a Backend and a Director. If the Backend has been associated with the Director, it returns a simple record indicating this. Otherwise, returns a 404.

### Examples

```ruby
api_instance = Fastly::DirectorBackendApi.new
opts = {
    director_name: 'director_name_example', # String | Name for the Director.
    service_id: 'service_id_example', # String | Alphanumeric string identifying the service.
    version_id: 56, # Integer | Integer identifying a service version.
    backend_name: 'backend_name_example', # String | The name of the backend.
}

begin
  # Get a director-backend relationship
  result = api_instance.get_director_backend(opts)
  p result
rescue Fastly::ApiError => e
  puts "Error when calling DirectorBackendApi->get_director_backend: #{e}"
end
```

### Options

| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **director_name** | **String** | Name for the Director. |  |
| **service_id** | **String** | Alphanumeric string identifying the service. |  |
| **version_id** | **Integer** | Integer identifying a service version. |  |
| **backend_name** | **String** | The name of the backend. |  |

### Return type

[**DirectorBackend**](DirectorBackend.md)

[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to README]](../../README.md)

repository: fastly/fastly-ruby

branch_name: refs/heads/main

repo_name: fastly/fastly-ruby


text:
![alt text](https://previews.123rf.com/images/f1digitals/f1digitals1902/f1digitals190200146/117399112-vector-illustration-of-professional-monster-working-on-computer-isolated-on-white-background-.jpg)

# MONSER (Monitoring Server)

MonSer is a tool that can monitor server such as cpu, ram, disk, network, and many more. The first step in this project is will be monitor server based on Linux (CentOs 7), soon it will be on Windows to!

And this project will be written with php and vanilla js.

## Function

```python

Print hostname, cpu model, kernel, last update, os installed
Monitoring cpu
Monitoring ram
Monitoring hdd
Monitoring network
Monitoring link/url web
Monitoring ip

```

## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

## License
[MIT](https://choosealicense.com/licenses/mit/)

## About
This project is inspiring from cloudstat.

repository: auliarahmed/monser

repo_name: auliarahmed/monser


text:
## Transmission modeling (implemented on wxMaxima)

### References:

[1] Max Born and Emil Wolf. Principles of Optics. 6th Edition. Electromagnetic Theory of Propagation, Interference and Diffraction of Light

[2] Alyabyeva et al. Dielectric properties of semiinsulating Fe-doped InP in the THz spectral region, 2017

[3] Dai et al. Measurement of optical constants of TiN and TiN/Ti/TiN mulitlayer films for microwave kinetic inductance photon-number-resolving detectors, 2018

### Stages:

1. Final formula of reflectivity and transmissivity ([1], 1.6.4, formulae 54-60, p. 61-62, "RT dielectric film.wxmx")

2. Reproduction of Fig. 1 in [2],

    2.1. "RT dielectric film verification.wxmx"

    2.2. "RT dielectric film matrix.wxmx" -- the same as 2.1, but using characteristic matrix of the film ([1], 1.6.2, formulae ~39, p. ~58), i.e. transfer matrix method (TMM) for dielectric films

3. Reproduction of Fig. 3a in [3], "ART TiN-Ti-TiN film verification.wxmx", i.e. TMM for arbitrary films

4. Optimization of Ti thickness film on Si substrate for maximum transmittance

repository: SharapovAndrey/TIRPhotonics

repo_name: SharapovAndrey/TIRPhotonics


text:
# ![LOGO](logo.png) Slicebox **flow**ground Connector

## Description

A generated **flow**ground connector for the Slicebox API (version 2.0).

Generated from: https://api.apis.guru/v2/specs/slicebox.local/2.0/swagger.json<br/>
Generated at: 2019-05-07T17:44:06+03:00

## API Description

Slicebox - safe sharing of medical images

## Authorization

This API does not require authorization.

## Actions

### anonymize the images corresponding to the supplied list of image IDs (each paired with a list of DICOM tag translation). This route corresponds to repeated use of the route /images/{id}/anonymize.

*Tags:* `Anonymization`

### get a list of anonymization keys, each specifying how vital DICOM attributes have been anonymized for a particular image

*Tags:* `Anonymization`

#### Input Parameters
* `startindex` - _optional_ - start index of returned slice of anonymization keys
* `count` - _optional_ - size of returned slice of anonymization keys
* `orderby` - _optional_ - property to order results by
* `orderascending` - _optional_ - order result ascendingly if true, descendingly otherwise
* `filter` - _optional_ - filter the results by matching substrings of properties against this value

### export all anonymization keys as a csv file

*Tags:* `Anonymization`

### submit a query for anonymization keys

*Tags:* `Anonymization`

### delete an anonymization key that is no longer of interest

*Tags:* `Anonymization`

#### Input Parameters
* `id` - _required_ - ID of anonymization key

### get the anonymization key with the supplied ID

*Tags:* `Anonymization`

#### Input Parameters
* `id` - _required_ - ID of anonymization key

### get pointers to the images corresponding to the anonymization key with the supplied ID

*Tags:* `Anonymization`

#### Input Parameters
* `id` - _required_ - ID of anonymization key

### list all supported anonymization options defining an anonymization profile

*Tags:* `Anonymization`

### get a list of box connections

*Tags:* `Boxes`

#### Input Parameters
* `startindex` - _optional_ - start index of returned slice of boxes
* `count` - _optional_ - size of returned slice of boxes

### connect to another box using a received URL. Used to connect to a public box.

*Tags:* `Boxes`

### create a new box connection where the supplied entity holds the remote box name. Used by publicly available boxes.

*Tags:* `Boxes`

### get incoming transactions (finished, currently receiving, waiting or failed)

*Tags:* `Boxes`

#### Input Parameters
* `startindex` - _optional_ - start index of returned slice of transactions
* `count` - _optional_ - size of returned slice of transactions

### delete an incoming transaction. If a currently active transaction is deleted, a new transaction with the remainder of the images is created when receiving the next incoming image.

*Tags:* `Boxes`

#### Input Parameters
* `id` - _required_ - ID of incoming transaction

### get the received images corresponding to the incoming transaction with the supplied ID

*Tags:* `Boxes`

#### Input Parameters
* `id` - _required_ - ID of incoming transaction

### get outgoing transactions (finished, currently sending, waiting or failed)

*Tags:* `Boxes`

#### Input Parameters
* `startindex` - _optional_ - start index of returned slice of transactions
* `count` - _optional_ - size of returned slice of transactions

### delete an outgoing transaction. This will stop ongoing transactions.

*Tags:* `Boxes`

#### Input Parameters
* `id` - _required_ - ID of outgoing transaction

### get the sent images corresponding to the outgoing transaction with the supplied ID

*Tags:* `Boxes`

#### Input Parameters
* `id` - _required_ - ID of outgoing transaction

### Delete the remote box with the supplied ID

*Tags:* `Boxes`

#### Input Parameters
* `id` - _required_ - ID of box to remove

### send images corresponding to the supplied image ids to the remote box with the supplied ID

*Tags:* `Boxes`

#### Input Parameters
* `id` - _required_ - ID of box to send images to

### Returns a list of currently available destinations. Possible destinations are box - sending data to a remote box, and scu - sending data a receiving SCP.

*Tags:* `General`

### get a list of watch directories. Each watch directory and its sub-directories are watched for incoming DICOM files, which are read and imported into slicebox.

*Tags:* `Directories`

#### Input Parameters
* `startindex` - _optional_ - start index of returned slice of watched directories
* `count` - _optional_ - size of returned slice of watched directories

### add a new directory to watch for incoming DICOM files

*Tags:* `Directories`

### stop watching and remove the directory corresponding to the supplied ID

*Tags:* `Directories`

#### Input Parameters
* `id` - _required_ - id of directory to stop watching

### Get a list of source to filter associations.

*Tags:* `Filtering`

#### Input Parameters
* `startindex` - _optional_ - start index of returned slice of source <-> filter associations
* `count` - _optional_ - size of returned slice of source <-> filter associations

### Inserts or updates a source <-> filter associations. If the specified Source already  has an association this is updated, otherwise a new is inserted.

*Tags:* `Filtering`

### remove the source <-> filter association corresponding to the supplied ID

*Tags:* `Filtering`

#### Input Parameters
* `id` - _required_ - id of source <-> filter association to remove

### List defined filters

*Tags:* `Filtering`

#### Input Parameters
* `startindex` - _optional_ - start index of returned slice of filters
* `count` - _optional_ - size of returned slice of filters

### Inserts or updates a filter. If a filter with same name as supplied filter exists this filter is updated, otherwise a new filter is inserted.

*Tags:* `Filtering`

### remove the filter corresponding to the supplied ID

*Tags:* `Filtering`

#### Input Parameters
* `id` - _required_ - id of filter to remove

### List tagpaths for the selected filter

*Tags:* `Filtering`

#### Input Parameters
* `id` - _required_ - id of filter

### add a tagpath to a filter

*Tags:* `Filtering`

#### Input Parameters
* `id` - _required_ - id of filter to remove

### remove the tagpath corresponding to the supplied ID

*Tags:* `Filtering`

#### Input Parameters
* `id` - _required_ - id of filter
* `tagpathid` - _required_ - id of TagPath to remove

### remove the forwarding rule corresponding to the supplied ID

*Tags:* `Forwarding`

#### Input Parameters
* `id` - _required_ - id of forwarding rule to remove

### get a list of all forwarding rules. A forwarding rule specifies the automatic forwarding of images from a source (SCP, BOX, etc.) to a destimation (BOX, SCU, etc.)

*Tags:* `Forwarding`

#### Input Parameters
* `startindex` - _optional_ - start index of returned slice of rules
* `count` - _optional_ - size of returned slice of rules

### add a new forwarding rule

*Tags:* `Forwarding`

### add a DICOM dataset to slicebox

*Tags:* `Images`

### bulk delete a sequence of images according to the supplied image IDs. This is the same as a sequence of DELETE requests to /images/{id}

*Tags:* `Images`

### download the export set with the supplied export set ID as a zip archive

*Tags:* `Images`

#### Input Parameters
* `id` - _required_ - ID of export set to download

### create an export set, a group of image IDs of images to export. The export set will contain the selected images. The export set is available for download 12 hours before it is automatically deleted.

*Tags:* `Images`

### add a JPEG image to slicebox. The image data will be wrapped in a DICOM file and added as a new series belonging to the study with the supplied ID

*Tags:* `Images`

#### Input Parameters
* `studyid` - _required_ - ID of study to add new series to
* `description` - _optional_ - DICOM series description of the resulting secondary capture series

### Delete the image with the supplied ID

*Tags:* `Images`

#### Input Parameters
* `id` - _required_ - ID of image

### fetch dataset corresponding to the supplied image ID

*Tags:* `Images`

#### Input Parameters
* `id` - _required_ - ID of image

### delete the selected image and replace it with an anonymized version

*Tags:* `Anonymization` `Images`

#### Input Parameters
* `id` - _required_ - ID of image to anonymize

### get an anonymized version of the image with the supplied ID

*Tags:* `Anonymization` `Images`

#### Input Parameters
* `id` - _required_ - ID of image for which to get anonymized dataset

### list all DICOM attributes of the dataset corresponding to the supplied image ID

*Tags:* `Images`

#### Input Parameters
* `id` - _required_ - ID of image

### get basic information about the pixel data of an image

*Tags:* `Images`

#### Input Parameters
* `id` - _required_ - ID of image

### modify and/or insert image attributes according to the input tagpath-value mappings

*Tags:* `Images`

#### Input Parameters
* `id` - _required_ - ID of image to modify

### get a PNG image representation of the image corresponding to the supplied ID

*Tags:* `Images`

#### Input Parameters
* `id` - _required_ - ID of image
* `framenumber` - _optional_ - frame/slice to show
* `windowmin` - _optional_ - intensity window minimum value. If not specified or set to zero, windowing will be selected from relevant DICOM attributes
* `windowmax` - _optional_ - intensity window maximum value. If not specified or set to zero, windowing will be selected from relevant DICOM attributes
* `imageheight` - _optional_ - height of PNG image. If not specified or set to zero, the image height will equal that of the data

### Returns a list of available import sessions.

*Tags:* `Import`

#### Input Parameters
* `startindex` - _optional_ - start index of returned slice of import sessions
* `count` - _optional_ - size of returned slice of import sessions

### create a new import sessions

*Tags:* `Import`

### deletes the import session with the supplied ID

*Tags:* `Import`

#### Input Parameters
* `id` - _required_ - ID of import session to delete

### Returns the import sessions with the supplied ID

*Tags:* `Import`

#### Input Parameters
* `id` - _required_ - ID of session

### get the imported images corresponding to the import session with the supplied ID

*Tags:* `Import`

#### Input Parameters
* `id` - _required_ - ID of import session

### add a DICOM dataset to the import session with the supplied ID

*Tags:* `Import`

#### Input Parameters
* `id` - _required_ - ID of session

### delete all log messages

*Tags:* `Logs`

### get a list of slicebox log messages

*Tags:* `Logs`

#### Input Parameters
* `startindex` - _optional_ - start index of returned slice of log messages
* `count` - _optional_ - size of returned slice of log messages
* `subject` - _optional_ - log subject to filter results by
* `type` - _optional_ - log type (DEFAULT, INFO, WARN, ERROR) to filter results by

### Delete the log entry with the supplied ID

*Tags:* `Logs`

#### Input Parameters
* `id` - _required_ - ID of log entry

### Returns a list of flattened metadata on the patient, study and series levels

*Tags:* `Meta Data`

#### Input Parameters
* `startindex` - _optional_ - start index of returned slice of flat series
* `count` - _optional_ - size of returned slice of flat series
* `orderby` - _optional_ - flat series property to order results by
* `orderascending` - _optional_ - order result ascendingly if true, descendingly otherwise
* `filter` - _optional_ - filter the results by matching substrings of flat series properties against this value
* `sources` - _optional_ - filter the results by matching on one or more series sources. Examples of sources are user, box, directory or scp. The list of sources to filter results by must have the form TYPE1:ID1,TYPE2:ID2,...,TYPEN:IDN. For instance, the argument sources=box:1,user:5 shows results either sent from (slice)box with id 1 or uploaded by user with id 5.
* `seriestypes` - _optional_ - filter the results by matching on one or more series types. The supplied list of series types must be a comma separated list of series type ids. For instance, the argument seriestypes=3,7,22 shows series assigned to either of the series types with ids 3, 7 and 22.
* `seriestags` - _optional_ - filter the results by matching on one or more series tags. The supplied list of series tags must be a comma separated list of series tag ids. For instance, the argument seriestags=6,2,11 shows series with either of the series tags with ids 6, 2 and 11.

### submit a query for flat series

*Tags:* `Meta Data`

### Return the flat series with the supplied ID

*Tags:* `Meta Data`

#### Input Parameters
* `id` - _required_ - ID of flat series

### Returns a list of metadata on the image level of the DICOM hierarchy

*Tags:* `Meta Data`

#### Input Parameters
* `startindex` - _optional_ - start index of returned slice of images
* `count` - _optional_ - size of returned slice of images
* `seriesid` - _required_ - reference to series to list images for

### submit a query for images

*Tags:* `Meta Data`

### Return the image with the supplied ID

*Tags:* `Meta Data`

#### Input Parameters
* `id` - _required_ - ID of image

### Returns a list of metadata on the patient level of the DICOM hierarchy

*Tags:* `Meta Data`

#### Input Parameters
* `startindex` - _optional_ - start index of returned slice of patients
* `count` - _optional_ - size of returned slice of patients
* `orderby` - _optional_ - patient property to order results by
* `orderascending` - _optional_ - order result ascendingly if true, descendingly otherwise
* `filter` - _optional_ - filter the results by matching substrings of patient properties against this value
* `sources` - _optional_ - filter the results by matching on one or more underlying series sources. Examples of sources are user, box, directory or scp. The list of sources to filter results by must have the form TYPE1:ID1,TYPE2:ID2,...,TYPEN:IDN. For instance, the argument sources=box:1,user:5 shows results either sent from (slice)box with id 1 or uploaded by user with id 5.
* `seriestypes` - _optional_ - filter the results by matching on one or more underlying series types. The supplied list of series types must be a comma separated list of series type ids. For instance, the argument seriestypes=3,7,22 shows results including series assigned to either of the series types with ids 3, 7 and 22.
* `seriestags` - _optional_ - filter the results by matching on one or more underlying series tags. The supplied list of series tags must be a comma separated list of series tag ids. For instance, the argument seriestags=6,2,11 shows results including series with either of the series tags with ids 6, 2 and 11.

### submit a query for patients

*Tags:* `Meta Data`

### Return the patient with the supplied ID

*Tags:* `Meta Data`

#### Input Parameters
* `id` - _required_ - ID of patient

### Returns all images for the patient with the supplied patient ID

*Tags:* `Meta Data`

#### Input Parameters
* `id` - _required_ - ID of patient
* `sources` - _optional_ - filter the results by matching on one or more series sources. Examples of sources are user, box, directory or scp. The list of sources to filter results by must have the form TYPE1:ID1,TYPE2:ID2,...,TYPEN:IDN. For instance, the argument sources=box:1,user:5 shows results either sent from (slice)box with id 1 or uploaded by user with id 5.
* `seriestypes` - _optional_ - filter the results by matching on one or more series types. The supplied list of series types must be a comma separated list of series type ids. For instance, the argument seriestypes=3,7,22 shows series assigned to either of the series types with ids 3, 7 and 22.
* `seriestags` - _optional_ - filter the results by matching on one or more series tags. The supplied list of series tags must be a comma separated list of series tag ids. For instance, the argument seriestags=6,2,11 shows series with either of the series tags with ids 6, 2 and 11.

### Returns a list of metadata on the series level of the DICOM hierarchy

*Tags:* `Meta Data`

#### Input Parameters
* `startindex` - _optional_ - start index of returned slice of series
* `count` - _optional_ - size of returned slice of series
* `studyid` - _required_ - reference to study to list series for
* `sources` - _optional_ - filter the results by matching on one or more series sources. Examples of sources are user, box, directory or scp. The list of sources to filter results by must have the form TYPE1:ID1,TYPE2:ID2,...,TYPEN:IDN. For instance, the argument sources=box:1,user:5 shows results either sent from (slice)box with id 1 or uploaded by user with id 5.
* `seriestypes` - _optional_ - filter the results by matching on one or more series types. The supplied list of series types must be a comma separated list of series type ids. For instance, the argument seriestypes=3,7,22 shows series assigned to either of the series types with ids 3, 7 and 22.
* `seriestags` - _optional_ - filter the results by matching on one or more series tags. The supplied list of series tags must be a comma separated list of series tag ids. For instance, the argument seriestags=6,2,11 shows series with either of the series tags with ids 6, 2 and 11.

### submit a query for series

*Tags:* `Meta Data`

### Return the series with the supplied ID

*Tags:* `Meta Data`

#### Input Parameters
* `id` - _required_ - ID of series

### get the list of series tags for the series with the supplied ID.

*Tags:* `Meta Data`

#### Input Parameters
* `id` - _required_ - ID of series

### add a series tag to the series with the supplied ID

*Tags:* `Meta Data`

#### Input Parameters
* `id` - _required_ - ID of series

### Delete all series types for the series with the supplied ID

*Tags:* `Meta Data`

#### Input Parameters
* `id` - _required_ - ID of series

### get the list of series types for the series with the supplied ID.

*Tags:* `Meta Data`

#### Input Parameters
* `id` - _required_ - ID of series

### Return the source of the series with the supplied ID

*Tags:* `Meta Data`

#### Input Parameters
* `id` - _required_ - ID of series

### Delete the series tag with the supplied series tag ID from the series with the supplied series ID

*Tags:* `Meta Data`

#### Input Parameters
* `seriesId` - _required_ - ID of series
* `seriesTagId` - _required_ - ID of series tag to remove

### Delete the series type with the supplied series type ID from the series with the supplied series ID

*Tags:* `Meta Data`

#### Input Parameters
* `seriesId` - _required_ - ID of series
* `seriesTypeId` - _required_ - ID of series type to remove

### Add the series type with the supplied series type ID to the series with the supplied series ID

*Tags:* `Meta Data`

#### Input Parameters
* `seriesId` - _required_ - ID of series
* `seriesTypeId` - _required_ - ID of series type to add

### Returns a list of series tags currently currently in use.

*Tags:* `Meta Data`

### Returns a list of metadata on the study level of the DICOM hierarchy

*Tags:* `Meta Data`

#### Input Parameters
* `startindex` - _optional_ - start index of returned slice of studies
* `count` - _optional_ - size of returned slice of studies
* `patientid` - _required_ - reference to patient to list studies for
* `sources` - _optional_ - filter the results by matching on one or more underlying series sources. Examples of sources are user, box, directory or scp. The list of sources to filter results by must have the form TYPE1:ID1,TYPE2:ID2,...,TYPEN:IDN. For instance, the argument sources=box:1,user:5 shows results either sent from (slice)box with id 1 or uploaded by user with id 5.
* `seriestypes` - _optional_ - filter the results by matching on one or more underlying series types. The supplied list of series types must be a comma separated list of series type ids. For instance, the argument seriestypes=3,7,22 shows results including series assigned to either of the series types with ids 3, 7 and 22.
* `seriestags` - _optional_ - filter the results by matching on one or more underlying series tags. The supplied list of series tags must be a comma separated list of series tag ids. For instance, the argument seriestags=6,2,11 shows results including series with either of the series tags with ids 6, 2 and 11.

### submit a query for studies

*Tags:* `Meta Data`

### Return the study with the supplied ID

*Tags:* `Meta Data`

#### Input Parameters
* `id` - _required_ - ID of study

### Returns all images for the study with the supplied study ID

*Tags:* `Meta Data`

#### Input Parameters
* `id` - _required_ - ID of study
* `sources` - _optional_ - filter the results by matching on one or more series sources. Examples of sources are user, box, directory or scp. The list of sources to filter results by must have the form TYPE1:ID1,TYPE2:ID2,...,TYPEN:IDN. For instance, the argument sources=box:1,user:5 shows results either sent from (slice)box with id 1 or uploaded by user with id 5.
* `seriestypes` - _optional_ - filter the results by matching on one or more series types. The supplied list of series types must be a comma separated list of series type ids. For instance, the argument seriestypes=3,7,22 shows series assigned to either of the series types with ids 3, 7 and 22.
* `seriestags` - _optional_ - filter the results by matching on one or more series tags. The supplied list of series tags must be a comma separated list of series tag ids. For instance, the argument seriestags=6,2,11 shows series with either of the series tags with ids 6, 2 and 11.

### get a list of DICOM SCPs. Each SCP is a server for receiving DICOM images from e.g. a PACS system.

*Tags:* `SCPs`

#### Input Parameters
* `startindex` - _optional_ - start index of returned slice of SCPs
* `count` - _optional_ - size of returned slice of SCPs

### add a new SCP for receiving DICOM images

*Tags:* `SCPs`

### shut down and remove the SCP corresponding to the supplied ID

*Tags:* `SCPs`

#### Input Parameters
* `id` - _required_ - id of SCP to remove

### get a list of DICOM SCUs. Each SCU is a client for sending DICOM images to an SCP, e.g. a PACS system.

*Tags:* `SCUs`

#### Input Parameters
* `startindex` - _optional_ - start index of returned slice of SCUs
* `count` - _optional_ - size of returned slice of SCUs

### add a new SCU for sending DICOM images

*Tags:* `SCUs`

### remove the SCU corresponding to the supplied ID

*Tags:* `SCUs`

#### Input Parameters
* `id` - _required_ - id of SCU to remove

### send the images with the supplied image IDs to a DICOM SCP using the the SCU with the supplied scu ID

*Tags:* `SCUs`

#### Input Parameters
* `id` - _required_ - id of SCU to use for sending

### get a list of all added series types. By filtering search results for certain series types, it is easier for applications to ensure that they read images of applicable types.

*Tags:* `Series Types`

#### Input Parameters
* `startindex` - _optional_ - start index of returned slice of series types
* `count` - _optional_ - size of returned slice of series types

### add a new series type

*Tags:* `Series Types`

### get a list of rules for assigning series types to series. A rule connects to a series of attributes with values and a resulting series type. If a series has the required values of the listed attributes, it is assigned to the series type of the rule.

*Tags:* `Series Types`

#### Input Parameters
* `seriestypeid` - _required_ - ID of series type to list rules for

### add a new series type rule

*Tags:* `Series Types`

### get the status of the internal process of updating series types for series following a change of series types, rules or attributes.

*Tags:* `Series Types`

### remove the series type rule corresponding to the supplied ID

*Tags:* `Series Types`

#### Input Parameters
* `id` - _required_ - id of series type rule to remove

### get the list of attributes for the series type rule with the supplied ID.

*Tags:* `Series Types`

#### Input Parameters
* `id` - _required_ - index of series type rule to list rule attributes for

### add a new series type rule attribute

*Tags:* `Series Types`

#### Input Parameters
* `id` - _required_ - ID of rule

### remove the series type rule attribute corresponding to the supplied series type and attribute IDs

*Tags:* `Series Types`

#### Input Parameters
* `ruleId` - _required_ - id of series type rule for which to remove an attribute
* `attributeId` - _required_ - id of attribute to remove

### submit a query for seriestypes for a list of series

*Tags:* `Meta Data`

### remove the series type corresponding to the supplied ID

*Tags:* `Series Types`

#### Input Parameters
* `id` - _required_ - id of series type to remove

### request an asynchronous update of all series, labelling appropriate series with the series type corresponding to the supplied ID.

*Tags:* `Series Types`

#### Input Parameters
* `id` - _required_ - id of series type to update series labels for

### Returns a list of currently available data sources. Possible source types are user - data imported by an API call by a user, box - data received from a remote box, directory - data imported via a watched directory, import - data imported into slicebox using import sessions, or scp - data received from a PACS.

*Tags:* `General`

### No-op route for checking whether the service is alive or not

*Tags:* `General`

### stop and shut down slicebox

*Tags:* `General`

### add an image (dataset) as part of a transaction. This method is used when sending images using the push method to a public slicebox.

*Tags:* `Transactions`

#### Input Parameters
* `token` - _required_ - authentication token identifying the current box-to-box connection
* `transactionid` - _required_ - the ID of the client's outgoing transaction
* `sequencenumber` - _required_ - the index of this image in the transaction
* `totalimagecount` - _required_ - the total number of images in this transaction

### fetch an image from the connected box as part of a transaction. This method is used when sending images using the poll method from a public slicebox.

*Tags:* `Transactions`

#### Input Parameters
* `token` - _required_ - authentication token identifying the current box-to-box connection
* `transactionid` - _required_ - the ID of the outgoing transaction
* `imageid` - _required_ - the ID of the outgoing transaction image

### signal that the supplied outgoing transaction and image was successfully received and can be marked as sent. This method is used when sending images using the poll method from a public slicebox.

*Tags:* `Transactions`

#### Input Parameters
* `token` - _required_ - authentication token identifying the current box-to-box connection

### signal that the image corresponding to the supplied outgoing transaction and image could not be read or stored properly on the receiving side, and that the transaction should be marked as failed.

*Tags:* `Transactions`

#### Input Parameters
* `token` - _required_ - authentication token identifying the current box-to-box connection

### get next outgoing transaction and image (information on the next image that the connected box wishes to send to you), if any. This method is used when sending images using the poll method from a public slicebox.

*Tags:* `Transactions`

#### Input Parameters
* `token` - _required_ - authentication token identifying the current box-to-box connection

### get the status of the remote incoming transaction with the supplied transaction ID

*Tags:* `Transactions`

#### Input Parameters
* `token` - _required_ - authentication token identifying the current box-to-box connection
* `transactionid` - _required_ - the ID of the client's outgoing transaction

### update the status of the transaction with the supplied ID

*Tags:* `Transactions`

#### Input Parameters
* `token` - _required_ - authentication token identifying the current box-to-box connection
* `transactionid` - _required_ - the ID of the client's outgoing transaction

### Returns all users of slicebox

*Tags:* `Users`

#### Input Parameters
* `startindex` - _optional_ - start index of returned slice of users
* `count` - _optional_ - size of returned slice of users

### Creates a new user. Dupicates are accepted but not added.

*Tags:* `Users`

### obtain information on the currently logged in user as specified by the supplied session cookie, IP address and user agent.

*Tags:* `Users`

### Obtain a session cookie that can be used to authenticate future API calls from the present IP address and with the present user agent.

*Tags:* `Users`

### Logout the current user by responding with a delete cookie header removing the session cookie for this user.

*Tags:* `Users`

### deletes a single user based on the ID supplied

*Tags:* `Users`

#### Input Parameters
* `id` - _required_ - ID of user to delete

## License

**flow**ground :- Telekom iPaaS / slicebox-local-connector<br/>
Copyright © 2019, [Deutsche Telekom AG](https://www.telekom.de)<br/>
contact<EMAIL_ADDRESS>
All files of this connector are licensed under the Apache 2.0 License. For details
see the file LICENSE on the toplevel directory.

repository: flowground/slicebox-local-connector

repo_name: flowground/slicebox-local-connector


text:
---
layout: post
title: "TLS/SSL Certificates - The Private Key"
#description: ""
#date: 2019-07-04 00:39:00 +0800
tags: security
---

There is already a ton of information out there about this topic.
But I noticed that there is no one site that provides exactly what I usually need.
Some provide only a specific use-case and miss out on others.
I often have to do multiple searches. Although searching Google is fast and hits are often accurate,
it can still be an exhausting task. It's about time I create my own documentation.

# There are many ways to create a private key

TLS/SSL Certificates require a private key. It's the very first thing that is required to produce a certificate.

### Create an RSA private key and save it to a file

```
$ openssl genrsa -out privatekey.pem 2048
```
This will create a private key and save it to a file named *privatekey.pem*.
The size of the created key is 2048 bits.

Sometimes you don't want to save the private key to a file and instead, you want to display it or send it to the screen.
For example, you need to cut-and-paste the key to a website or GUI application.
You want to save the step of doing a cat command of the file and
avoid the step of removing it because for security reasons, you don't want it saved on your hard drive.

### Create an RSA private key and and display it on the screen

```
$ openssl genrsa 2048

Generating RSA private key, 2048 bit long modulus
..................................+++
..........................................................................+++
e is 65537 (0x10001)
<REDACTED_PRIVATE_KEY>
```

The command above will create a private key and send it to STDOUT.

At some point, you will need to save your private key to a file so that it can be used later.
I don't think anyone can memorize an RSA key. As you can see above,
it is composed of characters that look meaningless.

So if you need to save it to a file, clearly, it is not desirable to store it in the clear.
It would be like saving a password to a file in clear text.

The solution to this problem is to store the private key in encrypted form.
The key (passphrase) to encrypt the RSA key will then be smaller, hence, easier to memorize by a human.

### Create an encrypted RSA private key

```
$ openssl genrsa -aes256 2048
```

This command will create a private key and encrypt it.
The password or passphrase to encrypt the key will be prompted.

Encryption will be done using the AES-256 algorithm. Other types of algorithm are available.
Run *openssl genrsa --help* to view other types.

By using a passphrase, it will be smaller in size and easier to memorize by a human.

However, although prompting for the passphrase is a secure way of supplying the passphrase, there are times
when this is not possible. For example, you need to do this programmatically or there is no human to supply the passphrase.

### Create an encrypted private key without prompting for passphrase

```
$ echo -n "secret" | openssl genrsa -aes256 -passout stdin 2048
```

Instead of prompting for the passphrase, the passphrase can be supplied in the command line through STDIN of openssl.
The passphrase used to encrypt the created key above is the word *secret*.

This command may not be a good idea to use in practice because the passphrase is displayed in clear text.
But this is just a demonstration because even with STDIN, you can still supply the passphrase in a secured way
and will not display to the screen or appear in the command in clear text.

For example, you can get the passphrase from a file and then pass the contents to the STDIN of the openssl command.

```
$ cat ~/.ssh/passphrase.txt | openssl genrsa -aes256 -passout stdin 2048
```

Instead of a file, you can use a command or application to derive the passphrase or retrieve it from a secured source.

```
$ getpassphrase | openssl genrsa -aes256 -passout stdin 2048
```

The *getpassphrase* command will send the passphrase to STDOUT and through the STDIN of openssl.

Supplying the passphrase in this manner provides better security since the
passphrase is never displayed on the terminal or is never present in the filesystem.

However, eventually, to use a private key, you'll need it in unencrypted form.

### Decrypt an encrypted RSA private key

```
$ openssl rsa -in privatekey_e.pem
```

This command decrypts an encrypted key stored in *privatekey_e.pem* file.
It will prompt for the passphrase to decrypt the key.
If the passphrase is correct, the decrypted key will be displayed (sent to STDOUT).

### Decrypt an encrypted RSA private key without prompting for the passphrase

Instead of prompting for the passphrase, you can supply the passphrase through STDIN of openssl.
This is achieved by using the *-passin stdin* option of openssl.

```
$ echo "secret" | openssl rsa -passin stdin -in privatekey_e.pem
```

```
$ cat ~/.ssh/passphrase.txt | openssl rsa -passin stdin -in privatekey_e.pem
```

```
$ getpassphrase | openssl rsa -passin stdin -in privatekey_e.pem
```

What if when you first created a private key you don't need it encrypted,
but later on decided you want it encrypted?

### Encrypt an RSA private key

```
$ openssl rsa -aes256 -in privatekey.pem
```

This command will encrypt the private key stored in *privatekey.pem* file.
It will prompt for the passphrase to use.

### Encrypt an RSA private key without prompting for the passphrase

```
$ echo "secret" | openssl rsa -aes256 -passout stdin -in privatekey.pem
```

```
$ cat ~/.ssh/passphrase.txt | openssl rsa -aes256 -passout stdin -in privatekey.pem
```

```
$ getpassphrase | openssl rsa -aes256 -passout stdin -in privatekey.pem
```

The commands above will encrypt the key in *privatekey.pem* file using a passphrase supplied through the STDIN of openssl.
The output (STDOUT) of the openssl command will be the encrypted key.

To save the encrypted key to a file, redirect the output to a file or use the -out option.

```
$ openssl rsa -aes256 -in privatekey.pem > privatekey_e.pem
```

```
$ openssl rsa -aes256 -in privatekey.pem -out privatekey_e.pem
```


text:
## Cluster Configuration ##

The cluster configuration is saved in the cluster view. It's updatable using [stolonctl](stolonctl.md).

It's possible to replace the whole current configuration or patch only some configuration options.

### Configuration replace example

``` bash
echo '{ "requestTimeout": "10s", "sleepInterval": "10s" }' | stolonctl --cluster-name=mycluster config replace -f - '
```

### Configuration patch example

``` bash
stolonctl --cluster-name=mycluster config patch '{ "synchronousreplication" : true }'
```

or

``` bash
echo '{ "synchronousreplication" : true }' | stolonctl --cluster-name=mycluster config patch -f -
```

In both commands the configuration must be provided in json format.

### Configuration Format.

By default the cluster configuration is empty. For every empty field a default is defined. This is the whole configuration with its defaults in json format:

``` json
{
    "requestTimeout": "10s",
    "sleepInterval": "5s",
    "keeperFailInterval": "20s",
    "pgreplUser": "username",
    "pgreplPassword": "password",
    "maxStandbysPerSender": 3,
    "synchronousReplication": false
}
```

* requestTimeout: (duration) time after which any request (keepers checks from sentinel etc...) will fail.
* sleepInterval: (duration) interval to wait before next check (for every component: keeper, sentinel, proxy).
* keeperFailInterval: (duration) interval after the first fail to declare a keeper as not healthy.
* pgreplUser: (string) PostgreSQL replication username
* pgreplPassword: (string) PostgreSQL replication password
* maxStandbysPerSender: (uint) max number of standbys for every sender. A sender can be a master or another standby (with cascading replication).
* synchronousReplication: (bool) use synchronous replication between the master and its standbys

duration types (as described in https://golang.org/pkg/time/#ParseDuration) are signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as "300ms", "-1.5h" or "2h45m". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".

repository: saimandeper/stolon

repo_name: saimandeper/stolon


text:
## Play Around with Protobuf+LMDB
Try to use protobuf python wrapper to enhance daily working efficiency.

### Installation

* option 1. using pre-build

```
# Ubuntu
sudo apt-get install protobuf-compiler
# Mac
brew install protobuf
```
After Installation, check the protobuffer compiler

```
protoc --version
```

Then install its python library with pip

```
pip install protobuf
```

* Option 2. Using source code.. which is not recommanded

```
git clone https://github.com/google/protobuf.git
# follow its README
```

### Prepare .proto file

ProtoBuffer required a definition file of your own data structure. i.e. the `definition.proto` file in our example. FYI. this proto file contains a message named `Datum`, which is copied from [CAFFE](https://github.com/BVLC/caffe/blob/master/src/caffe/proto/caffe.proto).

```
protoc --python_out=. definition.proto
```

with the 'compile' command, a file will be generated named with `**_pb2.py`, which will be used in your actual py script

### Read & Write

As two scripts shows, `reader.py` and `writer.py`
In order to apply the tech into daily working with CAFFE, lmdb support is added.

```
pip install lmdb
```

using lmdb in python is pretty easy, please ref to these two py scripts.

with all prerequest, all three steps to play around is as follows.

```
git clone https://github.com/hyichao/protobuf-lmdb.git
cd protobuf-lmdb
protoc --python_out=. definition.proto
python writer.py
python reader.py
```

gha_language: Python


text:
# NetEdit

NetList Editor - Using MAME netlist library for simulation

To compile first clone project:

```
git clone --recursive https://github.com/mamedev/netedit.git

```

To build on Windows/Linux/macOS use:

```
make -j9
```

or to generate Visual Studio 2015 project :

```
vs2015.cmd
```

repository: trgswe/mame-netedit

repo_name: trgswe/mame-netedit


text:
+++
date = "2012-07-04 15:32:00+00:00"
draft = false
tags = ["hasgeek", "python", "hiring", "kracekumar"]
title = "How I got into HasGeek Crew"
url = "/post/26494437210/how-i-got-into-hasgeek-crew"
+++
## Background about me

I am kracekumar, graduated from Amrita school of Engineering, Coimbatore in B.Tech IT (2007-2011). I am working with IBM India Pvt Ltd, Bangalore as Associate System Engineer from 14th July, 2011 til 16th July, 2012.(C\# developer but never wrote single line of code in c\# in IBM).

I am GNU/Linux user for 3 years and developed application in PHP, Rails, Flask(all are hobby projects).

## Scene

I was not happy with job at IBM and I had training bond for one year(14th July, 2011 to 13th July 2012), decided to resign from my job once bond period is over whether I have new job offer or not. I usually look for job posting in Hasgeek job board  from time to time. I was very interested to work in Linux, Python or Rails and wasn’t interested in Java or C\# or Windows Technology.

## I tweeted on 13th May

>
> Seems like I couldn’t find out cool python company in india \#sad.
>

Following are the replies I received in order (Ascending order of replies in twitter)

>
> Mehul Ved @mehulved
>
> @kracetheking define cool python company? Maybe @versesane or @Sengupta can help. They have done some research on such companies.
>

---
>
> kracekumar @kracetheking
>
> @mehulved: Cool means geeky ppl who care for every line code of code. @versesane @Sengupta
>

---
>
> Mehul Ved @mehulved
>
> @kracetheking what about @Instamojo where @Sengupta and @hiway work? @versesane
>

---
>
> James Dennis @j2labs
>
> @kracetheking Have you met @sid\_chilling ? He’s even a Brubeck user!
>

---
>
> Ankur Gupta @versesane
>
> @kracetheking @mehulved @Sengupta bangalore has lot of good work in python happening …
>

---
>
> Ankur Gupta @versesane
>
> @kracetheking @mehulved @Sengupta best way to accumulate list of companies is to see archived list of opening on http://simplyhired.co.in
>

---
>
> kracekumar @kracetheking
>
> @versesane @mehulved @Sengupta :I always search in hasgeek jobs but they want people who know python, but want to code in php.
>

---
>
> Ankur Gupta @versesane
>
> @kracetheking @mehulved @Sengupta well how many years of professional work ex do you have or what softwares have you worked on that ppl use
>

---
>
> kracekumar @kracetheking
>
> @j2labs: I have meet @_sunil_ during pycon india, 2011 who works along with @sid\_chilling,that time I haven’t discovered brubeck. thanks!
>

---
>
> sid\_chilling @sid\_chilling
>
> @kracetheking good to meet you. do contact me or @_sunil_ when you come to our city. would love to meet. thanks @j2labs
>

---
>
> Kiran Jonnalagadda @jackerhack
>
> @kracetheking We don’t advertise, but we could do with Python skills on board to
>

Kiran is the founder of hasgeek

---
>
> kracekumar @kracetheking
>
> @versesane : Thanks for those links. /cc @mehulved @Sengupta
>

---
>
> Ankur Gupta @versesane
>
> @kracetheking i can introduce u to some hiring managers let us talk over email versesane at gmail
>

---

All the above conversation happened on 13th May 2012.

On 14th May 2012

>
> kracekumar @kracetheking
>
> @jackerhack : When can we have the talk ?
>

---
>
> Kiran Jonnalagadda @jackerhack
>
> @kracetheking I’m out of town this week. Can talk on IRC though. I’m jace in irc://irc.freenode.net/\#hasgeek.
>

---

Then

Myself and Kiran had conversation in IRC and kiran revealed hiring policy for hasgeek is contribute to hasgeek codebase and if it is ok you are hired. I agreed to the deal.

## Contributing to Hasgeek Codebase

From 14th May 2012 to 18th May 2012 I worked on Hasgeek Tv, My contribution here. Most of the code was already completed by kiran, but there were few incomplete pieces which I completed.

On 21st May 2012, kiran and me decided we will meet on 22nd May 2012 in CIS(Center for Internet Society). On 22nd May I was half an hour late to the place. Then Kiran, Siddarth and me had discussion(not an interview) about each other. Kiran and siddarth informed me that they are working on new project Hacknight for which they want me to contribute and depending on the outcome in three weeks, I might be hired.

## Journey

It was Kiran, Siddarth, Sajjad and I who worked on hacknight. The code is Here. I worked on hacknight code in evening after coming from office and saturday in CIS. Most of our discussion was carried out in CIS(Hasgeek office ) , IRC, Github.

I had initial learning curve looking into other hasgeek libraries like Coaster, Baseframe, Lastuser, Peopleflow. Thanks for Kiran, Siddarth, Sajjad who answered all my silly doubts and helped to get started.

## My mistakes

I broke the code twice. Both were due to improper tests.

*

    Baseframe broken code

*

    Hacknight code which I broke

## Climax

On 7th June, 2012 Kiran informed hasgeek is happy to hire me after final talk on 9th June, 2012. All went well, I informed I am happy to join Hasgeek. I will be joining hasgeek on 17th July, 2012.

Finally if you have read so far you should probably look into Hacknight Beta Version and feel free to speak to me in Twitter.

## Thanks

Thanks a ton to following people who setup the entire atmosphere

-[mehulved](https://twitter.com/#!/mehulved)
-[versesane](https://twitter.com/#!/versesane)
-[Sengupta](https://twitter.com/#!/Sengupta)
-[j2labs](https://twitter.com/#!/j2labs)
-[sid_chilling](https://twitter.com/#!/sid_chilling)


text:
Sample API Built With NodeJS, HapiJS, LevelDB, Swaggerui
=================

This is a sample API built with NodeJS, HapiJS, LevelDB, Swaggerui to demonstrate the ease and rapid prototyping abilities of HapiJS and LevelDB. It will also offer a boilerplate app for anyone looking to build an application with this technology stack. Data will be persisted in LevelDB between each run of the server.

**This is an open sample, if you would like to see this project cover a specific area e.g. views, caching, different auth schemes, open an issue and I will try cover it. I aim to practice [OPEN open source](http://blog.technokrat.nl/2014/09/15/open-open-source/) on this project, meaning individuals making significant or valuable contributions will be given commit access.**

Feel free to raise an issue or contact me on twitter if you have any questions [@johnbrett_](https://www.twitter.com/johnbrett_). Beginners, feature requests and bug reports are welcomed.

*Please star if you using this module so I know where to focus my time spent on open source work.*

To build and run:

        $ git clone https://github.com/johnbrett/hapi-level-sample.git
        $ cd hapi-level-sample
        $ npm install
        $ node index.js

You can then view the API documentation generated by Swaggerui by visiting: http://localhost:8080/documentation

If you want to sample authentication for the api, run with:

        $ AUTH=required node index.js

Authentication is disabled for the create user route, so you can create a user with an access token of your choosing to specify when querying the other routes.

Node Modules created in the making of this project

 - [hapi-level](https://github.com/johnbrett/hapi-level) : Utility module to ease integration of Hapi and LevelDB

 - [hapi-auth-bearer-token](https://github.com/johnbrett/hapi-auth-bearer-token) : Authorization module for HapiJS based on the Bearer authentication scheme.

 - [calibrate](https://github.com/johnbrett/calibrate) : DRY to create consistent responses, with error handling

repository: carlozamagni/hapi-level-sample

repo_name: carlozamagni/hapi-level-sample


text:
# Algorithm Trading with ML on NSE stocks.
A project that tries to influence buying and selling of stocks using an algorithmic model built using an ensemble of KNN, Decision Tree, Random forest and SVM. The model depicts an ideal scenario for maximizing profits from a trade. A momentum strategy that is used to predict
trading signal has been modelled based on a set of rules using various technical indicators.

The dataset compromises 10 year Stock details of 5 stocks namely: RELIANCE, HDFC,ITC,INFOSYS and TCS.
The result of the analysis is the predicted trend of the market index, which can be used to set out some trading rules:
• If the next day trend is Uptrend, then the decision is BUY

• If BUY decision already exists, then HOLD.

• If the next day trend is Downtrend, then the decision is SELL

• If SELL decision already exists, then HOLD

According to the result obtained with these rules, the return of strategy has been calculated.

# Results

An accuracy of 94.2% was achieved which indicates that our model has the capability of reducing the losses compared to the actual returns; if they were calculated on the basis of the previous day's closing price.

repository: akashyadavv/AlgoTradingNSE

repo_name: akashyadavv/AlgoTradingNSE


text:
# tauri-events-minimal

A Minimal Tauri events example to showcase an issue with pub/sub.

Created following [the official guide].

## Download

Simply clone this repository:

```
$ git clone https://github.com/yassen-damyanov/tauri-events-minimal.git
```

## Prerequisites

- POSIX OS (Won't run on Windows because of a symlink used.)
- rust + cargo
- node + npm
- yarn
- make

For rust + cargo and node + npm, see [Tauri's official installation docs],
(see at the bottom for OS-specific instructions).

## Initializaton

Enter the repository root and do:

```
$ make init
```

## Running in dev mode

Enter the repository root and do:

```
$ make dev
```

(The first run is going to take time, compiling some 380 crates.)

For a while you should see something like

```
.
.
Starting up http-server, serving www/
Available on:
  http://<IP_ADDRESS>:8000
  http://<IP_ADDRESS>:8000
Hit CTRL-C to stop the server
   Compiling proc-macro2 v1.0.27
   Compiling unicode-xid v0.2.2
   Compiling syn v1.0.73
   .
   . [compiling lots of modules]
   .
   Compiling tauri-runtime v0.1.4
   Compiling tauri-runtime-wry v0.1.4
    Finished dev [unoptimized + debuginfo] target(s) in 2m 23s
     Running `target/debug/app`
** Tauri app about to start
[2021-07-20T16:58:14.504Z]  "GET /" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Safari/605.1.15"
```

and then the app window should appear.

## Check how it works

- Open the dev tools of the app window (e.g. via right-click + 'Inspect Element')
- Choose the 'Console' tab on bottom to reveal the JS console
- Click "Send Event" in the application pane above

What appears on the console:

```
sendEvent() called
onUserClick() called
user-click
{"message": "Tauri looks good! (coming from front-end)"}
```

which means that the front-end listener has intercepted the front-end `emit`
call, not the back-end one. The rust back-end (in `src-tauri/src/main.rs`)
does not seem to be involved at all.

[the official guide]: https://tauri.studio/en/docs/usage/guides/events
[Tauri's official installation docs]: https://tauri.studio/en/docs/getting-started/intro

repository: ZodiacWind/tauri-events-minimal

repo_name: ZodiacWind/tauri-events-minimal


text:
# IndoorLocation core classes for iOS

![Build status](https://img.shields.io/gitlab/pipeline/mapwize/indoor-location-ios-mirror/master)
![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/indoorlocation/indoor-location-ios)
![Cocoapods](https://img.shields.io/cocoapods/v/IndoorLocation)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)

## Core classes

### IndoorLocation

IndoorLocation is a simple object defining a location inside a building using latitude, longitude and floor. The following properties are available:

- `double latitude` latitude in degrees N of the equator
- `double longitude` longitude in degrees E of the prime meridian
- `NSNumber* floor` floor number which can be decimal
- `double accuracy` uncertainty in meters
- `NSDate* timestamp` when the location was created
- `NSString* providerName` the name of the provider who produced the location

Besides the default `init`, the following constructor is defined:

```
- (instancetype) initWithLatitude:(double) latitude longitude:(double) longitude floor:(NSNumber*) floor;

```

### IndoorLocationProvider

Abstract class to serve as a base for any provider. A provider is basically a class that emits IndoorLocations.

### IndoorLocationProviderListener

Interface that you must implement to receive events from IndoorLocation providers.

## Support

For any support with this provider, please do not hesitate to contact [support<EMAIL_ADDRESS>
## License

MIT

repository: IndoorLocation/indoor-location-ios

gha_language: Objective-C

repo_name: IndoorLocation/indoor-location-ios


text:
---
id: version-7.4.0-routes
title: Routing
sidebar_label: Routing
original_id: routes
---

These docs describe an API for routes that is current as of `v6.2.0`. Documentation for routing prior to this version will not be included because it will be deprecated in the future.

## Basic Routing

The `routes` API allows you to define routes to for your site within the site's controller \(`index.js`\) file. By exporting an array of route objects, Amphora will attach each route to the Express Router under a `get` handler. Previous versions of Amphora exposed the whole router to a developer to attach routes, but this has been updated in favor of greater stability/feature set in Amphora.

To assign routes for your site, export an Array like the one below at the `routes` property of your site's controller. Routing patterns should be [Express compatible](https://expressjs.com/en/guide/routing.html#route-paths).

```javascript
module.exports.routes = [
  { path: '/'},
  { path: '/:name'},
  { path: '/:year/:month/:slug' }
];
```

## Redirects

The router can handle redirects if you choose to handle these in Clay. Simply add the `redirect` property to your path object with the destination being the path you'd like to redirect users to. Make sure the destination path exists before adding in a redirect.

```javascript
// Redirects to the trailing slash of a version of the `/blog/` path
module.exports.routes = [
  { path: '/'},
  { path: '/blog/'},
  { path: '/blog', redirect: '/blog/'}
];
```

## Dynamic Pages

One of the problems the router aims to solve is `dynamic pages`. In Clay, there is a 1-1 relationship between a `_uri` and a `_page`, which makes it extremely hard to build a dynamic system which doesn't require a single page for every public url.

An example of this would be building an archive page of blog posts that have a certain characteristic or tag. Ideally, you'd have one page who would parse the url, find the value the user expects and then render a page with that value filled in all the places you would expect.

To do this in Clay you can use a `dynamic page`, which allows you to define ONE page to resolve all requests at a given route. For example:

```javascript
// All requests to `/archive/:tag` will be directed to `/_pages/someUniquePageId`
module.exports.routes = [
  { path: '/'},
  { path: '/archive/:tag', dynamicPage: 'someUniquePageId'}
];
```

By adding this path object into your `routes` object you'll be able to create one page to handle all the requests to the `/archive/*` route. **Make sure your** [**dynamic page is published**](publish#dynamic-pages-publishing) **or else this won't work!**

repository: clay/amphora

gha_language: JavaScript

repo_name: clay/amphora


text:
This is a program for universal unicode input.

Install with `raco pkg install the-unicoder`.

Documentation is [online](http://docs.racket-lang.org/the-unicoder/index.html), or
available by running `raco docs the-unicoder` after installing.

repository: willghatch/the-unicoder

repo_name: willghatch/the-unicoder


text:
# Ninject.Extensions.Conventions

[![Build status](https://ci.appveyor.com/api/projects/status/ig40w60r8sm5uh4k?svg=true)](https://ci.appveyor.com/project/Ninject/ninject-extensions-conventions)
[![codecov](https://codecov.io/gh/ninject/Ninject.Extensions.Conventions/branch/master/graph/badge.svg)](https://codecov.io/gh/ninject/Ninject.Extensions.Conventions)
[![NuGet Version](http://img.shields.io/nuget/v/Ninject.Extensions.Conventions.svg?style=flat)](https://www.nuget.org/packages/Ninject.Extensions.Conventions/)
[![NuGet Downloads](http://img.shields.io/nuget/dt/Ninject.Extensions.Conventions.svg?style=flat)](https://www.nuget.org/packages/Ninject.Extensions.Conventions/)

Provides a configuration by convention extension for Ninject.

## Sample uses

### Binding default single interface
```CSharp
IKernel kernel = new StandardKernel();

kernel.Bind(x =>
    {
        x.FromThisAssembly() // Scans currently assembly
         .SelectAllClasses() // Retrieve all non-abstract classes
         .BindDefaultInterface(); // Binds the default interface to them;
    });
```

Default interface in this scenario means that if your interface is named IService, then the class named Service will be binded to it. However, the class SqlBasedService will not be binded and will fail to retrieve the implementation.

### Binding single interface
```CSharp
IKernel kernel = new StandardKernel();

kernel.Bind(x =>
    {
        x.FromThisAssembly() // Scans currently assembly
         .SelectAllClasses() // Retrieve all non-abstract classes
         .BindSingleInterface(); // Binds the default interface to them;
    });
```

Binding single interface means that you are expecting to have one implementation per classes found. This would bind SqlBasedService to IService as well as Service to IService but would not bind SqlBasedService and Service to an IService.

You can find more details in [wiki page](https://github.com/ninject/Ninject.Extensions.Conventions/wiki).


text:
{{{
  "title": "Remove Vertical Autoscale Policy from Server",
  "date": "05-25-2015",
  "author": "Bryan Friedman",
  "attachments": []
}}}

Removes the autoscale policy from a given server, if the policy has first been applied to the server. Calls to this operation must include a token acquired from the authentication endpoint. See the [Login API](../Authentication/login.md) for information on acquiring this token.

### When to Use It

Use this API operation when you want to remove the autoscale policy from a server.

## URL

### Structure

    DELETE https://api.ctl.io/v2/servers/{accountAlias}/{serverId}/cpuAutoscalePolicy

### Example

    DELETE https://api.ctl.io/v2/servers/ALIAS/WA1ALIASSERV0101/cpuAutoscalePolicy

## Request

### URI Parameters

| Name | Type | Description | Req. |
| --- | --- | --- | --- |
| accountAlias | string | Short code for a particular account | Yes |
| serverId | string | ID of the server. Retrieved from query to containing a group, or by looking at the URL when viewing a server in the Control Portal. | Yes |

## Response

The response will not contain JSON content, but should return the HTTP `204 No Content` response upon deletion of the policy from the server.

repository: gsanchezu/APIDocs

repo_name: gsanchezu/APIDocs


text:
# Cell Cores for Cardinality Cube

Implement *Core interface* and *CoreInitiator* functions to create custom cores. You can see examples like
basic set (basicset.go) or hyperloglog (hll.go). And don't forget to add tests.

repository: bahadrix/CardinalityCube

gha_language: Go

repo_name: bahadrix/CardinalityCube


text:
### [CVE-2016-3393](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-3393)
![](https://img.shields.io/static/v1?label=Product&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Version&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Vulnerability&message=n%2Fa&color=brighgreen)

### Description

Graphics Device Interface (aka GDI or GDI+) in Microsoft Windows Vista SP2; Windows Server 2008 SP2 and R2 SP1; Windows 7 SP1; Windows 8.1; Windows Server 2012 Gold and R2; Windows RT 8.1; and Windows 10 Gold, 1511, and 1607 allows remote attackers to execute arbitrary code via a crafted web site, aka "Windows Graphics Component RCE Vulnerability."

### POC

#### Reference
No PoCs from references.

#### Github
- https://github.com/ARPSyndicate/cvemon

repository: trickest/cve

gha_language: HTML

repo_name: trickest/cve


text:
---
layout: default
---

# 1995-01-12 - Re: Purpose of Data Havens

## Header Data

From: "L. McCarthy"<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Message Hash: 62417e5b109d909510719b94a5cbfdac241fa06928c710bb38c715ccd474197b

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1995-01-12 18:05:39 UTC

Raw Date: Thu, 12 Jan 95 10:05:39 PST

## Raw message

```
{% raw  %}From: "L. McCarthy"<EMAIL_ADDRESS>Date: Thu, 12 Jan 95 10:05:39 PST
To<EMAIL_ADDRESS>Subject: Re: Purpose of Data Havens
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

-----BEGIN PGP SIGNED MESSAGE-----

Hal writes:
> The idea of offsite storage doesn't seem that helpful since you can just
> store the data on your own disk in encrypted form.  Maybe if encryption
> gets outlawed it would be useful, but then you can't use encryption to
> communicate with the haven.

As Eric notes elsewhere, off-site backups are useful in general in case some
physical calamity strikes your site. It seems to me that a data haven
addresses a more aggressive threat model than this. Rather than just worrying
about the act of a hacker / nature / etc. eradicating our local copies of
data (encrypted or not), we're concerned about intelligent agents (human or
electronic) attempting to commit genocide on all instances of some data we
possess.

Scenario: June is a test engineer at Rockwell Intl. At the lab where she works,
it is observed that some rubber O-rings being designed for the space shuttle
are liable to crack, and lose their airtight seal, when exposed to the
extremely low temperatures of space. The project is behind, so the researchers
are instructed to proceed in spite of the problem. June encrypts the test
results and deposits them in a data haven. Then she calls her boss's boss and
offers a deal (whitemail ?). Either the part is redesigned, or she'll present
the incriminating evidence to the New York Times. Even if Rockwell sends some
goons to June's apartment while she's at work the next day, to reduce her
laptop to solder, she still has the means to carry out her threat.

"Rikki don't lose that number - send it off in a letter to yourself"-Steely Dan

 -L. Futplex McCarthy
- ---
[This message has been signed by an auto-signing service.  A valid signature
means only that it has been received at the address corresponding to the
signature and forwarded.]

-----BEGIN PGP SIGNATURE-----
Version: 2.6.2
Comment: Gratis auto-signing service

iQBFAwUBLxVwgSoZzwIn1bdtAQF0vwGAuLRLR9PVcj9Q8NCqNDvRf4bC5zUA4A/U
m/9tT74hoQNEBNEzw1TqZTr0ZxHtciwd
=uXUO
-----END PGP SIGNATURE-----

{% endraw %}
```

## Thread

+ Return to [January 1995](/archive/1995/01)

+ Return to "["James A. Donald" <jamesd@netcom.com>](/authors/james_a_donald_jamesd_at_netcom_com_)"
+ Return to "["L. McCarthy" <lmccarth@thor.cs.umass.edu>](/authors/l_mccarthy_lmccarth_at_thor_cs_umass_edu_)"

+ 1995-01-12 (Thu, 12 Jan 95 10:05:39 PST) - Re: Purpose of Data Havens - _"L. McCarthy"<EMAIL_ADDRESS>  + 1995-01-13 (Thu, 12 Jan 95 22:02:15 PST) - [Re: Purpose of Data Havens](/archive/1995/01/eeb473b6e73223e53f748b3978b118414e319927ffa19faee644789d40e3d4bf) - _"James A. Donald"<EMAIL_ADDRESS>


text:
---
title: "Multiplayer Treasure Grove"
date: 2019-01-10T21:05:37.544Z
translationKey: "multiplayer-treasure-grove"
slug: "multiplayer-treasure-grove"
order: 36
tags:
  - javascript challenge
  - multiplayer
---

> Combat in this multiplayer coin-gathering arena.

https://codecombat.com/play/level/multiplayer-treasure-grove

Solution

```javascript

//This code win position #25 of 28931 in Read Team
// min stuff is:
//  - fast shoes with move method
//  - anny glass with findItems method (ex. wood glass)
// but good is get Ring of Speed + max health in other stuff

//find coin of value sorted by distance to hero
function findGold(number) {
    var items = hero.findItems();
    var near = 9999;
    var nearIndex = 0;

    for (var i = 0; i < items.length; ++i) {
        if (items[i].value == number) {
            if (near > hero.distanceTo(items[i])) {
                near = hero.distanceTo(items[i]);
                nearIndex = i;
            }
        }
    }

    return items[nearIndex];

}

//return one better money
function getBetterGold() {
    var gold3 = findGold(3);
    var gold2 = findGold(2);
    var gold1 = findGold(1);

    var cost3 = calculateCost(gold3);
    var cost2 = calculateCost(gold2);
    var cost1 = calculateCost(gold1);

    if (cost3 <= cost2 && cost3 <= cost1)
        return gold3;

    if (cost2 <= cost3 && cost2 <= cost1)
        return gold2;

    if (cost1 <= cost3 && cost1 <= cost2)
        return gold1;
}

//calculate cost to move to coint, so value and distace to coin
function calculateCost(coin) {
    var cost = 9999;
    if (coin)
        cost = hero.distanceTo(coin) / coin.value;
    return cost;
}

while (true) {
    // love an peace and collect money only, no attack other players
    var gold = getBetterGold();
    if (gold) {
        if (hero.isReady("jump")) {
            hero.jumpTo({
                'x': gold.pos.x,
                'y': gold.pos.y
            });
        }
        else {
            hero.move(gold.pos);
        }
    }

}

```

repository: LukaszSarzynski/static-site-go

repo_name: LukaszSarzynski/static-site-go


text:
# Install - lab.okd.example.com

< Prerequisite: [Install Centos 8.3](00_install_centos.md)

* * *

Typically this is a one time installation. Not to much automation here, just follow step by step and __copy&paste__.

## Clone `okd-lab`

Clone this project to your home desktop user directory where you start your journey.

```bash
[home@home]

cd ~/
git clone https://github.com/disposab1e/okd-lab.git

```

## Prepare guide (optional)

To follow the __copy&paste__ style of this guide it can  be useful to set the IP address of your host to some commands. Just use your favorite tool and replace `YO.UR.I.P` in this `README.md` with your public IP address.

## SSH and user configuration

### Generate new SSH keys (or keep your existing)

Accept all settings and use NO passphrase.

```bash
[home@home]

ssh-keygen -f ~/.ssh/okd_lab_id_rsa

```

### Authorize public key

```bash
[home@home]

ssh-copy-id -i ~/.ssh/okd_lab_id_rsa.pub<EMAIL_ADDRESS>
```

### Configure SSH config

```bash
[home@home]

vi ~/.ssh/config

# Add to your existing file:

Host YO.UR.I.P
  HostName YO.UR.I.P
  IdentityFile ~/.ssh/okd_lab_id_rsa
  User lab

Host <IP_ADDRESS>
  HostName <IP_ADDRESS>
  ProxyJump YO.UR.I.P
  User root
  ForwardAgent yes

```

## Configurations and installations

### SSH to `lab`

```bash
[home@home]

ssh<EMAIL_ADDRESS>
```

### Sudo without password

```bash
[lab@lab]

sudo visudo

Add line:

lab ALL=(ALL) NOPASSWD:ALL

```

### Restrict sshd to only allow PubkeyAuthentication for users (not root!)

```bash
[lab@lab]

sudo sed -i "s/#PermitRootLogin yes/PermitRootLogin no/g" /etc/ssh/sshd_config
sudo sed -i "s/#PubkeyAuthentication yes/PubkeyAuthentication yes/g" /etc/ssh/sshd_config
sudo sed -i "s/PasswordAuthentication yes/PasswordAuthentication no/g" /etc/ssh/sshd_config
sudo sed -i "s/GSSAPIAuthentication yes/GSSAPIAuthentication no/g" /etc/ssh/sshd_config
sudo systemctl restart sshd

```

### Change password for user lab

```bash
[lab@lab]

sudo passwd lab

choose: lab

```

### Change password for user root

```bash
[lab@lab]

sudo passwd root

choose: root

```

### Install GNOME Desktop, update all and reboot

```bash
[lab@lab]

sudo yum -y group install "Server with GUI"
sudo yum -y update
sudo reboot -h now

```

### Back to `lab`

```bash
[home@home]

ssh<EMAIL_ADDRESS>
```

### Install VNC client an and server

```bash
[lab@lab]

sudo yum -y install tigervnc tigervnc-server

```

### Prepare VNC service for lab user

```bash
[lab@lab]

sudo bash -c 'cat << EOF > /etc/tigervnc/vncserver.users
:1=lab
EOF'

sudo bash -c 'cat << EOF > /etc/tigervnc/vncserver-config-defaults
session=gnome
alwaysshared
localhost
geometry=1920x1200
EOF'

```

### Set VNC password

```bash
[lab@lab]

vncpasswd

choose: vnclab

Say "no" at the end

```

### Start and enable VNC server

```bash
[lab@lab]

sudo systemctl enable --now vncserver@:1

```

### Default login via GNOME Desktop

```bash
[lab@lab]

sudo ln -sf /lib/systemd/system/runlevel3.target /etc/systemd/system/default.target

```

### Disable unused services

```bash
[lab@lab]

sudo systemctl stop cups
sudo systemctl disable cups
sudo systemctl mask cups

sudo systemctl stop rpcbind
sudo systemctl disable rpcbind
sudo systemctl mask rpcbind
sudo systemctl stop rpcbind.socket
sudo systemctl disable rpcbind.socket
sudo systemctl mask rpcbind.socket

sudo systemctl stop avahi-daemon
sudo systemctl disable avahi-daemon
sudo systemctl mask avahi-daemon

sudo systemctl stop ModemManager
sudo systemctl disable ModemManager
sudo systemctl mask ModemManager

sudo systemctl disable bluetooth
sudo systemctl mask bluetooth

sudo systemctl stop geoclue
sudo systemctl disable geoclue
sudo systemctl mask geoclue

sudo systemctl stop mcelog
sudo systemctl disable mcelog
sudo systemctl mask mcelog

sudo systemctl stop kdump
sudo systemctl disable kdump
sudo systemctl mask kdump

```

### Remove dhcpv6-client from firewall

```bash
[lab@lab]

sudo firewall-cmd --permanent --zone=public --remove-service=dhcpv6-client
sudo firewall-cmd --reload
sudo firewall-cmd --zone=public --list-all

```

### Install and configure Cockpit

```bash
[lab@lab]

sudo yum -y install cockpit cockpit-dashboard cockpit-machines cockpit-networkmanager cockpit-packagekit cockpit-storaged

sudo systemctl enable cockpit.socket

sudo mkdir /etc/systemd/system/cockpit.socket.d

sudo bash -c 'cat << EOF > /etc/systemd/system/cockpit.socket.d/listen.conf
[Socket]
ListenStream=
ListenStream=<IP_ADDRESS>:9090
EOF'

sudo systemctl daemon-reload
sudo systemctl restart cockpit.socket

```

### Disable cockpit in firewall

```bash
[lab@lab]

sudo firewall-cmd --permanent --zone=public --remove-service=cockpit
sudo firewall-cmd --reload
sudo firewall-cmd --zone=public --list-all

```

### Install nmap

```bash
[lab@lab]

sudo yum -y install nmap

```

### Install Virtualization Clients

```bash
[lab@lab]

sudo yum -y install @virtualization-client

```

### Add `lab` user to group `libvirt`

```bash
[lab@lab]

sudo usermod -aG libvirt lab
newgrp libvirt

```

### Install Ansible and Git

```bash
[lab@lab]

sudo yum -y install epel-release

sudo yum -y install ansible git git-lfs

```

### Final checks

```bash
[lab@lab]

sudo lsof -n -i TCP| fgrep LISTEN
nmap -sT YO.UR.I.P
sudo nmap -sU YO.UR.I.P

```

## Finally :-)

```bash
[lab@lab]

sudo reboot -h now

```

## Open your VNC tunnel and connect with your VNC client

```bash
[home@home]

ssh -C -L <IP_ADDRESS>:5901:localhost:5901 -N<EMAIL_ADDRESS>
```

## Setup GNOME Desktop

- System Tools Settings: Power - Never Blank Screen
- System Tools Settings: Privacy - Screen Lock - Off

* * *

Next > [Provision infrastructure](02_provision_infrastructure.md)

repository: eformat/okd-lab

repo_name: eformat/okd-lab


text:
# Empire Ears Legend X
See [usage instructions](https://github.com/jaakkopasanen/AutoEq#usage) for more options and info.

### Parametric EQs
In case of using parametric equalizer, apply preamp of **-6.5dB** and build filters manually
with these parameters. The first 5 filters can be used independently.
When using independent subset of filters, apply preamp of **-4.7dB**.

| Type    | Fc       |    Q | Gain     |
|:--------|:---------|:-----|:---------|
| Peaking | 22 Hz    | 0.24 | -7.7 dB  |
| Peaking | 152 Hz   | 0.64 | -3.9 dB  |
| Peaking | 772 Hz   | 3.18 | 2.7 dB   |
| Peaking | 8736 Hz  | 0.37 | 13.1 dB  |
| Peaking | 16753 Hz | 0.55 | -31.6 dB |
| Peaking | 1818 Hz  | 1.08 | -8.4 dB  |
| Peaking | 2400 Hz  | 0.46 | 5.4 dB   |
| Peaking | 8307 Hz  | 2.16 | -5.1 dB  |
| Peaking | 12460 Hz | 2.59 | 7.6 dB   |
| Peaking | 14579 Hz | 3.04 | -7.2 dB  |

### Fixed Band EQs
In case of using fixed band (also called graphic) equalizer, apply preamp of **-7.8dB**
(if available) and set gains manually with these parameters.

| Type    | Fc       |    Q | Gain     |
|:--------|:---------|:-----|:---------|
| Peaking | 31 Hz    | 1.41 | -8.3 dB  |
| Peaking | 62 Hz    | 1.41 | -4.9 dB  |
| Peaking | 125 Hz   | 1.41 | -5.3 dB  |
| Peaking | 250 Hz   | 1.41 | -3.3 dB  |
| Peaking | 500 Hz   | 1.41 | 0.9 dB   |
| Peaking | 1000 Hz  | 1.41 | 1.7 dB   |
| Peaking | 2000 Hz  | 1.41 | -2.3 dB  |
| Peaking | 4000 Hz  | 1.41 | 7.8 dB   |
| Peaking | 8000 Hz  | 1.41 | 5.8 dB   |
| Peaking | 16000 Hz | 1.41 | -28.9 dB |

### Graphs
![](https://raw.githubusercontent.com/jaakkopasanen/AutoEq/master/results/crinacle/harman_in-ear_2017-1/Empire%20Ears%20Legend%20X/Empire%20Ears%20Legend%20X.png)

path: /results/crinacle/harman_in-ear_2017-1/Empire Ears Legend X/README.md


text:
# Version Minecraft worlds with Git

I was somewhat annoyed that to back up my Minecraft world, I have to store a
full copy of it, even if it changed just a little. If we are so good at
versioning code why, can't we version Minecraft worlds?

This quick and somewhat dirty script converts Minecraft worlds into a textual
representation that can be checked into a git repository. This works because
both traditional and delta compression is aplied to objects in Git. However, as
of now, there is no way to decode such a file into a Minecraft world.

Todo:
* Minimize the disk usage by not keeping around the whole working tree
* Decoding
* Experiment with binary formats


text:
# eslint-plugin-shopify

[![NPM version][npm-image]][npm-url]

Shopify’s ESLint rules and configs.

## Installation

You'll first need to install [ESLint](http://eslint.org):

```
$ npm i eslint --save-dev
```

Next, install `eslint-plugin-shopify`:

```
$ npm install eslint-plugin-shopify --save-dev
```

**Note:** If you installed ESLint globally (using the `-g` flag) then you must also install `eslint-plugin-shopify` globally.

## Usage

Shopify’s ESLint configs come bundled in this package. In order to use them, you simply extend the relevant configuration in your project’s `.eslintrc`. For example, the following will extend the ESNext (ES2015 and later) config:

```json
{
  "extends": "plugin:shopify/esnext"
}
```

If using React, extend the React version of the configuration (which adds some React-specific rules to those in the ESNext config):

```json
{
  "extends": "plugin:shopify/react"
}
```

If working on an ES5 project, extend the ES5 version of the configuration:

```json
{
  "extends": "plugin:shopify/es5"
}
```

You can also add some "augmenting" configs on top of the "core" config by extending an array of linting configs. For example, this package provides a lodash linting config, which can be added to the ESNext config with the following configuration file:

```json
{
  "extends": [
    "plugin:shopify/esnext",
    "plugin:shopify/lodash"
  ]
}
```

This plugin provides the following core configurations:

- [esnext](lib/config/esnext.js): Use this for anything written with ES2015+ features.
- [react](lib/config/react.js): Use this for React projects.
- [es5](lib/config/es5.js): Use this for legacy projects.

This plugin also provides the following tool-specific configurations, which can be used on top of the core configurations:

- [lodash](lib/config/lodash.js): Use this for projects that use lodash.

## Plugin-Provided Rules

This plugin provides the following custom rules, which are included as appropriate in all core linting configs:

- [binary-assignment-parens](docs/rules/binary-assignment-parens.md): Requires (or disallows) assignments of binary, boolean-producing expressions to be wrapped in parentheses.
- [class-property-semi](docs/rules/class-property-semi.md): Requires (or disallows) semicolons for class properties.
- [jquery-dollar-sign-reference](docs/rules/jquery-dollar-sign-reference.md): Requires that all jQuery objects are assigned to references prefixed with `$`.
- [no-useless-computed-properties](docs/rules/no-useless-computed-properties.md): Prevents the usage of unnecessary computed properties.
- [prefer-early-return](docs/rules/prefer-early-return.md): Prefer early returns over full-body conditional wrapping in function declarations.
- [require-flow](docs/rules/require-flow.md): Requires (or disallows) @flow declarations be present at the top of each file.
- [restrict-full-import](docs/rules/restrict-full-import.md): Prevents importing the entirety of a package.
- [sinon-no-restricted-features](docs/rules/sinon-no-restricted-features.md): Restricts the use of specified sinon features.
- [sinon-prefer-meaningful-assertions](docs/rules/sinon-prefer-meaningful-assertions.md): Requires the use of meaningful sinon assertions through sinon.assert or sinon-chai.

## Creating New Rules

The easiest way to add new rules is to use the [ESLint Yeoman generator](https://www.npmjs.com/package/generator-eslint). Running `yo eslint:rule` from the root of this project should add the required main file, docs, and test for your new rules. Make sure that these are all filled out and consistent with the other rules before merging. All tests can be run using `npm test`.

[npm-url]: https://npmjs.org/package/eslint-plugin-shopify
[npm-image]: http://img.shields.io/npm/v/eslint-plugin-shopify.svg?style=flat-square

repository: ihsw/javascript

repo_name: ihsw/javascript


text:
# BTGBehaviorTreeGrapher

Generates a PDF graph of the behavior tree that the AI units in BTG use.

Usage:
* Decompile the `BehaviorTree.InitRootFunction` in AssemblyCSharp.dll
* Decompile each listed tree. Copy the instructions inside the `InitRootNode` method of the behavior tree into a file.
* Run this utility against the file: `main.py -i <INPUT_FILE>`
* Run blockdiag.com/en/index.html against the output diag file: `blockdiag -Tpdf <INPUT_FILE>.diag`

repository: IceRaptor/BTGBehaviorTreeGrapher

repo_name: IceRaptor/BTGBehaviorTreeGrapher