text:
# glad-ext
External shellcode library that uses naked function wrappers to generate a callable function sub, tested to compile and run on x86 msvc

**Aka, a really really easy way to call functions externally**

(currently only supports x86 architecture and cdecl and stdcall calling conventions)

Incredibly simple to use (currently void return stubs aren't supported, pass as int):

```c
auto roblox = std::make_unique<xg_process>(L"RobloxPlayerBeta.exe");
auto spawn = roblox->create_sub<int>(roblox->format(0x72b6e0));
spawn(state);
```

Example with retcheck:

```c
auto roblox = std::make_unique<xg_process>(L"RobloxPlayerBeta.exe");
auto newthread = roblox->create_sub<uintptr_t>(roblox->copy_fn(roblox->format(0x11f1470)));
const auto state = newthread(global);
```

Breakdown:

```c
xg_process(const TCHAR*);
```
Constructor of xg_process accepts the name of the process to be loaded **xg_process needs to be an xg_process pointer (xg_process*) or function calling won't work**

```c
uintptr_t xg_process->format(const uintptr_t) const;
```
Rebases an address to the selected processes module base (assuming ida base is at 0x400000, custom base on todo list)

```c
uintptr_t xg_process->copy_fn(uintptr_t);
```
Copies a function from the external process to a newly allocated section of memory and removes Roblox's return check

```c
template<class RetType>
g_func<RetType> xg_process->create_sub<RetType>(uintptr_t);
```
Creates a simple wrapper class that overloads operator () to be able to call external functions with ease

```c
g_func<RetType>(args);
```
Dynamically creates shellcode based on the number of args, and argument types.
**Currently only supports bool, uintptr_t, const char*, and int**

To reiterate,

**Only argument types bool, uintptr_t, const char*, and int are currently supported for function calling**

**xg_process must be a xg_process***

**Currently only supports __cdecl and __stdcall calling conventions**

Deserialize example:
```c
auto roblox = std::make_unique<xg_process>(L"RobloxPlayerBeta.exe");

auto newthread = roblox->create_sub<uintptr_t>(roblox->copy_fn(roblox->format(0x11f1470)));

auto spawn = roblox->create_sub<int>(roblox->format(0x72b6e0));

auto deserialize_helper = roblox->create_sub<bool>(roblox->format(0x11fc1f0));

bool deserialize(const uintptr_t rl, const char* chunkname, const char* bytecode, const size_t sz)
{
	const auto bytecode_alloc = roblox->alloc_string(bytecode, sz); // needed because currently doesn't accept const char* with non strlen size
	return deserialize_helper(rl, chunkname, reinterpret_cast<uintptr_t>(bytecode_alloc), sz);
}

int main()
{
	const auto script_context = roblox->sig_scan("\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xC8\x15\x00\x00", "xxxxxxxxxxxxxxxx") - 0x10;
	const auto state = script_context + 164 + 56 * 0 - roblox->read<uintptr_t>(script_context + 164 + 56 * 0);
	const auto new_thread = newthread(state);
	deserialize(new_thread, "test123", bytecode, bytecode_size);
	spawn(new_thread);
	return 1;
}
```


text:
# Releasenotes Threefold chain v1.0.6

If you apply this update directly from release v1.0.5,
than please also take into account the changes that were already released with the patched version of v1.0.5.

You can find the release notes for `v1.0.5-patch` at: [/doc/release_notes/v1.0.5_patch.md](/doc/release_notes/v1.0.5_patch.md).

## Summary

- Fix rendering bugs in web explorer of coin- and blockstake outputs;
- Support MultiSignature conditions and fulfillments in the web explorer;
- Add average block creation time (as a red line) to the relevant graph in the web explorer;
- Multisig conditions/fulfillments are now supported. The Atomic Swap CLI commands have been aligned with the decred/atomic swap tools. The UX of these have been greatly improved as well and all known bugs for these commands have been fixed as well;
  - More in-depth information about this can be found at <https://github.com/threefoldtech/rivine/blob/master/doc/release_notes/v1.0.6.md>;
  - Please note that the multisig feature won't be available on the standard network until the blockchain reached a height of `42 000` blocks;

repository: threefoldfoundation/tfchain

branch_name: refs/heads/master

extension: md

gha_language: Go

license_type: permissive

repo_name: threefoldfoundation/tfchain


text:
# BloodCross for Android 🎁 :hospital: :ambulance: :family: :heart:

App puts the power to save lives in the palm of your hand. Find nearby Red Cross blood drives, schedule appointments, earn rewards from premier retailers, follow your blood’s journey from donation through delivery (when possible), and create or join a lifesaving team and track its impact on a national leaderboard.

Upcoming Features:
------------------

 The current roadmap can be viewed on [Trello](https://trello.com/b/DwLCfv7g/space-launchCategory-now).

-  Convenient, easy appointment scheduling and rescheduling
-  Receive appointment reminders
-  View donation history to see how many lives you’ve helped save
-  Get geo-targeted blood shortage alerts let you know if your blood type is needed in your area
-  Take a selfie of your heroic donation and share with friends and family using one of a variety of filters
-  Claim rewards from participating retailers for your donation efforts
-  Track your blood via Blood Journey and get notified when your blood has reached a hospital (when available)
-  Join or create a lifesaving team based around your favorite organization (school, business, sports team, etc.) or create your own, recruit others and view rankings on a national scoreboard
-  Earn unique badges to proudly share your achievements via social media, text, or email whether you’re a first-timer or a gallon donor

What's New:
----------

## Build Instructions

- Clone the project from GitHub:
   ```
   git clone https://github.com/BloodCross/bloodCross-android.git
   ```
   or download the .zip [here](https://codeload.github.com/BloodCross/bloodCross-android/zip/master).

- Import the project in Android Studio: **File > New > Import Project**.
  Alternatively, from the Welcome screen, select **Import project**.

Read more about contributing to BloodCross [here]().

## Join Beta Testing
Join our [Community on Google+](), then [click here]().

# BloodCross is in need of a new lead developer for BloodCross for Android! If you are interested let me know!

license: MIT

repository: BloodCross/bloodCross-android

repo_name: BloodCross/bloodCross-android


text:
# Monitoring Assignment Discovery (MADS) v1 API

Date: 2021-02-24

## Context

Currently, the [MADS v1alpha1 API](../../api/observability/v1alpha1/mads.proto) defines an xDS API for discovering
services to scrape metrics from (aka Monitoring Assignments).

As part of our native integration with Prometheus (see [prometheus#7919](https://github.com/prometheus/prometheus/issues/7919)),
we will need to expose this API externally.

### Current Notes
* This API is used internally in `kuma-prometheus-sd` to fetch these targets and write a `file_sd` JSON file, which
  is run as a sidecar in Prometheus
  * This is hard for users to configure and is not so much fun to maintain (see the vendored dependency on Prometheus)
* The API uses xDS v2 (deprecated)
* The API provides little guidance on which fields should be provided
  * Filling in the bare minimum of the v1alpha1 could produce invalid `Targets` (i.e. no `__address__` or `instance` label)

### What we don't need to solve

* Authorizing/ Authentication of this API
  * Should already be authorized by Kuma itself, if Prometheus is in the mesh :slightly_smiling_face:

### What we do need to solve

* Defining a stable API that can be mapped to Prometheus `Targets` and, potentially, could be implemented by others
  looking for a "generic" SD.

### Alternatives considered

* There are some interesting discussions happening in the CNCF OpenTelemetry project, which defines standards for telemetry data/ systems
    around whether Service Discovery + scrape targets are within their scope
  * It's looking like they are (see [open-telemetry/opentelemetry-specification#1078](https://github.com/open-telemetry/opentelemetry-specification/issues/1078#issuecomment-780737017)),
    though likely not for some time. If they do ( :crossed_fingers: ), I think we should move to implementing their standard
    and advocate for the same in Prometheus.

## Proposed API

### Design Goals
* Make it clear which fields should be provided
* Make fields explicit, move away from the generic Prometheus labels
  * This will make the SD implementation on the Prometheus-side much more clear
  * Currently, there is implicit implementation details shared between the MADS client and server
  * We cannot have this if we are going to expose this API upstream
* Keep the xDS discovery mechanism, but upgrade it to the latest version v3
* Fully support both xDS transport variants (HTTP + gRPC)
* Keep the ability to provide groups of `Targets` with common labels, but map 1-1 to Dataplanes
  * Currently, `MonitoringAssignments` map 1-1 to Dataplanes, which makes some fields duplicative
* Keep the flexibility to provide arbitrary labels

### proto

```protobuf
syntax = "proto3";

package kuma.observability.v1;

option go_package = "v1";

import "envoy/service/discovery/v3/discovery.proto";
import "google/api/annotations.proto";
import "validate/validate.proto";

// Monitoring Assignment Discovery Service (MADS).
//
// xDS API that is meant for consumption by monitoring systems, e.g. Prometheus.
service MonitoringAssignmentDiscoveryService {
  // GRPC
  rpc DeltaMonitoringAssignments(stream envoy.service.discovery.v3.DeltaDiscoveryRequest)
          returns (stream envoy.service.discovery.v3.DeltaDiscoveryResponse) {}
  rpc StreamMonitoringAssignments(stream envoy.service.discovery.v3.DiscoveryRequest)
          returns (stream envoy.service.discovery.v3.DiscoveryResponse) {}
  // HTTP
  rpc FetchMonitoringAssignments(envoy.service.discovery.v3.DiscoveryRequest)
          returns (envoy.service.discovery.v3.DiscoveryResponse) {
    option (google.api.http).post = "/v3/discovery:monitoringassignment";
    option (google.api.http).body = "*";
  }
}

// MADS resource type.
//
// Describes a group of targets on a single service that need to be monitored.
message MonitoringAssignment {
  // Mesh of the dataplane.
  //
  // E.g., `default`
  string mesh = 2 [ (validate.rules).string = {min_bytes : 1} ];

  // Identifying service being monitored.
  //
  // E.g., `backend`
  string service = 3 [ (validate.rules).string = {min_bytes : 1} ];

  // List of targets that need to be monitored.
  repeated Target targets = 4;

  // Describes a single target that needs to be monitored.
  message Target {
    // Dataplane name.
    //
    // E.g., `backend-01`
    string name = 1 [ (validate.rules).string = {min_bytes : 1} ];

    // Scheme on which to scrape the target.
    //E.g., `http`
    string scheme = 2 [ (validate.rules).string = {min_bytes : 1} ];

    // Address (preferably IP) for the service
    // E.g., `backend.svc` or `<IP_ADDRESS>:9090`
    string address = 3 [ (validate.rules).string = {min_bytes : 1} ];

    // Optional path to append to the address for scraping
    //E.g., `/metrics`
    string metrics_path = 4;

    // Arbitrary labels associated with that particular target.
    //
    // E.g.,
    // `{
    //    "commit_hash" : "620506a88",
    //  }`.
    map<string, string> labels = 5;
  }

  // Arbitrary Labels associated with every target in the assignment.
  //
  // E.g., `{"team": "infra"}`.
  map<string, string> labels = 5;
}
```

repository: kumahq/kuma

repo_name: kumahq/kuma


text:
# dockME LiTe - Simplified tool for Robust Researchers
[![DOI](https://zenodo.org/badge/390092382.svg)](https://zenodo.org/badge/latestdoi/390092382)

dockME Lite is a Python-based biotech software for dealing with multiple autodock macromolecules and ligands files to be used at Autodock systems.

### CITE THIS SOFTWARE

COSTA, R.B.G.M., & Xavier-Júnior, F.H. (2020, May 25). dockME LITE: An  Automated Open-Source Solution for Molecular Docking Scientists (Version v1.0.5-alpha). Zenodo. http://doi.org/10.5281/zenodo.5140346

## Installation

#### On Windows:

Using [Autodock VINA](http://vina.scripps.edu/):

1- Copy the entire folder content to the same path of where Autodock Vina has been installed/extracted (or just bring VINA executable files to the same path)

2- copy 'dockme-lite.exe' from the 'dist' directory bringing to the root directory

3- RUN 'dockme-lite.exe'.

#### On LINUX:

1-Copy the entire folder content to the same path of where Autodock Vina has been installed/extracted (or just bring VINA executable files to the same path).

( NOTE:You must install Python 3.8 or later in order to run this package.)

Having VINA at the same directory, just run:

```bash
python dockme-lite.py
```

## Usage

####  BEFORE USING

Before start to use this program, we strongly recommend to organise all your macromolecules and ligands in the following way:

Create two spreadsheet somewhere (or just a simple table/chart using pen and paper) - one for ligands, and other for macromolecules - listing all your .pdbqt files ordered in a sequence starting from zero.

##### Why?
This will help you to don't get lost if there is any corrupted data along the process due to any error caused during the running program.

E.G.

MACROMOLECULES:

0 - Protein 1

1 - Protein 2

2 - Protein 3

... and so on

###### After organise the table, rename the files to the corresponding number in your table. For example, Protein 1 should be renamed to 0.pdbqt, and should be sent to the '/macromolecules' directory.

###### The following STEP is to organise all the config files at the root folder. You may find the 'standard.txt' file useful to do so! You just have to put all the grid parameters known from your pre-docking working and rename it as 'macromoleculenumber_ligandnumber.txt' file.
###### E.G.: Suppose that our macromolecule order in our organised chart is '3' and the ligand is at the 2nd position (which means '1', because we start from zero), then, our parameter file should be named as 3_1.txt . That's it. No rocket science in here! :D

#### USING THE SOFTWARE

There are two (2) simple options. The first one makes interactions with all the macromolecules and ligands, while the second one is indicated to make single interactions between a specified ligand and a specified macromolecule.

Therefore, in order to do this, you should previously have created the configuration files to run this code.

#### THE NEXT INFORMATION IS VERY IMPORTANT!!

FILES MUST BE NAMED BY THE FOLLOWING ORDER:
macromolecule_ligand.txt (e.g. Let's say that you have organised your table of ligands and your macromolecule number in this list is the 3rd one, while the second one, related to the ligand list, is the 1st one, then, the file should be named as:  "3_1.txt").

```

## 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
[Apache](http://www.apache.org/licenses/LICENSE-2.0.txt)

repository: remullo/dockMe-LiTe-alpha

repo_name: remullo/dockMe-LiTe-alpha


text:
---
title: Information Visualization
layout: project
update: '2018-08-02'
author: Leonardo Souza Silva
img-thumb: img/research_dataviz.png
header-img: img/projects/emotion-representation/sad-smile.jpg
credit-img-author: Sydney Sims
credit-img-url: https://unsplash.com/photos/fZ2hMpHIrbI?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
---

Information Visualization has become an important study field due to a large amount of available data and the lack of flexible and adequate interfaces to explore them. Both the human mind and the power offered by new technology challenges us to great advances to propose new ways of representing abstract data, improving their exploration and comprehension.

  The use of computer-supported, interactive, visual representation of abstract data to amplify cognition (CARD et al, 1999)

gha_language: HTML

gha_license_id: MIT


text:
---
subject: Administrative Law
course: LLB
university: PU
title: 'Nature, Scope and Source of Administrative Law'
---
## Administrative Law
### Definition and Nature
Administrative law is the law relating public administration. It is concerned with the legal forms and constitutional status of public authorities; with their powers and duties and with the procedures followed in exercising them; with their legal relationships with one another, with the public and with their employees; which seek, in varied ways, to control their activities.

A first approximation to a definition of Administrative law is to say that “it is the law relating to the control of government power”

Wade asserts “the primary purpose of Administrative law therefore is to keep the powers of government within their legal bounds, so as to protect the citizen against their abuse. The powerful engines of authority must be prevented from running ‘amok’.” Important to note is that the whole essence of Administrative law is to advocate for or uphold natural justice most especially for public servants or any other person appearing before an administrative tribunal.

The legal regulation of governmental power (Admin law) is to be distinguished from the political control of governmental power (constitutional law). Keith observed:

“It is logically impossible to distinguish administrative from constitutional law and all attempts to do so are artificial”.

However, according to Holland, “Constitutional law describes the various organs of the government at rest, while administrative law describes them in motion” Therefore, according to this view, the structure of the legislature and executive comes within the purview of the constitutional law but there functioning comes within the sphere of administrative law.

According to Jennings- administrative law deals with the organization, functions, powers and duties of administrative authorities while constitutional law deals with the general principles relating to the organization and powers of the various organs of the state and their mutual relationship of these organs with the individuals. In other words, constitutional law deals with fundamentals while administrative law deals with details.

Some differences have been highlighted below:
|S.No | Constitutional Law | Administrative Law|
|--|--|--|
|1|It is the supreme and highest law of the country. No law can be regarded above the law of constitution of Nepal.|It is not the supreme law of the country rather it is subordinate to the constitutional law.|
| 2. | The constructional law is always regarded as the genus. It is the main law. | Administrative law is the species of Constitution law. |
| 3. | This law mainly deals with various organs of a state. | It deals with the organs of the state as motion. |
| 4. | It mainly deals with the structure of the state. | It mainly deals with the various functions of the state. |
| 5. | It touches all the branches of law and gives guidelines with regard to the general principle relating to organization and powers of organs of the state, and their relations between citizens and towards the state. | It doesn't deal with all branches of law, rather it details with the powers and functions of administrative authorities.
| 6. | It also gives guidelines about the international relations. | It does not deal with the international law. It deals exclusively with the powers and functions of administrative authorities. |
| 7. | It deals with the general principal of state pertaining to all branches. | It deals with the powers and functions of administrative authorities, including services, public departments, local authorities and other statutory bodies exercising administrative powers, quasi judicial powers, etc. |
| 8. | Constitutional Law demarcates the constitutional status of Ministers and public servants. | It is concerned with the organization of the services or the working of the various government departments.
| 9. | It imposes certain negative duties on administrators, if they are found violating the fundamental rights of the citizens and etc. It also imposes certain positive duties on administrators, viz, implementation of social welfare schemes. | The administrators have to follow constitutional law first and next the administrative law.
| 10. | The constitutional laws have complete control on the administrative law and administrators of the country. | The administrators should perform their functions with utmost obedience to constitutional law. Administrative law is just a subordinate to constitutional law.

## Basic Doctrines of Administrative Law:

1. Judicial Review
2. Separation of Power
3. Accountability
4. Check and Balance
5. Constitutional Supremacy/ Rule of Law
6. Doctrine of Legitimate Expectation
7. Fairness/Natural Justice
8. Good Governance

## Scope of Administrative Law:

Administrative Law is a public Law and involves public bodies. Regulation of the exercise of power conferred upon public bodies- (Purely) administrative, (delegated) legislative and quasi-judicial actions of the administrative agencies is scope of administrative law.

## Sources of Administrative Law:

Basically sources can be studied under mandatory and persuasive sources as follows:

a. Mandatory Sources:
    - Constitution
    - Acts/ Statutes
	- Ordinance
	- Precedent
	- Delegated Legislations
	- Administrative Practices

b. Persuasive Sources:
	- Opinion of Expert
	- Treaties
	- Agreement
	- Declarations
	- Commitment
	- Reports
	- Legal Maxims

repository: PortaltoNepal/eduPTN

repo_name: PortaltoNepal/eduPTN


text:
## Cubis Core hard fork to v1.0.1
Shell script to upgrade a Cubis Masternode V1.0.1 on a Linux server running Ubuntu 16.04. Use it at your own risk.

***
### MN upgrade:
After you setup the VPS at your chosen provider, you will need to login as root to the server and execute the following commands. You can copy and paste the commands into the command line. For instructions for using SSH to login to your server, please see your hosting provider's documentation.

Using this script for x86_64-linux VPS:
```
wget -q https://raw.githubusercontent.com/altcuim/Cubiscoin/master/Cubis-hardfork-v1.0.1.sh
bash Cubis-hardfork-v1.0.1.sh
```

repository: cryptoghass/Cubiscoin

repo_name: cryptoghass/Cubiscoin


text:
# `connections`

This package handles everything that has todo with connections. It has classes to perform connection related actions aswell as to listen for connection connection events.

> **ATTENTION**: Relative to the ACA-Py Swagger API, this package handles everything related to the `/connections` endpoint. Thus it also handles TrustPing and BasicMessage functionality. The groups shown in the Swagger Web Interface can be misleading.

## Usage

### ConnectionEventHandler

In order to react to incoming connection events, we need to setup out event handler. This package exposes an _abstract_ class `ConnectionEventHandler` that you can extend to implement this behavior. The Aries Cloudagent-Py emits an event whenever there is a change to the state of an agent's connection record. Therefore there is a callback method for every connection state possible. These are: `init`, `invitation`, `request`, `response`, `active`, `inactive` and `error`.

There is also a callback method for incoming basic message events.
3

```typescript
import {
  ConnectionEventHandler,
  ConnectionEvent
  BasicMessageEvent
  } from '@ula-aca/connection'

class ConnectionHandler extends ConnectionEventHandler {

  async onInit(message: ConnectionEvent): Promise<void> {
    // connection record state changed to 'init'

    this.eventHandler.processMsg('example-message', () => {}) // use this.eventHandler to call the ULA ✉
  }
  async onInvitation(message: ConnectionEvent): Promise<void> {
    // connection record state changed to 'invitation'
  }
  async onRequest(message: ConnectionEvent): Promise<void> {
    // connection record state changed to 'request'
  }
  async onResponse(message: ConnectionEvent): Promise<void> {
    // connection record state changed to 'response'
  }
  async onActive(message: ConnectionEvent): Promise<void> {
    // connection record state changed to 'active'
  }
  async onError(message: ConnectionEvent): Promise<void> {
    // connection record state changed to 'error'
  }
  async onInactive(message: ConnectionEvent): Promise<void> {
    // connection record state changed to 'inactive'
  }
  async onBasicMessage(message: BasicMessageEvent): Promise<void> {
    // basic message received
  }
}

```

### ConnectionController

#### get-all-connections

properties:
returns

```typescript
await universal_ledger_agent.processMsg(
  { type: 'create-invitation' },
  (response: UlaResponse) => {
    const connection_id = response.body.connection_id
    const invitation = response.body.invitation
  }
)
```

repository: rabomarnix/ula-aca-plugins

repo_name: rabomarnix/ula-aca-plugins


text:
# Markov

[![Build status](https://github.com/jsageryd/markov/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/jsageryd/markov/actions/workflows/ci.yml)
[![Go Report Card](https://goreportcard.com/badge/github.com/jsageryd/markov)](https://goreportcard.com/report/github.com/jsageryd/markov)
[![License MIT](https://img.shields.io/badge/license-MIT-lightgrey.svg?style=flat)](https://github.com/jsageryd/markov/blob/master/LICENSE)

Markov chains with configurable order and random seed.

## Packages
- **[markov](markov)** generates string sequences
- **[fake](fake)** generates names

## Command-line tools
- **[cmd/markov](cmd/markov)**

repository: jsageryd/markov

repo_name: jsageryd/markov


text:
---eonx_docs---
title: Introduction
weight: 0
---eonx_docs---

This package allows you to create and configure [Monolog Loggers][2] in centralised and reusable way:

- Configure channels using PHP
- Control Handlers and Processors order
- Integration with popular frameworks (e.g. Laravel, Symfony)
- Discover Handlers and Processors automatically in your application

### Require package (Composer)

The recommended way to install this package is to use [Composer][1]:

```bash
$ composer require eonx-com/easy-logging
```

### Usage

Here is a simple example on how to use the `LoggerFactoryInterface` to create loggers:

```php
// Instantiate the logger factory manually or use DI ...

$default = $loggerFactory->create(); // Calling create without arguments will create logger for default channel

$console = $loggerFactory->create('console'); // Create logger for console channel specifically
```

### Usage in Framework

The different bridge provided by this package will by default register the logger for your default channel in the
service container under the following service ids:

- `Psr\Log\LoggerInterface`
- `logger`

You can then use dependency injection anywhere you like!

Thanks to [Autowiring via setters][3] in Symfony, you can use `\EonX\EasyLogging\Bridge\Symfony\Traits\LoggerAwareTrait`
to simplify the injection of `Psr\Log\LoggerInterface`.

### Logger Configuration

The `LoggerFactoryInterface` allows you to set different collections of "config providers", each config can define:

- **channels:** if defined the config will be applied only to given channels, if `null` the config will be applied
                to all channels
- **priority:** define the order each config must be set on the logger instance, higher the priority later the config
                will be added to the logger instance

###### HandlerConfig

The `HandlerConfigInterface` allows you to configure `\Monolog\Handler\HandlerInterface` to be set loggers created by
the factory. Like other configs, it allows you to specify a list of channels this handler is for and, also a priority
to control when the handler must be executed.

To tell the logger factory about your `HandlerConfigInterface`, you must use a `HandlerConfigProviderInterface`. The
logger factory accepts a collection of providers via the `setHandlerConfigProviders()` method:

```php
use EonX\EasyLogging\LoggerFactory;

$handlerConfigProviders = [];

// Add your own handler config providers to $handlerConfigProviders ...

$loggerFactory = new LoggerFactory();

// Set your handler config providers on the logger factory
$loggerFactory->setHandlerConfigProviders($handlerConfigProviders);
```

Here is a simple example of a `HandlerConfigProviderInterface` to register a `StreamHandler`:

```php
namespace App\Logger;

use EonX\EasyLogging\Config\HandlerConfig;
use EonX\EasyLogging\Interfaces\Config\HandlerConfigProviderInterface;
use Monolog\Handler\StreamHandler;

final class StreamHandlerConfigProvider implements HandlerConfigProviderInterface
{
    /**
     * @return iterable<\EonX\EasyLogging\Interfaces\Config\HandlerConfigInterface>
     */
    public function handlers(): iterable
    {
        /**
         * This method returns an iterable to make it easier to handle complex handler configs definition
         * But you can simply return an array if you want.
         */

        yield new HandlerConfig(new StreamHandler('php://stdout'));
    }
}
```

###### ProcessorConfig

The `ProcessorConfigInterface` allows you to configure `\Monolog\Processor\ProcessorInterface` to be set loggers created
by the factory. Like other configs, it allows you to specify a list of channels this handler is for and, also a priority
to control when the handler must be executed.

To tell the logger factory about your `ProcessorConfigInterface`, you must use a `ProcessorConfigProviderInterface`. The
logger factory accepts a collection of providers via the `setProcessorConfigProviders()` method:

```php
use EonX\EasyLogging\LoggerFactory;

$processorConfigProviders = [];

// Add your own processor config providers to $handlerConfigProviders ...

$loggerFactory = new LoggerFactory();

// Set your processor config providers on the logger factory
$loggerFactory->setProcessorConfigProviders($processorConfigProviders);
```

Here is a simple example of a `ProcessorConfigProviderInterface` to register a `TagProcessor`:

```php
namespace App\Logger;

use EonX\EasyLogging\Config\ProcessorConfig;
use EonX\EasyLogging\Interfaces\Config\ProcessorConfigProviderInterface;
use Monolog\Processor\TagProcessor;

final class TagProcessorConfigProvider implements ProcessorConfigProviderInterface
{
    /**
     * @return iterable<\EonX\EasyLogging\Interfaces\Config\ProcessorConfigInterface>
     */
    public function processors(): iterable
    {
        /**
         * This method returns an iterable to make it easier to handle complex processor configs definition
         * But you can simply return an array if you want.
         */

        yield new ProcessorConfig(new TagProcessor(['tag-1', 'tag-2']));
    }
}
```

###### LoggerConfigurator

The `\Monolog\Logger` class has methods allowing you to configure it even more (e.g. using microseconds). To deal with
that, the logger factory accepts a collection of `LoggerConfiguratorInterface`.

To tell the logger factory about your `LoggerConfiguratorInterface`, you must call the `setLoggerConfigurators()` method:

```php
use EonX\EasyLogging\LoggerFactory;

$loggerConfigurators = [];

// Add your own logger configurators to $loggerConfigurators ...

$loggerFactory = new LoggerFactory();

// Set your logger configurators on the logger factory
$loggerFactory->setLoggerConfigurators($loggerConfigurators);
```

Here is a simple example of a `LoggerConfiguratorInterface` to use microseconds:

```php
namespace App\Logger;

use EonX\EasyLogging\Config\AbstractLoggingConfig;
use EonX\EasyLogging\Interfaces\Config\LoggerConfiguratorInterface;
use Monolog\Logger;

final class UseMicrosecondsLoggerConfigurator extends AbstractLoggingConfig implements LoggerConfiguratorInterface
{
    public function configure(Logger $logger) : void
    {
        $logger->useMicrosecondTimestamps(true);
    }
}
```

[1]: https://getcomposer.org/
[2]: https://github.com/Seldaek/monolog
[3]: https://symfony.com/doc/current/service_container/autowiring.html#autowiring-calls

repository: eonx-com/easy-monorepo

gha_language: PHP

repo_name: eonx-com/easy-monorepo


text:
[![NPM Version][npm-image]][npm-url]
[![Build Status][travis-image]][travis-url]
[![Downloads][downloads-image]][downloads-url]
[![Greenkeeper badge](https://badges.greenkeeper.io/ctumolosus/jsdoc-babel.svg)](https://greenkeeper.io/)

# jsdoc-babel

A [JSDoc][jsdoc] plugin that transforms source files with [Babel][babel] before they are processed.

> JSDoc uses the Babylon JavaScript parser since [version 3.5.0](https://github.com/jsdoc3/jsdoc/releases/tag/3.5.0), which means that JSDoc can parse any JavaScript or JSX file that is supported by the Babel compiler. You may not need to use this plugin unless you need to preprocess unsupported syntax in your source code.

## Installation

The `jsdoc-babel` plugin can be installed using NPM.

```bash
npm install jsdoc-babel --save-dev
```

## Usage

To use plugin you should include the plugin module in the `plugins` array of
[JSDoc's configuration file](http://usejsdoc.org/about-configuring-jsdoc.html).

```json
{
    "plugins": ["node_modules/jsdoc-babel"]
}
```

### Processing files with different extensions

By default, the plugin only processes files that have a `.js` extension. You
could enable transformation for other file extensions by adding the following
settings to your JSDoc configuration file:

```json
{
    "plugins": ["node_modules/jsdoc-babel"],
    "babel": {
        "extensions": ["js", "es6", "jsx"]
    }
}
```

### Passing options through Babel

If Babel can resolve a `.babelrc` file in your project, it will be parsed as the
transformer options.

Alternatively, you can define [options](https://babeljs.io/docs/en/options)
to be passed through Babel by adding them to your JSDoc configuration file:

```json
{
    "plugins": ["node_modules/jsdoc-babel"],
    "babel": {
        "presets": ["@babel/env"]
    }
}
```

Note that options defined in the JSDoc configuration file will take precedence
over those defined in your `.babelrc` file.

If you would prefer to disable `.babelrc` file resolution, you can use the
[`babelrc`](https://babeljs.io/docs/en/options#babelrc) option:

```json
{
    "plugins": ["node_modules/jsdoc-babel"],
    "babel": {
        "presets": ["@babel/env"],
        "babelrc": false
    }
}
```

## License

MIT

[npm-image]: https://img.shields.io/npm/v/jsdoc-babel.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/jsdoc-babel
[travis-image]: https://img.shields.io/travis/ctumolosus/jsdoc-babel/master.svg?style=flat-square
[travis-url]: https://travis-ci.org/ctumolosus/jsdoc-babel
[downloads-image]: https://img.shields.io/npm/dm/jsdoc-babel.svg?style=flat-square
[downloads-url]: https://www.npmjs.com/package/jsdoc-babel
[jsdoc]: http://usejsdoc.org/
[babel]: https://babeljs.io/

repository: ctumolosus/jsdoc-babel

gha_language: JavaScript

repo_name: ctumolosus/jsdoc-babel


text:
# Badging API Explainer

Author: Matt Giuca<EMAIL_ADDRESS>
Date: 2018-06-26

## Overview

The **Badging API** is a proposed Web Platform API allowing web applications (as
defined by the [Web App Manifest](https://www.w3.org/TR/appmanifest/) standard)
to set an **application-wide** badge, shown in an operating-system-specific
place associated with the application (such as the shelf or home screen).

![Windows taskbar badge](images/uwp-badge.png)

Windows taskbar badge

![macOS dock badge](images/mac-badge.png)

macOS dock badge

![Android home screen badge](images/android-badge.png)

Android home screen badge

The purpose of this API is:

* To give the application a small but visible place to subtly notify the user
  that there is new activity that might require their attention, without showing
  a full [notification](https://notifications.spec.whatwg.org/).
* To indicate a small amount of additional information, such as an unread count
  or symbol indicating the type of event.
* To allow the application to convey this information regardless of whether any
  of the application's windows are open.

Non-goals are:

* To provide an arbitrary image badge.

Possible areas for expansion:

* Providing badging for sites in a normal web browsing context. The current
  proposal is just for installed apps (designed to show up in the operating
  system shelf area). We could also explore icon badging on the drive-by web.
  This naturally leads into...
* Provide per-window badging information. The current proposal is for a global
  badge for the application, not per-window or per-tab. See
  [#1](https://github.com/mgiuca/badging/issues/1).

Examples of sites that may use this API:

* Chat, email and social apps, to signal that new messages have arrived.
* Productivity apps, to signal that a long-running background task (such as
  rendering an image or video) has completed.
* Apps that want to render a small status indicator (e.g., a music app shows ▶
  or ⏸; a weather app shows ⛈ or ⛅).
* Games, to signal that a player action is required (e.g., in Chess, when it is
  the player's turn).

Advantages of using the badging API over notifications:

* Can be used for much higher frequency events than notifications, because each
  new event does not disrupt the user.
* There is no need to request permission to use the badging API, since it is
  much less invasive than a notification.

(Typically, sites will want to use both APIs together: notifications for
high-importance events such as new direct messages or incoming calls, and badges
for all new messages including group chats not directly addressed to the user.)

## API proposal

### The model

There is a single global badge associated with each Web
application (as defined in [Web app
manifest](https://www.w3.org/TR/appmanifest/)). At any time, the badge is set to
either:

* Nothing (the badge is "cleared"), or
* A "flag" indicating the presence of a badge with no contents, or
* A non-empty string containing a single *[grapheme
  cluster](http://unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries)*
  (roughly: a single Unicode character), or
* A positive integer.

The model does not allow a badge that is the empty string, a negative integer,
or the integer value 0.

The grapheme cluster allows a single character to be represented, but also
for combining characters to be combined into what the user thinks of as a single
character. Examples of grapheme clusters include:

* "a" (a single character, Latin "a")
* "நி" (a base character + combining character, Tamil "ni")
* 👩🏾🔬 (emoji combination with skin tone modifier, Woman Scientist with
  Medium-Dark Skin Tone)

Clients are encouraged to use integers instead of digit characters, because some
operating systems may *only* support integer badges, so using the digit
character would not display correctly. Also integers can be localized better for
the user.

### The API

The `Badge` interface is a member object on
[`Window`](https://html.spec.whatwg.org/#the-window-object) and
[`Worker`](https://www.w3.org/TR/workers/#worker). It contains two methods:

* `void set(optional USVString or long)`: Sets the associated app's badge to the
  given data, or just "flag" if the argument is not given.
* `void clear()`: Sets the associated app's badge to nothing.

These can be called from either a foreground page or a service worker (in either
case, affecting the whole app, not just the current page).

TODO: An issue is that if the methods are called from a service worker whose
scope is a parent of the web app manifest scope, it would be ambiguous which web
app is being identified. We need to take an optional scope parameter.

Example code (from in a service worker):

```js
self.addEventListener('sync', () => {
  self.Badge.set(getUnreadCount());
});
```

## UX treatment

* Installed Web applications are typically given some presence in an
  operating-system location, such as the shelf, launcher, dock, home screen,
  etc. Usually the application is represented by an icon.
* The badge would appear as a user-agent-defined overlay on top of the app's
  icon, about a quarter of the size and in one of the four corners, as shown in
  the sample images above.
* Operating systems typically provide a badge system for native applications;
  user agents should re-use existing operating system APIs / UI and conventions
  to achieve a native look-and-feel.
* The user agent should make a "best effort" attempt to map the badge data
  structure onto the host operating system's badge format:
  * Some operating systems (e.g., Android) only provide UI for a Flag badge;
    just a coloured dot with no content (see the sample image above). In these
    cases, the user agent should follow this convention, and only show a Flag,
    even if the website sets richer badge data.
* If the operating system doesn't allow the exact representation of the badge
  (e.g., a 2-digit number but the OS only allows a single character, or a
  character but the OS only allows a number), the user agent should try the best
  to map into the OS representation. This may involve:
  * Saturating a number; e.g., 351 -> "99+".
  * Representing a character as a number; e.g., "?" -> "1".
  * Truncating a grapheme cluster; e.g., "நி" -> "ந".

## Specific operating system treatment

This section describes a possible treatment on each major OS. User agents are
free to implement however they like, but this should give an idea of what the
API will look like in practice.

### macOS

Requires macOS 10.5 or higher.

* The host API is a string, truncated from the center to a system-defined
  length, as shown/described
  [here](https://eternalstorms.wordpress.com/2016/10/29/how-to-badge-an-apps-icon-in-the-dock/).
  The API is
  [`NSDockTile.setBadgeLabel`](https://developer.apple.com/documentation/appkit/nsdocktile/1524433-badgelabel).
* String badges are just passed to `setBadgeLabel`. All single-grapheme-cluster
  strings should show without truncation. The character is shown as white text
  in a red circle.
* Flag badges are passed as an empty string to `setBadgeLabel` (if that works,
  otherwise pass a space character). This shows an empty red circle.
* Integer badges are saturated to 3 or 4 digits (with a "+" if overflowing), and
  passed as a string to `setBadgeLabel`.

### Universal Windows Platform

Requires Windows 10 or higher, and requires that the user agent be a "UWP" app.
Note that Google Chrome and Mozilla Firefox do not fall into this category, and
hence don't have access to the necessary APIs.

* The host API is
  [`BadgeNotification`](https://docs.microsoft.com/en-us/uwp/api/windows.ui.notifications.badgenotification),
  which allows either a positive integer (saturated at 99) or a fixed glyph
  (shown
  [here](https://docs.microsoft.com/en-us/windows/uwp/design/shell/tiles-and-notifications/badges)).
* Integer badges are just passed straight through into this API.
* Flag badges are passed as a fixed glyph, perhaps "attention", since I don't
  think there is a way to show an empty circle.
* String badges: if the string equals a Unicode character corresponding to one
  of the fixed glyphs, use that glyph (e.g., "✉" -> "newMessage"). Otherwise,
  fall back to the same as the Flag badge, "attention".

This will show up on both the Taskbar and Start Menu tile.

### Legacy Windows (Win32)

Requires Windows 7 or higher.

* The host API is
  [`ITaskbarList3::SetOverlayIcon`](https://docs.microsoft.com/en-au/windows/desktop/api/shobjidl_core/nf-shobjidl_core-itaskbarlist3-setoverlayicon),
  which allows applications to set a 16x16-pixel overlay icon in the corner of
  the application's main icon in the Taskbar.
* Due to the nature of being a 16x16-pixel icon, the user agent must render the
  text or number into an image. It pretty much has to be 1–2 characters.
* Flag badges are just passed as a coloured circle.
* String badges are passed as a rendering of the single grapheme cluster in a
  coloured circle.
* Integer badges are rendered as the number, if a single digit, or "+", if
  greater than 9.

### Android

Requires Android 8.0 (Oreo) or higher.

* The host API is
  [`NotificationChannel`](https://developer.android.com/training/notify-user/badges),
  which lets you set a number only. The badge is usually shown as a coloured
  dot; the number is only shown on a long-press.
* Tricky: The API is tied to notifications. You can't show a badge unless there
  are pending notifications.

### Chrome OS

Not currently supported, but will [soon be available](https://crbug.com/801014)
for Android apps using the above `NotificationChannel` API. The Chrome browser
itself will be able to re-use this mechanism for showing a coloured dot on web
application icons.

### iOS

* The host API is
  [`UIApplication.applicationIconBadgeNumber`](https://developer.apple.com/documentation/uikit/uiapplication/1622918-applicationiconbadgenumber),
  which lets you set a positive integer only.
* Integer badges are passed directly to the host API.
* Strings that are numeric digits are converted to a number and passed to the
  host API.
* Flag badges and strings other than digits are just represented by the number
  "1".

### Ubuntu

Requires Ubuntu (no general API for Linux).

* The host API is
  [`unity_launcher_*`](https://wiki.ubuntu.com/Unity/LauncherAPI), which lets
  you set an integer only.
* See iOS treatment.

### Summary

* All known host OSes support some form of badge.
* Integer badges are always supported (but sometimes translated).
* Most platforms support showing at least one arbitrary character. UWP limits to
  a small selection of glyphs. iOS and Ubuntu can only show numbers.

Thus, a fallback option for platforms that do not support arbitrary characters
(e.g., choose whether to show a number, or nothing) may be necessary.

## FAQ

### What data types are supported in different operating systems?

See above.

### Could the API take a fallback type?

The proposal is: what if instead of just taking *one of* the string or integer,
we allow sites to pass both, with an order of preference. This way, you could
supply a string, but if strings aren't supported, fall back to a given number,
or vice versa.

This is something we're considering. My concern is that it makes the API too
complex, where practically it isn't required (e.g., I believe all major
platforms support at least one character strings).

### Why limit the support to a single grapheme cluster? Is there a technical limitation?

It isn't a technical limitation. It's an attempt to keep the behaviour as
consistent as possible between different host platforms.

We could say "provide an arbitrarily long string, and we'll truncate it", but
having some platforms truncate to just 1 or 2 characters, and others showing a
bit more text, makes it too unpredictable. Limiting to precisely one character
levels the playing field.

### Is there an upper limit on the size of the integer? And if so, what's the behavior if that limit is reached?

There is no upper limit (besides 231). However, each user agent is
free to impose a limit and silently saturate the value (e.g., display all values
above 99 as "99+").

This is different to the string, since truncating a string may change or destroy
its meaning, whereas the integer always has the semantics of counting, and thus
saturating the integer still preserves most of its meaning (i.e., "lots").

Yes. If users habitually leave mail or chats unread, and mail or chat apps
simply call `set(getUnreadCount())`, it could result in several apps simply
showing a large number, presenting several issues:

* Leaving "clutter" on the user's shelf, and
* Making the user unable to tell when new messages arrive.

However, the only solution to this is a much more limited API which only lets
you show the count of notifications (or similar). We wanted to give apps the
full power of showing a native badge.

repository: tomayac/badging

gha_license_id: NOASSERTION

repo_name: tomayac/badging


text:
# clean-redux-demo
Sample Android application in Kotlin showcasing an architecture combining [Redux](https://redux.js.org/) and the [Clean Architecture](https://8thlight.com/blog/uncle-bob/2012/08/13/the-clean-architecture.html) principles, using the [Kotlin Redux libraries](https://github.com/atoka93/redux-kotlin).

## Structure
The application contains two screens:
- a login screen: this functionality is mocked. When the `Log In` button is pressed it will (with a delay) either randomly display an error message or forward you to the next screen.
- a list screen: it displays the most popular GitHub repository names using the GitHub API (not authenticated). Also contains: paging, reload functionality and error handling.

Currently there is no RX implememtation available.

## License
Licensed under the [Apache License, Version 2.0](https://github.com/atoka93/clean-redux-demo/blob/master/LICENSE).


text:
---
title: "Prometheus"
date: 2018-02-21T14:11:25-05:00
description: ""
categories: []
keywords: []
aliases: []
toc: false
draft: false
reviewed: true
---

## Introduction

Prometheus is a tool/database that is used for monitoring. Prometheus adopts a pull based model in getting metrics data by querying each target defined in its configuration.

Prometheus scrapes metrics from instrumented jobs, either directly or via an intermediary push gateway for short-lived jobs.
It stores all scraped samples locally and runs rules over this data to either aggregate and record new time series from existing data or generate alerts.
Grafana or other API consumers can be used to visualize the collected data.

Our light-4j Prometheus metrics handler collects the API runtime information and saves it to the Prometheus Metric data module. The Prometheus server will pull the metric from metrics_path which is configurable on the Prometheus config yml file (for example: /v1/prometheus) ; The pulling interval is second base on the config file (scrape_interval: 30s). A Grafana instance is hooked to Prometheus to output the metrics on dashboard from two different perspectives.

By default, Prometheus metric targets (nodes to monitor) are provided statically in the prometheus config file. Static targets are simple when we know in advance our infrastructure. But for the microservice architecture, the service API will have dynamic targets on the cloud. So our solution is use consul to provide targets for prometheus to monitor dynamically.

Consul is a service discovery tool by hashicorp, it allows services/virtual machines to be registered to it and then provide dns and http interfaces to query on the state of the registered services/virtual machines.

In Prometheus, we need to configure it using consul_sd_targets. Prometheus will then query  the Consul http interface for the catalog of targets to monitor.

## Configuration

#### Configuration file (prometheus.yml) for the MiddlewareHandler (com.networknt.metrics.prometheus.PrometheusHandler)

```

// If metrics handler is enabled or not
enabled: false

 // If the Prometheus hotspot is enabled or not.
// hotspot include thread, memory, classloader,...
enableHotspot: false

```

And for each service API which you want to use Prometheus, there are several config changes that need to be made on handler.yml:

1.  We need to add Prometheus middleware handler:
  ```
     - com.networknt.metrics.prometheus.PrometheusHandler@prometheus
     - com.networknt.metrics.prometheus.PrometheusGetHandler@getprometheus

  ```

2. Add Prometheus middleware handler to the chains:

 ```
chains:
  default:
    - exception
    - prometheus
    - traceability
    - correlation
    - specification
    - security
    - body
    - audit
    - sanitizer
    - validator

 ```

3.And add endpoint for Prometheus to pull the metrics data:

  ```
  - path: '/v1/prometheus'
    method: 'get'
    exec:
      - getprometheus

 ```

Change the enabled value to true to enable the prometheus metrics handler;

In the light-4j, the following Prometheus Metric are defined in the Prometheus MiddlewareHandler

```java

    public static final String REQUEST_TOTAL = "requests_total";
    public static final String SUCCESS_TOTAL = "success_total";
    public static final String AUTO_ERROR_TOTAL = "auth_error_total";
    public static final String REQUEST_ERROR_TOTAL = "request_error_total";
    public static final String SERVER_ERROR_TOTAL = "server_error_total";
    public static final String RERSPONSE_TIME_SECOND = "response_time_seconds";

```

Prometheus provides a collector that can scrape and expose the mBeans of a JMX target.

It runs as a JavaAgent, exposing an HTTP server and serving metrics of the local JVM.

If the user wants to have an enabled hotspot monitor for JVM, change the enableHotspot value to true:

```
enableHotspot: true
```

The Hotspot monitor metrics include:

CPU and JVM process:

```
process_cpu_seconds_total
process_open_fds
```

JVM memory usage:

```
jvm_memory_pool_allocated_bytes_total
jvm_memory_pool_bytes_init
jvm_memory_pool_bytes_max
jvm_memory_pool_bytes_used
```

metrics about JVM thread areas

```
jvm_threads_peak
jvm_threads_daemon
jvm_threads_started_total
jvm_threads_deadlocked
jvm_threads_state
```

JVM garbage collectors:

```
jvm_gc_collection_seconds
```

Buffer:

```
jvm_buffer_pool_used_bytes
jvm_buffer_pool_capacity_bytes
jvm_buffer_pool_used_buffers
```

## Configuration for Prometheus

Prometheus is configured via a configuration file. The file is written in YAML format, defined by the Prometheus scheme.

Here is the sample config file. It can be found from the link:

```
# my global config
global:
  scrape_interval:     15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
  evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
  # scrape_timeout is set to the global default (10s).

# Alertmanager configuration
alerting:
  alertmanagers:
  - static_configs:
    - targets:
      # - alertmanager:9093

# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
  # - "first_rules.yml"
  # - "second_rules.yml"

# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
  # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
  - job_name: 'services'
    scrape_interval: 15s
    consul_sd_configs:
      - server: 'consul:8500'
        services:
          - 'multimodule_tram-todolist-command-service'
          - 'multimodule_tram-todolist-view-service'
          - 'com.networknt.bookstore-service-api-3.0.1'
          - 'com.networknt.computerstore-service-api-3.0.1'
          - 'com.networknt.foodstore-service-api-3.0.1'
          - 'com.networknt.petstore-service-api-3.0.1'
          - 'com.networknt.marketsample-service-3.0.1'

    tls_config:
      # Skip verification until we have resolved why the certificate validation
      # for the kubelet on API server nodes fail.
      insecure_skip_verify: true

    relabel_configs:
      - source_labels: ['__meta_consul_service']
        regex:         '(.*)'
        target_label:  'service'
        replacement:   '$1'
      - source_labels: ['__meta_consul_tags']
        target_label: 'slave_name'
        regex: '.*slave_name=([^,]*).*'
        replacement: '${1}'
      - source_labels: ['__meta_consul_tags']
        target_label: 'public_hostname'
        regex: '.*public_hostname=([^,]*).*'
        replacement: '${1}'

    metrics_path: /v1/prometheus
    # metrics_path defaults to '/metrics'
    # scheme defaults to 'http'.
    scheme: https

  - job_name: 'prometheus'
    static_configs:
      - targets: ['localhost:9090']

    metrics_path: /metrics

```

Currently we are using https protocol:

     scheme: https

 for local environment, we ignore ssl check by setting in config file:

       insecure_skip_verify: true

## Customization

#### Prometheus Metric names and labels

Every time the series is uniquely identified by its metric name and a set of key-value pairs, also known as labels.

The metric name specifies the general feature of a system that is measured (e.g. http_requests_total - the total number of HTTP requests received). It may contain ASCII letters and digits, as well as underscores and colons. It must match the regex [a-zA-Z_:][a-zA-Z0-9_:]*.

Labels enable Prometheus's dimensional data model: any given combination of labels for the same metric name identifies a particular dimensional instantiation of that metric (for example: all HTTP requests that used the method POST to the /api/tracks handler). The query language allows filtering and aggregation based on these dimensions. Changing any label value, including adding or removing a label, will create a new time series.

And the service "endpoint" and "clientId" are been added as Labels for Prometheus's dimensional data model.

The sample result for the Prometheus metric will be like below:

```
requests_total{clientId="unknown",endpoint="/todos@post",instance="<IP_ADDRESS>:8081",job="services",service="multimodule_tram-todolist-command-service"}	1
requests_total{clientId="unknown",endpoint="/todoviews@get",instance="<IP_ADDRESS>:8082",job="services",service="multimodule_tram-todolist-view-service"}	1

```

## Integrate  Prometheus with Grafana:

The Light framework provided docker-compose file (docker-compose-prometheus.yml) includes the Grafana image: image: grafana/grafana:4.6.3

So the user can open a browser to view  the Prometheus from Grafana

 ```
http://<IP_ADDRESS>:3000/

user: admin
passwork: admin

 ```

Please follow the following steps to set the Prometheus up in Grafana:

Adding the data source to Grafana:

1. Open the side menu by clicking the Grafana icon in the top header.

2. In the side menu under the Dashboards link you should find a link named Data Sources.

3. Click the + Add data source button in the top header.

4. Select Prometheus from the Type dropdown.

After Prometheus works as a backend dataSource for Grafana, the user can customize their own template or dashboard in Grafana for Prometheus metrics.

You can get more details here: http://docs.grafana.org/features/datasources/prometheus/

repository: networknt/light-doc

gha_language: CSS

repo_name: networknt/light-doc


text:
# jQuery-scrollable

jQuery extension for lean scrollable areas

## Usage
```html
<div class="scrollable"></div>
```

Elements with the `scrollable` class are automatically initialized. Its `max-height` attribute will be used as height if defined.

OR

```javascript
$().scrollable(height);
```

Height is a valid `max-height` value and will be used to define the element's max scrollable height.

If `height` is a falsey value, it will be ignored and the element's `max-height` css attribute will be used instead.

Default value is `inherit`.

<br>**Recommended use with slimScroll.js for very clean scroll bars**

repository: rabelloo/jQuery-scrollable

repo_name: rabelloo/jQuery-scrollable


text:
# Service Bus Relay #

---

## Overview ##

This demonstration shows how to configure Service Bus Relay service.

The Service Bus Relay service enables you to build hybrid applications that run in both a Microsoft Azure datacenter and your own on-premises enterprise environment. The Service Bus relay facilitates this by enabling you to securely expose Windows Communication Foundation (WCF) services that reside within a corporate enterprise network to the public cloud, without having to open up a firewall connection or requiring intrusive changes to a corporate network infrastructure.

> **Note:** In order to run through this complete demo, you must have network connectivity and a Microsoft account.

### Goals ###
In this demo, you will see how to:

1.	Configure an application to consume Service Bus Relay services.

1. Test the application using an iPhone emulator.

### Key Technologies ###

This demo uses the following technologies:

- [Microsoft Azure Management Portal] [1]

[1]: https://manage.windowsazure.com/

### Setup and Configuration ###

1. Make sure you have installed [**Web Matrix 2**](http://www.microsoft.com/web/webmatrix/) with the [**iPhone simulator extension**](http://extensions.webmatrix.com/packages/iPhoneSimulator/) or another iPhone simulator or emulator.

1. Go to <https://manage.windowsazure.com/>

1. To use **Service Bus**, you need to access the previous management portal version. In order to do this, hover the mouse pointer over **Preview** in the main page header and click **Take me to the previous portal**.

1. Click **Service Bus, Access Control and Caching** and select **Service Bus**.

1. Click the **New** button to create a new Service Namespace.

1. In the **Create a new Service Namespace** dialog, enter a valid namespace and select a Country/Region and the Subscription where you want to create the namespace. Ensure you have selected "Service Bus" from the "Available Services" list and click **Create Namespace**.

	![Create a new Service Namespace](Images/create-a-new-service-namespace.png?raw=true "Create a new Service Namespace")

	_Create a new Service Namespace_

1. Once your Service Namespace is created select it and click **View** in the **Default Key** property.

	![Default Key](Images/default-key.png?raw=true "Default Key")

	_Default Key_

1. Take note of the default issuer name and key.

1. Open the file located at **\Source\Config.Local.xml**.

1. Replace the values with your service bus namespace, issuer name and issuer key.

1. Run the **Setup.Local.cmd** script as an administrator.

> **Note:** The setup script copies the source code for this demo to a working folder that can be configured in the **Config.Local.xml** file (by default, C:\Projects). From now on, this folder will be referenced in this document as the **working folder**.

---

## Demo ##

This demo is composed of the following segments:

1. [Service Bus Relay](#segment1)

### Service Bus Relay ###

1. Open **Visual Studio 2012** as administrator.

1. Click File | Open | Project/Solution and open the **ServiceBusRelay.Console.sln** solution file located at  **[working folder]\ServiceBusRelay-Console**.

	> **Speaking Point**
	>
	> Let's open ServiceBusRelay Console application. This is a simple application that shows how to expose an on-premises SQL Database using Service Bus Relay services.

1. Press **F5** to run the console application.

	![Service Bus Relay console Running](Images/service-bus-relay-console-running.png?raw=true "Service Bus Relay console Running")

	_Service Bus Relay console Running_

	> **Speaking Point**
	>
	> Now, we'll run the console application.
	>
	>The Service Bus allows a Windows Communication Foundation-based (WCF) application to listen to a public network address, even if the application is located behind a NAT or network firewall. This functionality can be used to help applications communicate with each other, regardless of network specific structure. Through the use of the Service Bus as an intermediary you can interconnect different applications without the need to write and maintain complex logic and code to traverse networks.

1. Open a new instance of **Visual Studio 2012** as administrator.

1. Open the **ServiceBusRelay.Web.sln** solution file located at **[working folder]\ServiceBusRelay-Web**.

1. Make sure the cloud project is set as startup project. To do this, right-click **ServiceBusRelay.Web.Azure** and select **Set as StartUp Project**.

1. Press **F5** to run the application.

1. Copy the URL from the browser window.

	![Service Bus Relay web Running](Images/service-bus-relay-web-running.png?raw=true "Service Bus Relay web Running")

	_Service Bus Relay web Running_

	> **Speaking Point**
	>
	> Now we'll open a second application, this time a website that consumes the information that it is being exposed through the console application using Service Bus Relay services.

1. Open **Web Matrix 2**, select the Service Bus Relay site and run it using the iPhone simulator.

	![Running the application using iPhone simulator](Images/running-the-application-using-iphone-simulato.png?raw=true "Running the application using iPhone simulator")

	_Running the application using iPhone simulator_

	> **Speaking Point**
	>
	> Let's access the application from an iPhone simulator and make a call to one of the exposed methods.

1. Click **Customers**.

1. Switch to the running console application and notice the call received.

	![GetCustomers received call](Images/getcustomers-received-call.png?raw=true "GetCustomers received call")

	_GetCustomers received call_

	> **Speaking Point**
	>
	> If we switch back to the console application, you will notice how the GetCustomers request was logged.

---

## Summary ##

In this demonstration, you saw how to implement Service Bus Relay services.


text:
# bidrag-actions/git-commit

This action will commit changed repository files and push to origin

Requires a runner with node and ncc installed. Also the running environment must be able to execute
bash scripts.

The action requires the commit message. An optional input is a file with content to add to the commit
message.

If a file containing some commit message content is present, the content will replace {} from the commit
message provided.

The author information of the commit will be gathered from the GITHUB_EVENT. If no event is present, the
following information will be used:
- Author name: Tag & Commit Action
- Author email<EMAIL_ADDRESS>

repository: navikt/bidrag-actions

gha_language: Shell

repo_name: navikt/bidrag-actions


text:
# Command line

x64dbg supports the following command line:

- 1 argument: `x64dbg filename.exe` will debug `filename.exe`.
- 2 arguments: `x64dbg -p PID` will attach to the process with `PID` PID.
- 2 arguments: `x64dbg filename.exe cmdline` will debug `filename.exe` with `cmdline` as command line.
- 3 arguments: `x64dbg filename.exe cmdline currentdir` will debug `filename.exe` with `cmdline` as command line and `currentdir` as current directory.

gha_language: Python


text:
---
layout: post
title: "Forming New Habits"
date: 2012-10-01 15:50
comments: true
categories: habits
published: true
---

<blockquote>
habit: a settled or regular tendency or practice, esp. one that is hard to give up.
</blockquote>

## _what are my habits?_

Like lots of you, I have bad habits (almost too many to count.) These bad habit have bad consequences: lack of focus, reduced productivity, stress -- even health and relationship problems. And these habits are really entrenched. I realized that what I need to do is replace my existing bad habits with new good ones. However, I wasn't exactly sure how to get started.

Then I read [this Lifehacker article](http://lifehacker.com/5896846/the-right-habits) and decided to begin developing some new habits.

I started by making a list of the habits that I want to develop.

1. do something thoughtful for my wife
2. be a better communicator/organizer
3. get enough sleep
4. read for at least 30 minutes a day
5. write something at least once a day
6. work on personal development

Then I attempted to identify a couple of keystone habits I could develop.

First for the last week, I take a few minutes in the morning to put review my calendar and put together a "Game Plan" - just a single Google Doc that has a list of things that I need to keep in mind today and what's upcoming. The goal is to get away from my usual routine of not having a clue and just coasting through each day. If I start the day with a little organization and planning, I'm more focused and less stressed (seriously.)

Second, I ask myself if there is anything I can do for my wife. I draw a blank more often than not, but sometimes I'll get an idea for a simple thing I can do: buy her a lemonade at lunch and deliver it to her office, call someone in her family just to say hi - _because she really appreciates when I do that,_ or just do some chores without being asked. These are things that I tend to overlook, and over years, the little bits of my inattentiveness accumulates. My hope is that making a daily effort to actively think about my wife will reverse that trend.

Third, I take time to write something. This is usually at the end of the day, and it can be anything: a document for a side project or a new blog post. It can also be something as small as a new note about something that I'm learning.

I have my list of habits. I have my keystone habits that I'm focusing on. I think it's a good start.

_By the way, if you like the article, Charles Duhigg wrote a book [The Power of Habit](http://amzn.to/GOOBXX) that I've also bought._

repository: dnorton/octopress

extension: markdown

repo_name: dnorton/octopress


text:
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Please don't submit questions**
Please use this form to report specific bugs in Jetson.GPIO. All general questions or support requests should be directed at NVIDIA's forums; see:
https://developer.nvidia.com/embedded/community/support-resources

Please delete this section from your bug report.

**Describe the bug**
A clear and concise description of what the bug is, including
- Which version of Jetson.GPIO you are using.
- Which version of L4T (not JetPack) you are using.
- Which Jetson board you are using.

**To Reproduce**
Steps to reproduce the behavior:
1. Connect  button/wire/LED/... XXX to the board
2. Configure pin ... to input/output/...
3. Execute API ...

**Expected behavior**
A clear and concise description of what you expected to happen.

**Additional context**
Add any other context about the problem here.

repository: NVIDIA/jetson-gpio

repo_name: NVIDIA/jetson-gpio


text:
### Command Line

* [https://www.wpf-tutorial.com/wpf-application/command-line-parameters/](https://www.wpf-tutorial.com/wpf-application/command-line-parameters/)

### Exceptions

* [https://www.wpf-tutorial.com/wpf-application/handling-exceptions/](https://www.wpf-tutorial.com/wpf-application/handling-exceptions/)

### Important Window properties

The WPF Window class has a bunch of interesting attributes that you may set to control the look and behavior of your application window. Here's a short list of the most interesting ones:

**Icon** - Allows you to define the icon of the window, which is usually shown in the upper left corner, to the left of the window title.

**ResizeMode** - This controls whether and how the end-user can resize your window. The default is CanResize, which allows the user to resize the window like any other window, either by using the maximize/minimize buttons or by dragging one of the edges. CanMinimize will allow the user to minimize the window, but not to maximize it or drag it bigger or smaller. NoResize is the strictest one, where the maximize and minimize buttons are removed and the window can't be dragged bigger or smaller.

**ShowInTaskbar** - The default is true, but if you set it to false, your window won't be represented in the Windows taskbar. Useful for non-primary windows or for applications that should minimize to the tray.

**SizeToContent** - Decide if the Window should resize itself to automatically fit its content. The default is Manual, which means that the window doesn't automatically resize. Other options are Width, Height and WidthAndHeight, and each of them will automatically adjust the window size horizontally, vertically or both.

**Topmost** - The default is false, but if set to true, your Window will stay on top of other windows unless minimized. Only useful for special situations.

**WindowStartupLocation** - Controls the initial position of your window. The default is Manual, which means that the window will be initially positioned according to the Top and Left properties of your window. Other options are CenterOwner, which will position the window in the center of it's owner window, and CenterScreen, which will position the window in the center of the screen.

**WindowState** - Controls the initial window state. It can be either Normal, Maximized or Minimized. The default is Normal, which is what you should use unless you want your window to start either maximized or minimized.


text:
# Node Selector
### nodeSelector is the simplest recommended form of node selection constraint. nodeSelector is a field of PodSpec. It specifies a map of key-value pairs. For the pod to be eligible to run on a node, the node must have each of the indicated key-value pairs as labels (it can have additional labels as well).

# Node Affinity
### Node affinity is conceptually similar to \'nSelector\' it allows you to constrain which nodes your pod is eligible to be scheduled on, based on labels on the node. It is similar to nodeSelector but using a more expressive syntax

## Types
### requiredDuringSchedulingIgnoredDuringExecution
### preferredDuringSchedulingIgnoredDuringExecution
### (Future)requiredDuringSchedulingRequiredDuringExecution

repository: blitz-cmd/Devops

repo_name: blitz-cmd/Devops


text:
# Getting started

Mongoosastic is a [mongoose](http://mongoosejs.com/) plugin that can automatically index your models into [elasticsearch](https://www.elastic.co/).

## Installation

The latest version of this package will be as close as possible to the latest `elasticsearch` and `mongoose` packages.

```bash
npm install -S mongoosastic
```

## Setup

Syntax:

``` javascript
Schema.plugin(mongoosastic, options)
```

### Options

Options are:

* `index` - the index in Elasticsearch to use. Defaults to the pluralization of the model name.
* `esClient` - an existing Elasticsearch `Client` instance.
* `clientOptions` - Connection configuration to pass to Elasticsearch client. you can find the possible options in the [client configuration](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/client-configuration.html) page.
* `alwaysHydrate` - whether or not to lookup results in mongodb before
* `hydrateOptions` - options to pass into hydrate function
* `bulk` - size and delay options for bulk indexing
* `filter` - the function used for filtered indexing
* `transform` - the function used to transform serialized document before indexing
* `populate` - an Array of Mongoose populate options objects
* `indexAutomatically` - allows indexing after model save to be disabled for when you need finer control over when documents are indexed. Defaults to true
* `properties` - an object detailing additional properties which will be merged onto the type's default mapping when `createMapping` is called (note: [`createMapping`](/mapping#creating-mappings-on-demand) is not called automatically, you must explicitly call it).
* `saveOnSynchronize` - triggers Mongoose save (and pre-save) method when synchronizing a collection/index. Defaults to true

To have a model indexed into Elasticsearch simply add the plugin.

=== "Javascript"

    ``` javascript
    const mongoose = require('mongoose')
    const mongoosastic = require('mongoosastic')
    const Schema = mongoose.Schema

    const UserSchema = new Schema({
        name: String,
        email: String,
        city: String
    })

    UserSchema.plugin(mongoosastic)
    ```

=== "Typescript"

    ```typescript
    import mongoose, { Schema, Document } from 'mongoose'
    import mongoosastic, { MongoosasticModel, MongoosasticDocument } from 'mongoosastic'

    interface IUser extends Document, MongoosasticDocument {
        name: string,
        email: string,
        city: string,
    }

    var UserSchema = new Schema({
        name: String,
        email: String,
        city: String
    })

    UserSchema.plugin(mongoosastic)

    const User = mongoose.model<IUser, MongoosasticModel<IUser>>('User', UserSchema)
    ```

This will by default simply use the pluralization of the model name as the index
while using the model name itself as the type. So if you create a new
User object and save it, you can see it by navigating to
`http://localhost:9200/users/_search` (this assumes Elasticsearch is
running locally on port 9200).

The default behavior is all fields get indexed into Elasticsearch. This can be a little wasteful especially considering that
the document is now just being duplicated between mongodb and
Elasticsearch so you should consider opting to index only certain fields by specifying `es_indexed` on the
fields you want to store:

```javascript
var UserSchema = new Schema({
    name: { type: String, es_indexed: true },
    email: String,
    city: String
})

UserSchema.plugin(mongoosastic)
```

In this case only the `name` field will be indexed for searching.

Now, by adding the plugin, the model will have a new method called
`search` which can be used to make simple to complex searches. The `search`
method accepts [standard Elasticsearch query DSL](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-queries.html)

```javascript
const results = await User.search({
  query_string: {
    query: "john"
  }
});
```

To connect to more than one host, you can use an array of hosts.

```javascript
MySchema.plugin(mongoosastic, {
  clientOptions: {
    nodes: [
      'localhost:9200',
      'anotherhost:9200'
    ]
  }
})
```

Also, you can re-use an existing Elasticsearch `Client` instance

```javascript
import { Client } from '@elastic/elasticsearch'

const esClient = new Client({ node: 'http://localhost:9200' })

MySchema.plugin(mongoosastic, {
  esClient: esClient
})
```

repository: mongoosastic/mongoosastic

gha_language: TypeScript

repo_name: mongoosastic/mongoosastic


text:
# ScrollViewReader

A view that provides programmatic scrolling, by working with a proxy to scroll to known child views.

![](images/1.png)

```swift
import SwiftUI

struct ContentView: View {

    @State private var vibrateOnRing = true

    var body: some View {
        Toggle("Vibrate on Ring", isOn: $vibrateOnRing)
            .padding()
    }
}

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}
```

### Links that help

- [Apple docs](https://developer.apple.com/documentation/swiftui/toggle)

repository: SwiftyJanek/swiftui

branch_name: refs/heads/main

repo_name: SwiftyJanek/swiftui


text:
# php-env-dereference

Allow dereferencing of environment variables in PHP.

## Overview

This is generally useful, in cloud environments, where different backing
services are injected into PHP with some strange names. At that point the
developer is either using that strange names in his code or starting to do
workarounds.

This particular library solves this based on the idea from variable dereference
feature that is [already in PHP engine](http://php.net/manual/en/language.variables.variable.php).
```
<?php
$a = 'hello';
$$a = 'world';
// Same output.
echo "$a ${$a}\n", "hello world\n";
```

This is very similar to the [phpdotenv](https://github.com/vlucas/phpdotenv)
nested variables functionality, but exposing only it with a simpler syntax and
allowing recursive dereferencing.

## Library examples
```
// We have this environment variables.
putenv('MY_VAR_1=1');
putenv('MY_VAR_2=#MY_VAR_1');
putenv('MY_VAR_3=#MY_VAR_2');
putenv('MY_VAR_4=#MY_VAR_2 #MY_VAR_3');

// Simple dereferencing
echo EnvDereference\Variable::get('MY_VAR_3'); // Should output '#MY_VAR_1'.
echo EnvDereference\Variable::getRecursive('MY_VAR_3'); // Should output '1'.

// Multiple dereferencing
echo EnvDereference\Variable::getEmbedded('MY_VAR_4'); // Should output '#MY_VAR_1 #MY_VAR_2'.
echo EnvDereference\Variable::getEmbeddedRecursive('MY_VAR_4'); // Should output '1 1'.

// Provide defaultds for missing variables
echo EnvDereference\Variable::get('MY_MISSING_VAR', 'default'); // Should output 'default'.
```

## Install
```
composer require ndobromirov/php-env-dereference
```

## Contribute.

The library complies with PSR-2. Validate with ```composer cs```.
The run tests with ```composer test```.

repository: ndobromirov/php-env-dereference

repo_name: ndobromirov/php-env-dereference


text:
# Create a multi-zone Kubernetes cluster {#task_hyb_xwf_vdb .task}

You can create a multi-zone Kubernetes cluster to guarantee high availability.

-   You have activated the following services: Container Service, Resource Orchestration Service \(ROS\), Resource Access Management \(RAM\), and Auto Scaling service.

    Log on to the [Container Service console](https://partners-intl.console.aliyun.com/#/cs), [ROS console](https://partners-intl.console.aliyun.com/#/ros), [RAM console](https://partners-intl.console.aliyun.com/#/ram), and [Auto Scaling console](https://partners-intl.console.aliyun.com/#/essnew) to activate the corresponding services.

    **Note:** The deployment of Container Service Kubernetes clusters depends on the application deployment capabilities of Alibaba Cloud ROS. Therefore, activate ROS before creating a Kubernetes cluster.

-   You must create a Virtual Private Cloud \(VPC\) and create at least three VSwitches in the VPC. To achieve high availability, we recommend that you create VSwitches in different availability zones.
-   You need to manually configure SNAT for each VSwitch in the VPC. Otherwise, instances in the VPC cannot access the Internet normally.

You can create Kubernetes clusters with ECS instances in different availability zones by using the Container Service console to achieve high availability.

**Context**

During cluster creation, Container Service performs the following operations:

-   Create Elastic Compute Service \(ECS\) instances and configure to log on to other nodes from management nodes with the SSH public key. Install and configure the Kubernetes cluster by using CloudInit.
-   Create a security group. This security group allows the VPC inbound access of all the ICMP ports.
-   Create a RAM user and an AccessKey. The RAM user has the permissions for querying, creating, and deleting ECS instances, the permissions for adding and deleting cloud disks, and all permissions for the operations on Server Load Balancer \(SLB\), CloudMonitor, VPC, Log Service, and Network Attached Storage \(NAS\). The Kubernetes cluster dynamically creates SLB instances, cloud disks, and VPC routing rules according to your configurations.
-   Create an intranet SLB instance and expose the port 6443.
-   Create an Internet SLB instance and expose the port 6443. \(If you enable the SSH logon for Internet when creating the cluster, port 22 is exposed. Otherwise, port 22 is not exposed.\)

**Limits**

-   The SLB instances created with the cluster support only the Pay-As-You-Go billing method.
-   Kubernetes clusters support only the Virtual Private Cloud \(VPC\) network type.
-   By default, each account has a specified quota for the cloud resources it can create. If the number of cloud resources exceeds the quota, the account cannot create a cluster. Make sure you have enough quota before creating a cluster. To increase your quota, open a ticket.
    -   By default, each account can create up to 5 clusters in all regions and add up to 40 nodes to each cluster. To create more clusters or nodes, open a ticket.
    -   By default, each account can create up to 100 security groups.
    -   By default, each account can create up to 60 Pay-As-You-Go SLB instances.
-   The limits for ECS instances are as follows:
    -   Only the CentOS operating system is supported.
    -   The Pay-As-You-Go and Subscription ECS instances can be created.

1.  Log on to the [Container Service console](https://partners-intl.console.aliyun.com/#/cs).
2.  Under Kubernetes, click **Clusters** in the left-side navigation pane. Click **Create Kubernetes Cluster** in the upper-right corner.
3.  On the Create Kubernetes Cluster page, click **Multi-AZ Kubernetes**.
4.  Enter the cluster name.

    The cluster name can be 1–63 characters long and contain numbers, Chinese characters, English letters, and hyphens \(-\).

5.  Select the region where the cluster is located.
6.  Select a VPC.

    Select a VPC from the existing VPC drop-down list and select three VSwitches under the VPC. To achieve high availability, we recommend that you select the VSwitches located in different zones.

    ![](http://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/assets/img/16644/15435723598749_en-US.png)

7.  Configure the Master nodes and Worker nodes.

    1.  Select a node payment type from Pay-As-You-Go and Subscription.
    2.  Select instance types of the Master nodes and Worker nodes, and set the number of Worker nodes.

        **Note:**

        -   Currently, only the CentOS operating system is supported.
        -   Currently, only three Master nodes can be created.
        -   Each cluster can contain up to 37 Worker nodes. To create more nodes, open a ticket.
        -   System disks are attached to Master nodes and Worker nodes by default. Available system disks include SSD Cloud Disks and Ultra Cloud Disks.
        -   You can also manually attach a data disk to the Worker node. The data disk can be an Ultra Cloud Disk or an SSD Cloud Disk.
    ![](http://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/assets/img/16644/15435723598750_en-US.png)

8.  Configure the logon mode.
    -   Set the key pair.

        When creating a cluster, select the key pair logon mode and click **Create a new key pair**. In the ECS console, create a key pair. For details, see [Create an SSH key pair](../../../../reseller.en-US/User Guide/Key pairs/Create an SSH key pair.md#). After the key pair is created, set the key pair as the credentials for logging on to the cluster.

        ![](http://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/assets/img/16644/15435723598751_en-US.png)

    -   Set the password.
        -   **Logon Password**: Set the node logon password.
        -   **Confirm Password**: Confirm your node logon password.
9.  Specify the **Pod Network CIDR** and **Service CIDR** parameters.

    Both of them cannot overlap with the Classless Inter-Domain Routing \(CIDR\) block used by VPC and the existing Kubernetes clusters in VPC. The values cannot be modified after the cluster is created. In addition, service CIDR cannot overlap with pod network CIDR. For more information about how to plan Kubernetes CIDR blocks, see [Plan Kubernetes CIDR blocks under VPC](reseller.en-US/User Guide/Kubernetes cluster/Cluster management/Plan Kubernetes CIDR blocks under VPC.md#).

10. Select whether to enable **Use Public SLB to Expose API Server**. API server provides add, delete, edit, check, watch, and other HTTP Rest interfaces for a variety of resource objects \(such as pods and services\).

    1.  If you select to enable this option, the Internet SLB is created and the port 6443 of the Master nodes is exposed. The port corresponds to the API server. Then you can use kubeconfig to connect to and operate the clusters through the Internet.
    2.  If you select not to enable this option, the Internet SLB is not created. You can only use kubeconfig to connect to and operate the clusters inside the VPC.
    ![](http://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/assets/img/16644/154357235912073_en-US.png)

11. Select whether to enable SSH logon for Internet.

    **Note:** To enable SSH access for Internet, you must select **Use Public SLB to Expose API Server**.

    -   If you select to enable SSH access for Internet, you can use SSH to access a cluster.
    -   If you select not to enable SSH access for Internet, you cannot access a cluster by using SSH or connect to a cluster by using kubectl. To access a cluster instance by using SSH, manually bind an EIP to the ECS instance, configure security group rules, and open the SSH port \(22\). For details, see [Access Kubernetes clusters by using SSH](reseller.en-US/User Guide/Kubernetes cluster/Cluster management/Access Kubernetes clusters by using SSH.md#).
    ![](http://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/assets/img/16644/15435723598752_en-US.png)

12. Select whether to install a cloud monitoring plug-in on your ECS.

    You can install a cloud monitoring plug-in on the ECS node to view the monitoring information of the created ECS instances in the CloudMonitor console.

    ![](http://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/assets/img/16644/15435723598753_en-US.png)

13. Select whether to use Log Service. You can select an existing project or create a project. If you select **Using SLS**, the Log Service plug-in is automatically configured in the cluster. When creating an application, you can quickly use Log Service with a simple configuration. For details, see [Use Log Service to collect Kubernetes cluster logs](reseller.en-US/User Guide/Kubernetes cluster/Logs/Use Log Service to collect Kubernetes cluster logs.md#).

    ![](http://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/assets/img/16644/154357235912754_en-US.png)

14. Select whether to show advance config.
    1.  Select a network plug-in. Available network plug-ins are Flannel and Terway. For details, see [Do I select the Terway or Flannel plug-in for my Kubernetes cluster network?](../../../../reseller.en-US/FAQ/Do I select the Terway or Flannel plug-in for my Kubernetes cluster network?.md#).
        -   Flannel: a simple and stable community Flannel CNI plug-in. It provides only a few simple features. For example, it does not support the Kubernetes Network Policy.
        -   Terway: a network plug-in developed by Alibaba Cloud Container service. It can allocate Alibaba Cloud Elastic Network Interfaces \(ENIs\) to containers. It can also define the access policies between containers according to the Kubernetes Network Policy. In addition, it supports bandwidth limiting for individual containers.
    2.  Set the number of pods for a node, that is, the maximum number of pods that can be run by a single node.

        ![](http://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/assets/img/16644/15435723598754_en-US.png)

    3.  Select whether to use **Custom Image**. The ECS instance installs the default CentOS version if no custom image is selected.

        Currently, you can only select an image based on CentOS custom version to quickly deploy the environment you need.

    4.  Sets whether to use **Custom Cluster CA**. If this option is selected, the CA certificate can be added to the Kubernetes cluster, which enhances the security of information exchange between the server and client.

        ![](http://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/assets/img/16644/15435723598755_en-US.png)

15. Click **Create**, confirm the Internet access for VPC in the displayed dialog box, and click **OK** to start the deployment.

    ![](http://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/assets/img/16644/15435723598759_en-US.png)

    **Note:** A multi-node Kubernetes cluster typically takes 10 minutes to be created.

View cluster deployment results.

After the cluster is successfully created, you can view the cluster in the Cluster List of the Container Service console.

![](http://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/assets/img/16644/154357235912902_en-US.png)

-   Click **View Logs** at the right of the cluster to view the cluster logs. To view more detailed information, click **Stack Events**.

    ![](http://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/assets/img/16644/15435723598756_en-US.png)

-   You can also click **Manage** on the right of the cluster to view the basic information and connection information about this cluster.

    ![](http://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/assets/img/16644/154357235912915_en-US.png)

    **In the Cluster Info section:**

    -   **API Server Internet endpoint:** The IP address and port through which the Kubernetes API server provides services for the Internet. It enables you to manage the cluster by using kubectl or other tools on your terminal.
    -   **API Server Intranet endpoint:** The IP address and port through which the Kubernetes API server provides services inside the cluster. This IP address is the address of the SLB instance, and three Master nodes in the backend provide the services.
    -   **Master node SSH IP address:** You can directly log on to the Master nodes by using SSH to perform routine maintenance for the cluster.
    -   **Service Access Domain:** Provides the services in the cluster with access domain name for testing. The service access domain name suffix is `<cluster_id>.<region_id>.alicontainer.com`.

url: https://raw.githubusercontent.com/osswangxining/csk/a3c4988e5d2c7e266241d9839b6807837926919c/intl.en-US/User Guide/Kubernetes cluster/Cluster management/Create a multi-zone Kubernetes cluster.md

repository: osswangxining/csk

repo_name: osswangxining/csk


text:
---
layout: post
title: Summit-X
date: 2016-09-06
description:
icon: /assets/img/robots/summit-x/icon.png
image: /assets/img/robots/summit-x/image.png
introduction: SUMMIT-X is a dual configuration mobile platform designed mainly for indoor tasks, although it also can work outdoor.
main-class: 'ground'
color: ''
tags:
- 'ground'
- 'indoor'
- 'mobile robot'
- 'robotnik'
- 'autonomous'
twitter_text: Checkout the Summit-X
website: http://www.robotnik.eu/mobile-robots/summit-x/
wiki_homepage: http://wiki.ros.org/Robots/SummitX
---

SUMMIT-X is a dual configuration mobile platform designed mainly for indoor tasks, although it also can work outdoor. SUMMIT-X robot can be raised to a considerable height (such a table, for example). The scissor mechanism of the mobile robot, has also the ability to lower its CDG allowing it to reach speeds up to 3m/s.

It has omnidirectional or skid-steering kinematics based on 4 high-power motor wheels. Each wheel integrates a hub brushless motor with gearbox, speed sensors and optional encoder.

## Related Repositories

 * [summit_x_sim](https://github.com/RobotnikAutomation/summit_x_sim): Packages used for the simulation of the SUMMIT-X.

 * [summit_x_common](https://github.com/RobotnikAutomation/summit_x_common): Contains the URDF description of the SUMMIT-X, platform messages and other files for simulation.

 * [summit_x_robot](https://github.com/RobotnikAutomation/summit_x_robot): Packages used for the configuration and bringup of the SUMMIT-X robot.

## More Information

 * [Robotnik SUMMIT-X](http://www.robotnik.eu/mobile-robots/summit-x/)
 * [Robotnik Github](https://github.com/RobotnikAutomation)

branch_name: refs/heads/gh-pages


text:
## PocketEm Background
"We'll keep your tokens safe, even if you've lost your marbles."

I recently experienced a somewhat serious mental malfunction which I can only hope was precipitated by the medication I am currently taking.

I am taking measures directly to avoid having a recurrance, but I am now seriously concerned with preventing the harm that results from actions of those who have the authority and power to act, but who have lost the the reasoning capacity required to have such authority or power.

Whether incapacitation results from a medical condition or any other reason, real harm can result. Some examples include: being scammed, spending sprees, bad investments, physical damage to property, physical injury, and death.

In my case, it was the middle of the afternoon. I felt tired, stressed, and was in a hurry. I saw a video on YouTube indicating that the Ethereum foundation was doing an "air drop" wherein persons send them tokens gets double back. I doubted it at first, but the account had 250,000 subscribers so I believed it was legitimate and that somehow I had effectively just won a lottery.

I can only say that I was in some sort of dream-like state. I am usually exceptionally skeptical. I think I know "how bad the world is" out there. Normally I have no such trust.

I believed YouTube was more invincible to that kind of thing. Like a child I saw the possibility of a great, fantastically fortunate windfall coming our way, if only I acted quickly enough. And it seemed I couldn't. I seemed to have trouble finding the blanks on forms to enter the passcodes of my accounts.

But I persisted. And sent in 19 tokens (about $4,000, or more than I earn in two months). In a half-hour, it was clear what had happened. I was livid with myself then and I have no great appreciation for me now.

##

I was reluctant to obtain digital currency because I feared I would lose it through negligence or other error. Once I had made about twenty transactions, I began to feel more confident. Too confident, it turned out.

Just enough over-confidence to discover a problem even more serious than negligence and about which I had not an inkling. Dementia. I currently can only hope that my dream-like experience is not actually the result of an early-onset dementium....

In the meantime, there is this notion of protecting our digital resources from the effects of such experiences irrespective of etiology.

Perhaps making this wallet will free me from self-loathing evoked in this incident.

### pre-production research question

what, and to what extent, holds adoption back; same for promotes it

repository: sespaces/pocketem

repo_name: sespaces/pocketem


text:
---
title: Ghast Tear
layout: document
---
## Detail

|Kind|Content|
|---|---|
|Description|Ghast Tear|
|Type|[Materials](Materials)|
|Place|Nether|

Rarely drop it when you defeat the [Ghast](Ghast).

Used it as a material for brewing on the [Brewing Stand](Brewing_Stand).

## Materials that can be crafted

[Potion of Regeneration](Potion_of_Regeneration),
[Mundane Potion](Mundane_Potion),


text:
# Inline plugin for Craft CMS 3.x

Inline the contents of a file in a twig template.

<!-- ![Screenshot](resources/img/plugin-logo.png) -->

## Installation

To install Inline, follow these steps:

1. Install with Composer via `composer require luwes/craft3-inline`
2. Install plugin in the Craft Control Panel under Settings > Plugins

Inline works on Craft 3.x.

## Inline Overview

Internally uses the PHP function `file_get_contents`.

## Using Inline

`{{ inline(assetsUrl ~ '/images/logo.svg') | raw }}`

## Inline Roadmap

Some things to do, and ideas for potential features:

* Release it

Brought to you by [Wesley Luyten](https://wesleyluyten.com)