text:
# Swift Mailer Extensions

## Overview

This project is intended to extend capabilities of [SwiftMailer](https://github.com/swiftmailer/swiftmailer).

Note, that master now only supports SwiftMailer v.6 and not compatible with earlier version.
If you still need earlier versions, check `v.1` of this package.

## Transport

### File transport

For dev environment it is usually desirable to prevent sending out actual emails and store them into files instead for testing.

**FileTransport** does exactly that - it stores emails into eml format which can then be opened with most email applications (e.g. Outlook or Thunderbird). It accepts event dispatcher as first argument and path to the folder where email files will be stored (you should have write access in it).

**Usage example:**

```
// Initialize file transport
$eventDispatcher = new \Swift_Events_SimpleEventDispatcher()
$transport = new FileTransport($eventDispatcher, 'path/to/folder');

// Create the Mailer using your created Transport
$mailer = Swift_Mailer::newInstance($transport);

// Create a message
$message = Swift_Message::newInstance('Wonderful Subject')
<EMAIL_ADDRESS>=> 'John Doe'))
<EMAIL_ADDRESS><EMAIL_ADDRESS>=> 'A name'))
  ->setBody('Here is the message itself')
  ;

// Send the message
$result = $mailer->send($message);
```

**Connecting to Symfony:**

Define FileTransport as service in `services.yml`:

```
swiftmailer.mailer.transport.file:
    class: Geekdevs\SwiftMailer\Transport\FileTransport
    arguments:
      -<EMAIL_ADDRESS>      - "%kernel.project_dir%/var/emails"
```

Configure SwiftMailer to understand new transport in `config.yml` file:

```
swiftmailer:
    transport: file
```

## Copy plugin

Copy plugin is useful to BCC all outgoing emails to specific address (e.g. if you want to monitor everything what you send out).

**Connecting to Symfony:**

Define CopyPlugin as service in `services.yml`:

```
swiftmailer.mailer.plugin.copy:
    class: Geekdevs\SwiftMailer\Plugin\CopyPlugin
    arguments:
      -<EMAIL_ADDRESS>    tags:
      - { name: "swiftmailer.default.plugin" }
```

Note the tag `swiftmailer.primary.plugin` where "default" should be the name of your mailer.

repository: geekdevs/swift-mailer-extensions

gha_language: PHP

repo_name: geekdevs/swift-mailer-extensions


text:
## Getting started:

- [Kicking Node into high gear for data processing or how to hire 100 cats to catch a mouse](https://sgolem.com/kicking-node-into-high-gear-for-data-processing-or-how-to-hire-100-cats-to/)
- [A deep dive into React Context API](https://blog.logrocket.com/a-deep-dive-into-react-context-api/)
- [How to handle errors in Express](https://www.robinwieruch.de/node-express-error-handling)

## Articles & News:

- [Alfred - A Modular Toolchain for JavaScript](https://amilajack.com/alfred/)
- [Stop mocking fetch](https://kentcdodds.com/blog/stop-mocking-fetch)

## Tips, tricks & bit-sized awesomeness:

- [Dr. Axel's book “Deep JavaScript” is now free to read online!](https://twitter.com/rauschma/status/1273144002741702656)
- [Web app using the WebBluetooth Scanning API to listen for COVID-19 exposure notifications from german Covid-Warn](https://twitter.com/FWeinb/status/1273000934700978176)
- [Introducing GitHub Super Linter: one linter to rule them all](https://github.blog/2020-06-18-introducing-github-super-linter-one-linter-to-rule-them-all/)

## Releases:

- [Puppeteer v4.0.0](https://github.com/puppeteer/puppeteer/releases/tag/v4.0.0)
- [Bootstrap 5 alpha](https://blog.getbootstrap.com/2020/06/16/bootstrap-5-alpha/)
- [Parcel 2 beta 1](https://twitter.com/devongovett/status/1273685386020024320)
- [Kleur v4.0.0](https://github.com/lukeed/kleur/releases/tag/v4.0.0)

## Libs & demos:

- [testing-playground](https://testing-playground.com/)
- [xgenecloud](https://github.com/xgenecloud/xgenecloud)
- [deno-cef](https://github.com/denjucks/deno-cef)
- [ModJS](https://github.com/JohnSully/ModJS)
- [powir](https://github.com/slapbot/powir)
- [svguitar](https://github.com/omnibrain/svguitar)
- [streamwall](https://github.com/chromakode/streamwall)
- [bpmn-server](https://github.com/ralphhanna/bpmn-server)
- [beautiful-react-hooks](https://github.com/beautifulinteractions/beautiful-react-hooks)
- [mongosh](https://github.com/mongodb-js/mongosh)
- [jedlik](https://github.com/peak-ai/jedlik)
- [escalade](https://github.com/lukeed/escalade)
- [midori](https://github.com/aeroheim/midori)
- [docx](https://github.com/dolanmiu/docx)
- [helipopper](https://github.com/ngneat/helipopper)

## Interesting & silly stuff:

- [You can now play Valve’s classic Counter-Strike 1.6 game in your web browser](https://www.dsogaming.com/news/you-can-now-play-valves-classic-counter-strike-1-6-game-in-your-web-browser/)

license: MIT

repository: BuildingXwithJS/bxjs-weekly

branch_name: refs/heads/master

extension: md

gha_language: JavaScript

gha_license_id: MIT

license_type: permissive

repo_name: BuildingXwithJS/bxjs-weekly


text:
---
title: How To Backup And Import Account?
date: 2018-06-05 13:44:21
tags: Metaverse
categories: Guide
---

# Backup and import single account

If you want to backup and import your account, please do as beblow:

1.  CAUTION: PLEASE BACKUP YOUR ACCOUNT's MNEMONIC-PHRASE OF MASTER-KEY AT FIRST.

2. Backup Account
Using cli command `dumpkeyfile` to export your account information to backup file.
	```
	$ ./mvs-cli dumpkeyfile account_name password last_word path_of_backup_keyfile
	```
	> last_word: The last word of your account's mnemonic-phrase.
	> path_of_backup_keyfile: The path of backup file.

3. Import Account
Using cli command `importkeyfile` to import your account information from backup file.
NOTICE: you must use the same password as when using dumpkeyfile.
	```
	$ ./mvs-cli importkeyfile account_name password path_of_backup_keyfile
	```
	> path_of_backup_keyfile: The path of backup file.

# Backup and import accounts' database file

Somehow, We have to backup/import database of accounts, we can do as below:

1. Backup accounts database (without blocks)
	Copy and paste the below into the path search function on your device's explorer:
	```
	# Windows: Explorer
	%HOMEPATH%\AppData\Roaming\Metaverse

	# Mac-OSX: Finder => go to folder
	~/Library/Application Support/Metaverse

	# Linux(unix-like):
	~/.metaverse
	```
	Copy and paste the account related tables in the sub-directory `mainnet` as a backup.
	All those tables' name have prefix `account_`, include the followings:
	```
	account_address_rows
	account_address_table
	account_asset_row
	account_asset_table
	account_table
	```

2. Import accounts' database file
Just copy the backuped tables in the above step back into the `mainet` sub-directory.
NOTICE: when access your account, you must use the same username and password as in the backuped account tables.

# Re-syncing blocks
If your database has some problem, please take one of the following solutions to re-syncing.

### Solution 1 - re-syncing from height 0 (Linux) :
```bash
# backup old mainnet directory
$ mv ~/.metaverse/mainnet ~/.metaverse/mainnet.bak

# re-build new database
$ ./mvsd -i

# import accounts database(overwirte)
$ cp -f ~/.metaverse/mainnet.bak/account_* ~/.metaverse/mainnet/

# re-start mvsd in daemon mode:
$ ./mvsd -d

# waiting for syncing completed.
$ tail -f ~/.metaverse/debug.log

```

### Solution 2 - re-syncing from height 1270000+:

#### Linux
```bash
# backup old mainnet directory
$ mv ~/.metaverse/mainnet ~/.metaverse/mainnet.bak

# re-build new database
# use mainnet-linux-height-1473277.tar.gz (md5sum is 54c996066d1249eca25e28babc3940b7)
$ cd ~/.metaverse
$ wget https://s3-us-west-1.amazonaws.com/wallet.mvs.org/download/mainnet-linux-height-1473277.tar.gz
$ tar -xzvf mainnet-linux-height-1473277.tar.gz

# import accounts database(overwirte)
$ cp -f ~/.metaverse/mainnet.bak/account_* ~/.metaverse/mainnet/

# re-start mvsd in daemon mode:
$ ./mvsd -d

# waiting for syncing completed.
$ tail -f ~/.metaverse/debug.log

```

#### Windows
1. Stop wallet, upgrade to [the lastest version](https://mvs.org/wallet.html)
2. Rename 'C:\Users\%USER_NAME%\AppData\Roaming\Metaverse\mainnet' to 'C:\Users\%USER_NAME%\AppData\Roaming\Metaverse\mainnet_bak'
3. Download block data [mainnet-windows-height-1475846.zip](https://s3-us-west-1.amazonaws.com/wallet.mvs.org/download/mainnet-windows-height-1475846.zip) and save to 'C:\Users\%USER_NAME%\AppData\Roaming\Metaverse\mainnet-windows-height-1475846.zip'.
4. Unzip 'mainnet-windows-height-1475846.zip' to where it is.
5. Copy all files that start with 'account_' from folder 'mainnet_bak' to folder 'mainnet'. Files that need to be copyed: 'account_address_rows', 'account_address_table', 'account_asset_row', 'account_asset_table' and 'account_table'.
6. Start wallet and wait for syncing block data to the lastest height.


text:
# Cre8iv FormBuilder

Forms are often a pain to implement. Unfortunately, most sites need them, so we at **[Cre8iv Click](https://cre8iv.click)** decided to try and create a Kirby plugin to make dealing with forms easier on the developer. The FormBuilder plugin tries to help by doing 3 things:

### 1. Easy, Customised Form Creation in The Panel
The plugin provides a pre-made interface that allows the end-user to create and configure their custom form directly in the Panel. This allows the visual creation of many different types of forms - from standard 'Contact Us', through to long questionnaires.

### 2. Auto-creation of Form HTML in Templates
Based on your panel configuration, FormBuilder can generate the form's HTML code automatically for you, injecting it into your template or snippet with a single line of code.

### 3. Built-in Form Processing
A big part of the headache in handling forms is processing the submitted responses. FormBuilder provides ready-made functions to submit responses via email, and to display received responses in the Kirby Panel, too - no coding needed!

****

## Requirements & Installation
FormBuilder requires the **[Kirby Builder Plugin](https://github.com/TimOetting/kirby-builder)** for its panel interface - make sure you install it, before installing FormBuilder.

### Manual Download
You can simply download and copy this repository to `/site/plugins/formbuilder`.

### Git Submodule
You can add FormBuilder to your project as a git submodule, with this command:

```
git submodule add https://gitlab.com/cre8ivclick/formbuilder.git site/plugins/formbuilder
```

### Composer
If you use composer, you can quickly add FormBuilder to your project like this:
```
composer require cre8ivclick/formbuilder
```

****

## Documentation
For complete instructions on how to install, configure and use FormBuilder in your Kirby site, please refer to the **[Wiki area](https://gitlab.com/cre8ivclick/formbuilder/wikis/home)** of this project.

****

## Contributing
Please use the 'Issues' page of this project to report any bugs you find, and post ideas and feature requests.

We have tried to keep the code in the plugin reasonably simple, organised and well-commented. Feel free to fork this project, and send enhancements and bug fixes via merge requests. Please be aware, that we aim to keep the plugin _simple_ and _easy to maintain_.

## To-Do
- [ ] better submission log interface
- [ ] export submissions to CSV file
- [ ] storage of submissions into backend database

## License

FormBuilder is released under the MIT License - see the 'LICENSE.md' file included in this repository for full license text.

## Credits

The Cre8iv FormBuilder is developed by [Cre8iv Click](https://cre8iv.click), but would not have been possible to create without the work of others:

* FormBuilder's panel interface requires Tim Ötting's excellent [Kirby Builder Plugin](https://github.com/TimOetting/kirby-builder)
* the amazing [Sonja Broda](https://github.com/texnixe) helped troubleshoot ajax form submission and handling, through her professional and friendly advice in the [Kirby Forum ](https://forum.getkirby.com)
* our panel submission logging was based off some code examples from the very skilled [Pedro Borges](https://github.com/pedroborges)

repository: perpetualgrimace/strategicmedia

branch_name: refs/heads/main

repo_name: perpetualgrimace/strategicmedia


text:
# backfill

Download package.json dependency data to meta.json

[backfill](https://www.npmjs.org/package/backfill) looks for all `dependencies` in `package.json` and downloads registry metadata for each one to a file called `meta.json`.

## Installation

Download node at [nodejs.org](http://nodejs.org) and install it, if you haven't already.

```sh
npm install backfill --save
```

## Usage

To have backfill update `meta.json` automatically every time you install, add a `postinstall` script:

```json
{
  "name": "npm-collection-foo",
  "scripts": {
    "postinstall": "backfill"
  }
}
```

## Tests

```sh
npm install
npm test
```

## Dependencies

- [minimist](https://github.com/substack/minimist): parse argument options
- [pkgs](https://github.com/zeke/pkgs): Fetch npm registry metadata for a list of npm package names

## Dev Dependencies

- [mocha](https://github.com/mochajs/mocha): simple, flexible, fun test framework
- [nixt](https://github.com/vesln/nixt): Simple and powerful testing for command-line apps

## License

MIT

_Generated by [package-json-to-readme](https://github.com/zeke/package-json-to-readme)_

repository: IonicaBizauKitchen/backfill

repo_name: IonicaBizauKitchen/backfill


text:
# ACYKit

[![Build Status](https://www.bitrise.io/app/429993d68cdbb9b8/status.svg?token=XxLWJwSvyQTkJVs53Jbabw)](https://www.bitrise.io/app/429993d68cdbb9b8)
[![codecov](https://codecov.io/gh/archmagees/ACYKit/branch/master/graph/badge.svg)](https://codecov.io/gh/archmagees/ACYKit)
[![Version](https://img.shields.io/cocoapods/v/ACYKit.svg?style=flat)](http://cocoapods.org/pods/ACYKit)
[![License](https://img.shields.io/cocoapods/l/ACYKit.svg?style=flat)](http://cocoapods.org/pods/ACYKit)
[![Platform](https://img.shields.io/cocoapods/p/ACYKit.svg?style=flat)](http://cocoapods.org/pods/ACYKit)

## Example

To run the example project, clone the repo, and run `pod install` from the Example directory first.

## Requirements

platform: iOS 9.0

To use the pods, you need to install the [CocoaPods](http://cocoapods.org), the best way to install it is using [bundler](http://bundler.io). So run command in your command line:

```shell
$ cd YOUR_PROJECT_ROOT_DIR
$ gem install bundler
$ vim Gemfile
```
And add the following lines to Gemfile:
```ruby
source "https://gems.ruby-china.org/"
gem "cocoapods"
```
*  If you are NOT in China, the first line is NOT needed!

Save it, and run command:

```shell
$ bundle install
```
Now you can use [CocoaPods](http://cocoapods.org).

## Installation

ACYKit is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:

```ruby
pod "ACYKit"
```

If you just want to use some sub pods, you can add lines like this:

```ruby
pod 'ACYKit', :subspecs => ['ACYServiceLog', 'Core'], :git => 'git@github.com:archmagees/ACYKit.git
```

## Author

Arthur Liu<EMAIL_ADDRESS>
## License

ACYKit is available under the MIT license. See the LICENSE file for more info.

repository: archmagees/ACYKit

repo_name: archmagees/ACYKit


text:
This example is ported from the demos in
https://github.com/danshapero/predicates. These provide
nice visualizations of the robustness of the predicates in
this crate, as well as the non-robustness of a naive
implementation of these predicates.

The example computes the predicates in this crate, over a
2D grid of values for one of the inputs, while keeping the
rest of the inputs at fixed values.

For example, we compute the `orient2d` predicate on `(12.0,
12.0)`, `(c[i], c[j])`, `(24.0, 24.0)`; where `i, j` varies
in `0..256`, and `c[i]` is the `i`th float after `0.5`. In
other words, `c[i]` is obtained by starting at `0.5`, and
calling
[`nextafter`](https://docs.rs/float_extras/*/float_extras/f64/fn.nextafter.html)
`i` times.

The inputs are set up so that, if the predicates are
calculated exactly, the output is a `png` with gray values on
the main diagonal, black on the lower-left, and white on
the upper-right side of it. However, the naive versions show
that the predicate is not robust: it switches values on both
sides of the main diagonals, indicating the round-off errors.

repository: georust/robust

gha_language: Rust

repo_name: georust/robust


text:
---
title:  The Second and Third Seals
date:   28/01/2019
---

The change from the first seal to the second is stark. Now, war is the main result of the opening of the seal. The first seal was a victorious conquest, but now the seal reveals a lack of peace.

This idea of lack of peace, perhaps not just aims at war, but at the lack of peace and subsequent instability that comes as the gospel encounters opposition to its victorious initial proclamation.

The Third Seal shows a logical development to the seals unfolding. Victory is followed by war, and when war occurs, normally, food becomes scarce.

But the symbolism of food in contrast to its abundance, speaks not of physical food; but of the spiritual nature of how sparse the “bread of life” would become as time passed by.

The result of war is lack of bread. That will lead to the fourth seal, death.

repository: Adventech/sabbath-school-lessons

branch_name: refs/heads/stage

repo_name: Adventech/sabbath-school-lessons


text:
# neptune-mlflow
[![Build Status](https://travis-ci.org/neptune-ml/neptune-mlflow.svg?branch=master)](https://travis-ci.org/neptune-ml/neptune-mlflow)

![mlflow neptune.ai integration](docs/_static/mlflow_neptuneml.png)

# Overview
`neptune-mflow` integrates `mlflow` with `Neptune` to let you get the best of both worlds.
Enjoy tracking and reproducibility of `mlflow` with organization and collaboration of `Neptune`.

With `neptune-mlflow` you can have your `mlflow` experiment runs hosted in a beautiful knowledge repo that lets you invite and manage project contributors.

All you need to do is go to your `mlflow` project and run:

```
neptune mlflow --project USER_NAME/PROJECT_NAME
```

and you have your [experiments](https://ui.neptune.ai/jakub-czakon/mlflow-integration/experiments) organized:

![image](https://gist.githubusercontent.com/jakubczakon/f754769a39ea6b8fa9728ede49b9165c/raw/84068b5ff66719923006f798c21181cab6ec71df/mlflow_p1.png)

and easily [shareable](https://ui.neptune.ai/jakub-czakon/mlflow-integration/e/MLFLOW-10/output?path=artifacts%2F) with the world:

![image](https://gist.githubusercontent.com/jakubczakon/f754769a39ea6b8fa9728ede49b9165c/raw/2b3989499b90a93e75208d9f9df5fa537b82b7fd/mlflow_artifact.png)

# Documentation
See [neptune-mlflow docs](https://docs.neptune.ai/integrations/mlflow.html) for more info.

# Get started

## Register
Go to [neptune.ai](https://neptune.ai/?utm_source=github&utm_medium=repository&utm_campaign=integration-mlflow&utm_content=homepage) and sign up.

It is completely free for individuals and non-organizations, and you can invite others to join your team!

## Get your API token
In order to start working with Neptune you need to get the API token first.
To do that, click on the `Get API Token` button on the top left.

![image](https://gist.githubusercontent.com/jakubczakon/f754769a39ea6b8fa9728ede49b9165c/raw/e3776e605fea1fd5377c3ec748ba87b71cd8ef12/get_api_token.png)

## Set NEPTUNE_API_TOKEN environment variable
Go to your console and run:

```
export NEPTUNE_API_TOKEN='your_long_api_token'
```

## Create your first project
Click on `Projects` and the `New project`. Choose a name for it and whether you want it public or private.

![image](https://gist.githubusercontent.com/jakubczakon/f754769a39ea6b8fa9728ede49b9165c/raw/e3776e605fea1fd5377c3ec748ba87b71cd8ef12/new_project.png)

## Install lib

```bash
pip install neptune-mlflow
```

## Sync your mlruns with Neptune

```bash
neptune mlflow --project USER_NAME/PROJECT_NAME
```

## Explore and Share
You can now explore and organize your experiments in Neptune:

![image](https://gist.githubusercontent.com/jakubczakon/f754769a39ea6b8fa9728ede49b9165c/raw/84068b5ff66719923006f798c21181cab6ec71df/mlflow_p1.png)

And share it with anyone by sending a link to your project, experiment or chart if it is public
or invite people to your project if you want to keep it private!

![image](https://gist.githubusercontent.com/jakubczakon/f754769a39ea6b8fa9728ede49b9165c/raw/e3776e605fea1fd5377c3ec748ba87b71cd8ef12/invite.png)

# Getting help
If you get stuck, don't worry we are here to help.
The best order of communication is:

 * [neptune community spectrum](https://spectrum.chat/neptune-community)
 * [neptune-mlflow docs](https://docs.neptune.ai/integrations/mlflow.html)
 * [github issues](https://github.com/neptune-ml/neptune-mlflow/issues)

# Contributing
If you see something that you don't like you are more than welcome to contribute!
There are many options:

  * Participate in discussions on [neptune community spectrum](https://spectrum.chat/neptune-community)
  * Submit a feature request or a bug here, on Github
  * Submit a pull request that deals with an open feature-request or bug
  * Spread a word about neptune-contrib in your community

repository: endicotttechnology/neptune-mlflow

repo_name: endicotttechnology/neptune-mlflow


text:
### [CVE-2021-37980](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-37980)
![](https://img.shields.io/static/v1?label=Product&message=Chrome&color=blue)
![](https://img.shields.io/static/v1?label=Version&message=%3C%2094.0.4606.81%20&color=brighgreen)
![](https://img.shields.io/static/v1?label=Vulnerability&message=Inappropriate%20implementation&color=brighgreen)

### Description

Inappropriate implementation in Sandbox in Google Chrome prior to 94.0.4606.81 allowed a remote attacker to potentially bypass site isolation via Windows.

### POC

#### Reference
No PoCs from references.

#### Github
- https://github.com/ARPSyndicate/cvemon
- https://github.com/Mr-xn/Penetration_Testing_POC
- https://github.com/ZeusBox/CVE-2021-37980
- https://github.com/nomi-sec/PoC-in-GitHub
- https://github.com/winterwolf32/CVE-S---Penetration_Testing_POC-
- https://github.com/xuetusummer/Penetration_Testing_POC

repository: trickest/cve

gha_language: HTML

repo_name: trickest/cve


text:
---
data_non_statistical: true
goal_meta_link: https://unstats.un.org/sdgs/metadata/files/Metadata-05-0A-02.pdf
goal_meta_link_text: United Nations Sustainable Development Goals Metadata (pdf 634kB)
graph_type: line
indicator: 5.a.2
indicator_name: "Proportion of countries where the legal framework (including customary\
  \ law) guarantees women\u2019s equal rights to land ownership and/or control"
indicator_sort_order: 05-aa-02
layout: indicator
permalink: /5-a-2/
published: true
reporting_status: complete
sdg_goal: '5'
target: Undertake reforms to give women equal rights to economic resources, as well
  as access to ownership and control over land and other forms of property, financial
  services, inheritance and natural resources, in accordance with national laws
target_id: 5.a
graph_title: "Proportion of countries where the legal framework (including customary law)\
  \ guarantees women\u2019s equal rights to land ownership and/or control"
un_custodian_agency: FAO,World Bank, UN Women
un_designated_tier: '2'

national_indicator_available: Relevant Icelandic policies
national_geographical_coverage: Iceland
comments_limitations: Data follows the UN specification for this indicator. This indicator has been identified in collaboration with topic experts.

---

[Equal rights to property ownership is guaranteed in the Icelandic consitution](https://www.althingi.is/lagas/nuna/1944033.html). Section VII, article 65 states: "Women and men shall enjoy equal righs in all respects"

repository: hagstofan/open-sdg-data

branch_name: refs/heads/develop

gha_language: Shell

repo_name: hagstofan/open-sdg-data


text:
# Parallel N-Gram Analyze with MPI Library

## 1. Introduction

This is a project implemented as Midterm Project for the Parallel Computing Course. The main idea is under-
standing parallel computing. MPI was used for parallel computing. The goal of the project is writing a parallel program as an MPI application that finds 2-grams (bigram) in the given news dataset and shows frequency analysis in the shortest time.

### 1.1 MPICH

The Message Passing Interface Standard (MPI) is a message passing library standard. The goal of the Message
Passing Interface is to establish a portable, efficient, and flexible standard for message passing that will be widely
used for writing message-passing programs. MPICH is a high performance and widely portable implementation of the Message Passing Interface (MPI) standard. MPICH and its derivatives form the most widely used
implementations of MPI in the world.

### 1.2 N - Gram

N-gram is a method to find the count of the repetitions in a sequence. Using Latin numerical prefixes, an n-gram
of size 1 is referred to as a ”unigram”; size 2 is a ”bigram”; etc. The items will be examined can be phonemes,
syllables, letters, words or base pairs according to the application. The n-grams typically are collected from a
text of speech data.

## 2. Method

I have used the Master-Slave model on my project. The steps of the algorithm given on the following; The role of
The slave is computing frequencies of bigrams of their interval. When a slave completes its job, it sends results
to the master node. The role of Master is combining the results as slaves send. After each node ends its job,
Master print outputs to the console and exports outputs to the file.

## 3. Implementation

### 3.1 Arguments

The program needs two parameters. One for the input file path. It is the path of the file which contains the text that.
The program finds 2-grams (bigram) in the given input file and shows frequency analysis. The other argument is
the output file path. The outputs of the program will be exported to that file. To handle these arguments I have
used getopt. In arg.h header you can find the related method to handle arguments.

### 3.2 Algorithm

After the input and output files defined program load input file content into a global buffer that all nodes can
access it. Master has a 2D array which represents frequencies of each valid characters for my system. And also,
for each worker node, a 2D array declared and send via MPIIrecv method and starts a non-blocking wait with
MPIWait method. Then each worker node starts computing frequencies and stores results on its 2D array.
When a worker node completes its job, sends its 2D array that contains the computed frequencies to the Master
node via MPIIsend method. Then Master node combines the results and exports them to the file given as output
file argument. There are some challenges in the project. Let’s see them on following. Challenges

#### 3.2.1 Parallelization

The first challenge is computing the frequency values in a parallel manner. I decided to divide the data into
intervals. Each worker node is responsible for its interval. They start at its rank - 1 and increment by the number of nodes - 1. Let’s see an example case. Assume I have three nodes (one master - two slaves). The data must be divided for two slave nodes.

```
x: the first character of bigram
y: the second character of bigram
xi: index of character x
yi: index of character y

Node 1
Step 1: (xi, yi) = (0, 1)
Step 2: (xi, yi) = (2, 3)
Step 3: (xi, yi) = (4, 5)

Node 2
Step 1: (xi, yi) = (1, 2)
Step 2: (xi, yi) = (3, 4)
Step 3: (xi, yi) = (5, 6)
```

#### 3.2.2 Storing Results

Another challenge is storing frequency values in a structure. First, I thought about storing them in a map. Later
on, I decided to store it in a 2D array. The row and column index values of the array represent a character.
For the characters in the alphabet, there are 26 character exists. So my array at least has size 26x26. Of course,
if you could some extra characters that number may increase. The next challenge is mapping ASCII characters to
that index values. To do that I first map alphabetic characters into index values. The possible cases are given below;

```
c: Ascii code of the character
p: (1 to EXTRACHARACTERS.length)

Case a)For a-z (97−122) :c− 97
Case b)For A-Z (65−90) :c+ 32− 97
Case c).Extra Characters : (122 +p)− 97
```

#### 3.2.3 Combining Results

The combining part of each result computed by worker nodes is another challenging part of the project. After
each result combined under the master node, the results must be sorted. To do that, I map 2D array into a 1D array and sort it with using the BubbleSort algorithm. The challenge here is mapping 2D array to 1D array. As discussed above, row and column indexes represent characters. If I map the array directly, then I lose which
frequency belongs to which characters. So I defined a struct named bigramt which consists of first and second characters
and the frequency value of these two characters. Then I store the 1D array of bigramt.
The final step of the program is iterating over each bigramt in 1D array and print outputs to the console and
write outputs to the file.

## 4. Summary of Implementation

- In project.c; I implement the master-slave model on nodes. I have used MPI for communication between
 master and worker nodes.
- In arg.h header; I handle the arguments given to program with getopt.
- In readfile.h header; I implemented the file reading operation method.
- In writefile.h header; I implemented file writing operation, sorting and other helper methods. I defined
 a struct to store bigram chars and its frequency value to not lose while sorting.
- In filter.h header; I have used the intervals in ASCII table to store my bigram results as indexes. I map
 ASCII characters to indexes with asciitoindex method, indexes to ASCII characters with indextoascii method. I mapped uppercase characters to lowercase characters.
- In Makefile; I defined clean, build and run operations.
 - Build operation compiles the code with mpicc and creates executable under build directory.
 - Run operation runs the executable with mpirun with default 4 processes. The number of processes can assignable during make command as a parameter. Input and output file names are defined input.txt
 and output.txt as default.
 - Clean operation cleans the build directory.
- I have used built-in MPIWtime method to calculate spent times on each operation. Root node spent
 time, Worker nodes spent times, File read operation spent time and Total spent time calculated.

repository: arifsisman/parallel-n-gram-analyze

repo_name: arifsisman/parallel-n-gram-analyze


text:
Ask A President

Contributor(s):

Jessi Iler (https://github.com/InertialObserver)

Date: Started January, 2020

Description

The UI is simple and designed for utility rather than aesthetics.

Bug reports

If you discover any bugs, feel free to create an issue on GitHub. Please add as much information as possible to help us fixing the possible bug. We also encourage you to help even more by forking and sending us a pull request.

Known Bugs

License

MIT License. Copyright 2020

repository: InertialObserver/AskPresidents

repo_name: InertialObserver/AskPresidents


text:
---
name: Enhancement request
about: Enhancements
title: "[FIX]"
labels: enhancement
assignees: 'johannrichard'

---

**Describe the enhancement**
A clear and concise description of what the suggested enhancement is (Note this is to enhance existing functionality. Use the feature request for *new* functionality).

**Examples and context**
Why would this enhancement be useful, in what context?

**Additional context**
Add any other context here.

repository: rryter/homebridge-dingz

repo_name: rryter/homebridge-dingz


text:
# [Yahoo YSlow][1]

![yslow.png][2]

In this sample I'll help you set up [`grunt-yslow`][3] to run an analysis of your site whenever you like, through Grunt.

The configuration takes a URL and gives you a performance score.

Run the example using the code below.

```shell
grunt yslow:desktop
```

That's it!

![yslow-grunt.png][4]

[1]: http://developer.yahoo.com/yslow/
[2]: https://raw.github.com/buildfirst/buildfirst/master/images/yslow.png
[3]: https://github.com/andyshora/grunt-yslow
[4]: https://raw.github.com/buildfirst/buildfirst/master/images/yslow-grunt.png

repository: amikeliunas/buildfirst

repo_name: amikeliunas/buildfirst


text:
# work-day-scheduler

## Schedule time using the work day scheduler

[Deployed Application Link](https://melaniede.github.io/work-day-scheduler/)

## Summary
The work day scheduler allows you to plan for your day ahead. Use the input box to plan what's going on in your day and hit the save button to save the entry.  Visual queues were added to the input boxes. Grey means that hour blocked has passed, green means that hour block is upcoming, and red means the time is currently in that hour block.

### View of Jumbotron

### View of Schedule

## User Story

```
AS AN employee with a busy schedule
I WANT to add important events to a daily planner
SO THAT I can manage my time effectively
```

## Acceptance Criteria

```
GIVEN I am using a daily planner to create a schedule
WHEN I open the planner
THEN the current day is displayed at the top of the calendar
WHEN I scroll down
THEN I am presented with timeblocks for standard business hours
WHEN I view the timeblocks for that day
THEN each timeblock is color coded to indicate whether it is in the past, present, or future
WHEN I click into a timeblock
THEN I can enter an event
WHEN I click the save button for that timeblock
THEN the text for that event is saved in local storage
WHEN I refresh the page
THEN the saved events persist
```

repository: melaniede/work-day-scheduler

repo_name: melaniede/work-day-scheduler


text:
# TwitterDrasta
_Draṣṭā (द्रष्टा) meaning, the observer_

Helps forwarding [Twitter](https://twitter.com/) messages from a public twitter handle to a [Telegram](https://telegram.org/) channel

This bot can be used to check for recent tweets by a public twitter handle and forward it over a Telegram channel, using the Telegram bot API.

### Features

* Forward all recent tweets from a public Twitter handle to a Telegram channel
* Auto rollback to update tweets from the last tweet, if the bot was down for a few hours
* Can dig and update last N no of tweets or even all possible tweets
* Rate limit handled protection on Twitter and Telegram API
* [Heroku](https://www.heroku.com/) dynos compatible
* Support for custom tweet formatting over telegram

## Requirements

##### For running the script

- [Python](https://www.python.org/downloads/) 3.8 or above
- [pip](https://pip.pypa.io/en/stable/installing/) 20.1 or above (To installs the dependencies below)
- [Tweepy](https://github.com/tweepy/tweepy) 3.9 or above
- [python-telegram-bot](https://github.com/python-telegram-bot/python-telegram-bot) 12.8 or above
- [psycopg2](https://github.com/psycopg/psycopg2) 2.8 or above

##### For making the bot work

- [Twitter developer](https://developer.twitter.com/) API key and API secret:
- Twitter public handle's username
- [Telegram Bot](https://core.telegram.org/bots#3-how-do-i-create-a-bot) API key
- [Telegram Channel](https://telegram.org/tour/channels) Username/ID
- [PostgreSQL Server](https://www.postgresql.org/download/) (Optional: only for persistence of last tweet, and for digging and updating old tweets)

## Running

First, install the required dependencies if you haven't already installed. The last three dependencies can be installed using **pip** (using a terminal in this directory) as follows.

```bash
pip install -r requirements.txt
```

Now, create a json based config file for the program, with all required values for all API keys and usernames (put usernames without '@'). The example config file `config.json.example` will help you making your own config file, make sure the config file is in json format and ends with `.json` file extension. For ex: `my-config.json`, `/some/path/my-config.json`(default: `config.json`, in the same directory as the script)

**Example config.json**

```json
{
    "twitter_username" : "PASTE-THE-TWITTER-USERNAME-HERE",
    "twitter_apikey" : "PASTE-THE-TWITTER-API-KEY-HERE",
    "twitter_api_secret" : "PASTE-THE-TWITTER-API-SECRET-HERE",
    "telegram_channel" : "PASTE-THE-TELEGRAM-CHANNEL-USERNAME-HERE",
    "telegram_bot_apikey" : "PASTE-THE-TELEGRAM-BOT-API-KEY-HERE",
    "seek_rate" : 2,
    "max_rollback" : 200,
    "ratelimit_wait" : 16,
    "welcome_text" : "WRITE-A-WELCOME-MESSAGE-FOR-ANYONE-WHO-STARTS-THE-TELEGRAM-BOT",
    "tweet_format" : "{text}\n{url}\n{time}\n",
    "reply_format" : "\u21aa <b>{mentions}</b>\n{text}\n{url}\n{time}\n",
    "retweet_format" : "\ud83d\udd01  <b>{username}{mentions}</b>\n{text}\n{url}\n{time}\n"
}
```

**Config Values**

| **Key**               | **Description**                                                                                |
|:---------------------:|-------------------------------------------------------------------------------------------------------|
| `twitter_username`    | Twitter username of the public handle without `@` (Required)                                          |
| `twitter_apikey`      | Twitter developer API Key (Required)                                                                  |
| `twitter_api_secret`  | Twitter developer API Secret (Required)                                                               |
| `telegram_channel`    | Telegram channel username (Required)                                                                  |
| `telegram_bot_apikey` | Telegram Bot API Key (Required)                                                                       |
| `seek_rate`           | The time in minutes to wait before seeking newer tweets and upadating on telegram (default: 1)        |
| `max_rollback`        | Maximum no of previous tweets to obtain if the last tweet is not a recent one (default: 50)           |
| `ratelimit_wait`      | The time in minutes to wait before trying again when rate-limited by the Twitter server (default: 15) |
| `welcome_text`        | Simple welcome / greeting text for the users who visit the Telegram Bot                               |
| `tweet_format`        | Formatting for any normal tweet text which would be sent to the Telegram Channel                      |
| `reply_format`        | Formatting for the tweet text that is a reply to some other tweet                                     |
| `retweet_format`      | Formatting for the tweet text that is a retweet of some other tweet                                   |
| `db_name`             | Database name on the Postgres server (default: test or with DATABASE_URL environment var)             |
| `db_host`             | Postgres server hostname / Ip address (default: localhost or with DATABASE_URL environment var)       |
| `db_port`             | Postgres server port number (default: 5432 or with DATABASE_URL environment var)                      |
| `db_user`             | Username for authentication on Postgres server (default: user or with DATABASE_URL environment var)   |
| `db_password`         | Password for authentication on Postgres server (default: pass or with DATABASE_URL environment var)   |

Next, Make sure the PostgreSQL server is setup with a username and password and it's running (if you want to use the database).

The bot can be configured to use the database server either by hardcoding the values, or through defining `DATABASE_URL` as environment variable which holds the URI for the postgresql database.

The format for URI for `DATABASE_URL` should be like,

```html
postgres://<user>:<password>@<hostname>:<port>/<database>
```

With all setup, start the bot feeding the path of your config file,

```bash
python TwitterDrasta.py --config /some/path/my-config.json
```

**OR**

```bash
python TwitterDrasta.py --config my-config.json
```

Running using the `DATABASE_URL` environment variable on the same line,

```bash
DATABASE_URL="postgres://<user>:<password>@<hostname>:<port>/<database>" python TwitterDrasta.py --config my-config.json
```

#### Setting up on Heroku

The bot is already compatible with heroku dynos, and this repository already contains files for **heroku/python** buildpack, `requirements.txt`, `runtime.txt` and `Procfile`.

Just create a config file as told above and update the config filename in `Procfile` arguments (default filename: `config.json`) and push the contents to heroku git.

#### Digging and Updating old tweets

This operations is not automatic and it requires a configured PostgreSQL Server running. Make sure `DATABASE_URL` is defined in the environment variables or the database configurations are hardcoded into the script.

And, this operation may take a lot of time, if the no of tweets to be dug are high.

To dig and update last N no of tweets,

```bash
python TwitterDrasta.py --config my-config.json -g N
```

To dig and update all possible tweets,

```bash
python TwitterDrasta.py --config my-config.json -w
```

#### Debugging

To run the bot in debug mode, just pass the flag `-d`  or `--debug` in the arguments.

```bash
python TwitterDrasta.py --debug --config my-config.json
```

## Contributing

All kinds of contributions towards the improvement and enhancement of this project are welcome. Any valuable pull request for fixing an issue or enhancing the project are welcome. You can even help by [reporting bugs](https://github.com/darajnish/twitterdrasta/issues/new/choose) and creating issues for suggestions and ideas related to new improvements and enhancements.

## License

This project is under the [MIT License](LICENSE)

repository: waftz/twitterdrasta

repo_name: waftz/twitterdrasta


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

### Description

An issue was discovered in the Divi Builder plugin, Divi theme, and Divi Extra theme before 4.5.3 for WordPress. Authenticated attackers, with contributor-level or above capabilities, can upload arbitrary files, including .php files. This occurs because the check for file extensions is on the client side.

### POC

#### Reference
- https://wpscan.com/vulnerability/10342
- https://www.wordfence.com/blog/2020/08/critical-vulnerability-exposes-over-700000-sites-using-divi-extra-and-divi-builder/

#### Github
No PoCs found on GitHub currently.


text:
# CRAMTools is no longer supported. Please use Samtools: http://www.htslib.org/.

CRAMTools is a set of Java tools and APIs for efficient compression of sequence
read data. Although this is intended as a stable version the code is released
as early access. Parts of the CRAMTools are experimental and may not be
supported in the future.

http://www.ebi.ac.uk/ena/about/cram_toolkit
Version 3.0

### Change log:

* Switched to htsjdks as backend, which enables CRAM3 features.
* Please refer to http://samtools.github.io/hts-specs/CRAMv3.pdf for the CRAM
  file specification.
* A pre-built cramtools-3.0.jar file is included in the repository.

### Input files:
1. Reference sequence in fasta format `<fasta file>`
1. Reference sequence index file `<fasta file>.fai` created using samtools
   (`samtools faidx <fasta file>`)
1. Input BAM file `<BAM file>` sorted by reference coordinates
1. BAM index file `<BAM file>.bai` created using samtools (`samtools index <BAM
   file>`)
1. Download and run the program: download the prebuilt runnable jar file from
   https://github.com/enasequence/cramtools/blob/master/cramtools-3.0.jar?raw=true
1. Execute the command line program: `java -jar cramtools-3.0.jar`. Usage is
   printed if no arguments were given

### To convert a BAM file to CRAM:

```
java -jar cramtools-3.0.jar cram \
    --input-bam-file <bam file> \
    --reference-fasta-file <reference fasta file> \
    [--output-cram-file <output cram file>]
```

### To convert a CRAM file to BAM:

```
java -jar cramtools-3.0.jar bam \
    --input-cram-file <input cram file> \
    --reference-fasta-file <reference fasta file> \
    --output-bam-file <output bam file>
```

### To build the program from source:

1. To check out the source code from github you will need git client:
   http://git-scm.com/
1. Make sure you have java 1.7 or higher: http://openjdk.java.net/ or
   http://www.oracle.com/us/technologies/java/index.html
1. Make sure you have ant version 1.7 or higher: http://ant.apache.org/
1. Run the following commands

```
# Clone the repository to your local directory:
git clone https://github.com/enasequence/cramtools.git

# Change to the directory:
cd cramtools

# Build a runnable jar file:
ant -f build/build.xml runnable

# Run cramtools
java -jar cramtools-3.0.jar
```

### Picard integraion

Picard tools have been removed from cramtools because Picard supports CRAM via
htsjdk.

### Reference sequence discovery

cramtools supports the following reference discovery mechanism:

1. check local file provided in the command line (`-R` or
   `--reference-fasta-file` option)
2. download sequences from the ENA reference registry using MD5 checksums from
   the SAM header
3. access local cache using `REF_CACHE/REF_PATH` environment variables. Please
   refer to http://www.htslib.org/doc/samtools.html for more details.

### The following tools have been included into this release

* cram: (SAM/BAM to CRAM conversion)
* bam: (CRAM to SAM/BAM conversion)
* index: (CRAM indexing, can produce CRAI or BAI index)
* merge: (merges several SAM/BAM/CRAM files into one)
* fastq: (dump reads in fastq format)
* fixheader: (fix CRAM file header, namely reference sequence MD5 checksums)
* getref: (download all reference sequences mentioned in a CRAM file)
* qstat: (produce some basic quality score stats for a CRAM file)

The usage can be accessed by calling cramtools with the corresponding command
as a single argument.

### Lossy model

Bam2Cram allows to specify lossy model via a string which can be composed of
one or more words separated by '-'.

Each word is read or base selector and quality score treatment, which can be
binning (Illumina 8 bins) or full scale (40 values).

##### Here are some examples:

* N40-D8: preserve quality scores for non-matching bases with full precision,
  and bin quality scores for positions flanking deletions.
* m5: preserve quality scores for reads with mapping quality score lower than 5
* R40X10-N40: preserve non-matching quality scores and those matching with
  coverage lower than 10
* *8: bin all quality scores

### Selectors:

* R: bases matching the reference sequence
* N: aligned bases mismatching the reference, this only applies to 'M', '=' (EQ) or 'X' BAM cigar elements.
* U: unmapped read
* Pn: pileup: capture all bases at a given position on the reference if there are at least n mismatches
* D: read positions flanking a deletion
* Mn: reads with mapping quality score higher than n
* mn: reads with mapping quality score lower than n
* I: insertions
* *: all

By default no quality scores will be preserved.


text:
[![ko-fi](https://www.ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/K3K11VCDK)
Please consider making a one time or recurring contribution to help continue to fuel module updates. Ko-Fi contributions are one of the positive ways I actually know if what I write is being used and if it's valuable for the community.

# Changelog
### 1.1.2
- Thanks to @Javierriveracastro for adding code for fatigue and wound icons
- Fixed bug with 0.16 of SWADE that opened skill sheets on AE toggle
- _Hopefully_ fixed the manifest problem
- Fixed the hidden and show classes overwriting core foundry classes (this would mess up the combat tracker hidden feature for example)

### 1.1.1
- Active Effects on skills now apply when you drag + drop an item onto the sheet, and can handle both die and modifier on the same skill in the same effect
### 1.1.0
- Active Effects on Skills: If you toggle this setting on, you can create active effects on skills by setting the value to "m!Skillname" to change the modifier of a skill or "d!Skillname" for die type. It's only additive, so if you want to *reduce* the value, use a negative number.
- Status Effects linking: If you turn this setting on, tokens will sync their core statuses (Shaken, Stunned, Bound, Entangled, Vulnerable, Distracted) between the token and the sheet (switching on one will switch on the other, and vice versa).

### 1.0.2
- Compendium Patcher upgraded to fuzzy match Hindrances for better compatibility with savaged us importer.

### 1.0.1
- Compendium Patcher issue #1 and #4 fixed (arcane background for powers preserved, and patched items replaced by old ones after reload)
- Updated Foundry compatible version to 0.79

### 1.0
- NPC Randomizer Inital Release
- Compendium Patcher Inital Release

# Description
SWADE Toolkit is the successor for SWADE Macros Simple. It includes a variety of tools (both macros and other more complicated Quality of Life improvements) that help with making the SWADE experience just a little bit better.

All the features can be toggled on/off in the settings. If you have a problem with anything, please ask in the #swade channel in the Foundry Discord.

## NPC Randomizer

![NPC_Randomizer](readme_assets/npc_randomizer.png)

Select an actor template, pick compendiums to roll on, and it'll populate the actor with random items. It'll keep everything from the template except anything the SWADE system considers an "item"

## Compendium Patcher

![Compendium_Patcher](readme_assets/compendium_patcher.png)

Pick a folder of actors, pick compendiums to use to patch them.
It'll go through each actor, and if it finds an item in the compendiums you've selected that matches the name of the actor's item, it'll replace it with the compendium item.

Useful for updating descriptions and other info for imported actors that you might otherwise have as extensive compendiums.

# License
MIT License. Do what you will. PRs welcome.

repository: Wigginns/fvtt-swade-toolkit

repo_name: Wigginns/fvtt-swade-toolkit


text:
## `~littel-ponnys`
Today, ~ponnys started looking at porting Eyre over to Ford-turbo. He got some
basic integration done, to the point that error messages are being delivered
from Ford-turbo to the browser. Current ongoing work is finding all the places
where `tree` doesn't compile with Ford-turbo. For instance, we no longer have
`/%` or `/#`, so those need to be removed. Likewise, `tree` references marks
which don't have an existing mark file, which is another thing that will have
to be fixed.

Meanwhile, ~rovnys worked on testing our cache wiping, along with working with
~fodwyt on compiler performance. (Changing how we did linking in Hoon has
caused a serious boot time performance regression that needs to be addressed.)

repository: urbit/proposals

repo_name: urbit/proposals


text:
# GameOn Client (Quasar)

Front end code base for my GameOn app. Built with [Vue](https://github.com/vuejs/vue) and the [Quasar](https://github.com/quasarframework/quasar) framework.

This is a fairly small app, so I don't think there is too much to say here. All of the UI stuff is built on the goodies that come with Quasar, so the look and feel is "Material-like." It uses Vue Router, Vuex, Axios, and handful of other "community favorites" here and there.

Tests are admittedly in a pretty sad state. Quasar itself does not actually come with tests ready to go, so I kind of had to shoehorn them in from the Vue CLI template, but I didn't really end up having the motivation to do much with them for such a small, low-priority project.

If you're looking to download it and run it, it should be fairly straightforward.

- `git clone`
- `npm install`
- `npm run dev`

The biggest "gotcha" will be getting a backend set up for it to communicate with. If you wish to try, the current back end code base (Django REST Framework) can be found [here](https://github.com/gargrave/gameon-server).

repository: gargrave/gameon-client-quasar

repo_name: gargrave/gameon-client-quasar


text:
# Lab 0. Set up your kubernetes environment

For the hands-on labs in this tutorial repository, you will need a kubernetes cluster. You can either create one as-a-service from the IBM Cloud Kubernetes Service, use a hosted environment or install one locally on your workstation.

## Use the IBM Cloud Kubernetes Service

You will need either a paid IBM Cloud account or an IBM Cloud account which is a Trial account (not a Lite account). If you have one of these accounts, use the [Getting Started Guide](https://cloud.ibm.com/docs/containers?topic=containers-getting-started) to create your cluster.

 As these are free services, they can sometimes experience periods of limited availablity/quality. On the other hand, they can be a quick way to get started!

* [Kubernetes playground on Katacoda](https://www.katacoda.com/courses/kubernetes/playground) This environment starts with a master and worker node pre-configured. You can run the steps from Labs 1 and onward from the master node.

* [Play with Kubernetes](https://labs.play-with-k8s.com/) After signing in with your github or docker hub id, click on **Start**, then **Add New Instance** and follow steps shown in terminal to spin up the cluster and add workers.

## Set up on your own workstation

If you would like to configure kubernetes to run on your local workstation for non-production, learning use, there are several options.

* [Minikube](https://kubernetes.io/docs/setup/learning-environment/minikube/) This solution requires the installation of a supported VM provider (KVM, VirtualBox, HyperKit, Hyper-V - depending on platform)

* [Kubernetes in Docker (kind)](https://kind.sigs.k8s.io/) Runs a kubernetes cluster on Docker containers

* [Docker Desktop (Mac)](https://docs.docker.com/docker-for-mac/kubernetes/) [Docker Desktop (Windows)](https://docs.docker.com/docker-for-windows/kubernetes/) Docker Desktop includes a kubernetes environment

* [Microk8s](https://microk8s.io/docs/) Installable kubernetes packaged as an Ubuntu `snap` image.

## Instructions for those with provided web terminal and cluster
**Interact With Your Cluster From Provided Web Terminal**

Note: In the provided web terminal, the CLI downloads required will be provided.

1. Open up web terminal and sign in: ``ibmcloud login -a cloud.ibm.com -r us-east -g PNC``

2. Type in ``ibmcloud ks clusters`` and locate YOUR cluster.

3. Locate your named cluster and type in ``ibmcloud ks cluster-config <YOURCLUSTERNAME>``

4. Copy and paste your Kube configuration file in the yellow text directly into your terminal to export.

5. Run ``kubectl cluster-info`` and your cluster info should show up. If not, rinse and repeat up to step 1.

Head to [lab 1](https://github.com/IBMCloud-Labs/kube101-1/tree/master/Lab1)

## Helpful links

1. Graphs and explanation of Kubernetes in more detail: https://github.com/IBM/kube101/tree/master/workshop
2. Kubernetes explained video: https://www.youtube.com/watch?v=aSrqRSk43lY


text:
# Overview

SDK provides Firewall Manager that allows you to create, list and delete firewall rules on your Forge servers.

# Usage

Documentation assumes that you've already retrieved server instance from `Forge` collection.

All operations are performed via `Laravel\Forge\Firewall\FirewallManager` instance.

All methods return either instance of `Laravel\Forge\Firewall\FirewallRule` or array of `Laravel\Forge\Firewall\FirewallRule` instances.

## Create new rule

```php
<?php

use Laravel\Forge\Firewall\FirewallManager;

$firewall = new FirewallManager();

$rule = $firewall->create('rule-name')->usingPort(88)->on($server);

// You can also use the optional usingIp() function to bind the rule to a specific IP
$rule = $firewall->create('rule-name')->usingIp('<IP_ADDRESS>')->usingPort(88)->on($server);

```

## List rules

```php
<?php

use Laravel\Forge\Firewall\FirewallManager;

$firewall = new FirewallManager();

$rules = $firewall->list()->from($server);

foreach ($rules as $rule) {
    echo 'Rule '.$rule->name().' is using port #'.$rule->port().'.';
}
```

## Get single rule by ID

```php
<?php

use Laravel\Forge\Firewall\FirewallManager;

$firewall = new FirewallManager();

$ruleId = 1234;
$rule = $firewall->get($ruleId)->from($server);

echo 'Rule '.$rule->name().' is using port #'.$rule->port().'.';
```

## Delete rule

```php
<?php

use Laravel\Forge\Firewall\FirewallManager;

$firewall = new FirewallManager();

$ruleId = 1234;
$rule = $firewall->get($ruleId)->from($server);

if ($rule->delete()) {
    echo 'Rule '.$rule->name().' was deleted.';
}
```

[Back to Table of Contents](./readme.md)

repository: tzurbaev/laravel-forge-api

repo_name: tzurbaev/laravel-forge-api


text:
[![GitHub Issues](https://img.shields.io/github/issues/44t4nk1/Snek.svg)](https://github.com/44t4nk1/Snek/issues)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)

## Basic Overview

Made a basic Snake Flutter Game.

## Latest Development Changes
```bash
git clone https://github.com/44t4nk1/Snek
```

#### Installing

```text
git clone https://github.com/44t4nk1/Snek
------------------ FOR ANDROID --------------------
flutter build apk
go to build/app/outputs/apk/release/app-release.apk
install the APK on your android device
-------------------- FOR iOS ----------------------
Connect your iPhone to your Compiler
Run and build the app
```

#### Pending Features
- Dynamic Speed
- Custom Themes
- Different Modes


text:
# Snapshot report for `test/index.js`

The actual snapshot is saved in `index.js.snap`.

Generated by [AVA](https://avajs.dev).

## song

> Snapshot 1

    {
      author: 'Beauty Brain',
      date: '2014-01-27T16:19:55.000Z',
      description: 'Thanks for 5.000 likes on https://www.facebook.com/BeautyBrainMusic :D <3 <3 <3',
      image: 'https://i1.sndcdn.com/artworks-000069142357-nwttc6-t500x500.jpg',
      lang: 'en',
      logo: 'https://a-v2.sndcdn.com/assets/images/sc-icons/ios-a62dfc8f.png',
      publisher: 'SoundCloud',
      title: 'Swag Bandicoot [FREE DOWNLOAD]',
      url: 'https://soundcloud.com/beautybrainsp/beauty-brain-swag-bandicoot',
    }

repository: microlinkhq/metascraper

repo_name: microlinkhq/metascraper


text:
# Modelling virtual tracer transport with Roger using climate projections and land cover scenarios

- `pre_processing.py`: Prepare the input data and plot delta changes of climate signal
- `write_moab_jobs.py`: Generate job scripts for computation on BinAC cluster using the MOAB workload manager
- `write_slurm_jobs.py`: Generate job scripts for computation on BwUniCluster 2.0 cluster using the SLURM workload manager
- `submit_*.sh`: Script to submit batch jobs
- `plot_time_series.py`: Plot time series
- `calculate_delta_changes.py`: Calculate delta changes for near future (2040 - 2060) and far future (2080 - 2100)
- `calculate_change_attribution.py`: Quantify change attribution of soil physical properties and climate signal using linear models

## climate_projections
Contains climate projections from regional climate models. We use the data of the following climate projections:
- CCCma-CanESM2 CCLM4-8-17 ("dry" and "warm")
- MPI-M-MPI-ESM-LR RCA4 ("wet" and "cool")

## dwd
Contains daily minimum and maximum air temperature measured at DWD stations

---

The following folders contain the model setups. Each folder contains a subfolder
`input` from which the model reads the input data and a Python-script with the
implementation of the model setup and the corresponding job-script(s) for computation
on a cluster, and Python-scripts for post-processing. If the file name of the
job scripts contains `_gpu` computations run on GPU.

## input/land_cover_scenario
- grass
- Corn
- Corn and catch crop
- Crop rotation (winter barley, catch crop, sugar beet, winter wheat)

## Hydrological simulations
### svat
- `svat.py`: SVAT-model setup
- `svat_crop.py`: SVAT-CROP-model setup
- `svat_*.sh`: Job scripts to run the SVAT-model
- `svat_crop_*.sh`: Job scripts to run the SVAT-CROP-model
- `merge_output.py`: Merges model output into a single file

## Transport simulations
### svat_transport
- `svat.py`: SVAT-model setup
- `svat_crop.py`: SVAT-CROP-model setup
- `svat_*.sh`: Job scripts to run the SVAT-model
- `svat_crop_*.sh`: Job scripts to run the SVAT-CROP-model
- `merge_output.py`: Merges model output into a single file

## Workflow

1. Make the input data ready for the simulations:
```
python pre_processing.py
```

2. Here, I provide an example shell scripts can be generated. These scripts can be submitted to a computing cluster:
```
python write_slurm_jobs.py
```

3. Run the model to simulate hydrological fluxes and storages by submitting the model script to a computing cluster:
```
./submit_svat_grass_jobs_slurm.sh
./submit_svat_corn_jobs_slurm.sh
./submit_svat_corn_catch_crop_jobs_slurm.sh
./submit_svat_crop_rotation_jobs_slurm.sh
```

4. Merge the model output into single files:
```
cd svat
python merge_output.py
```

5. Run the model to simulate virtual tracer concentrations and travel times by submitting the model script to a computing cluster:
```
./submit_svat_grass_transport_jobs_slurm.sh
./submit_svat_corn_transport_jobs_slurm.sh
./submit_svat_corn_catch_crop_transport_jobs_slurm.sh
./submit_svat_crop_rotation_transport_jobs_slurm.sh
```

6. Merge the model output into single files
```
cd svat_transport
python merge_output.py
```

7. Plot the time series:
```
python plot_time_series.py
```

8. Calculate the delta changes of the simulated variables:
```
python calculate_delta_changes.py
```

9. Quantify the change attribution:
```
python calculate_change_attribution.py
```

repository: Hydrology-IFH/roger

gha_language: Python

repo_name: Hydrology-IFH/roger


text:
---
layout: post
title: Using an Azure function to get Octopus deployment notifications in Slack
excerpt: "If you want to be notified in Slack when an Octopus deployment occurs it's not just as simple as plugging in the Slack webhook url into Octopus. You need to use an intermediary that can translate the Octopus json format into the Slack json format. This post gives a high-level overview of how an Azure function can be used to do this."
date: 2018-03-29
categories: [octopus deploy, deployment, slack, azure, azure functions, dotnet]
comments: true
share: true
firehose: true
image:
  feature: octopus-deploy-slack-notifications/octopus.png
---

# Introduction

Ideally deploying code into production should be trivial. By the time a release gets to this stage it should have gone through a variety of testing phases (_unit_, _integration_, _UAT_ etc). It will have also been promoted through a variety of environments that increasingly are more _production like_. The reality is that production deployments still require a bit of special attention from the team. Developers might monitor the logs more keenly after a production deployment or Team X may wish to be notified when Team Y deploys something for example. So keeping a team informed of deployments is an important part of the overall process.

I recently had a need to alert the team when a production deployment, of the many projects we care about, occurred. Slack is our messaging platform of choice so we wanted Octopus to drop a notification into our Slack channel when a new production deployment started, completed or failed.

## Octopus Subscriptions

Out of the box, Octopus has [subscriptions](https://octopus.com/docs/administration/subscriptions). A subscription allows you to define the scope of the alerts by picking which projects and events you wish to be alerted about. A subscription allows you to respond to these events in two ways: email or webhook.

## _Email_

Pretty straight forward. When an event occurs that's within your defined scope the nominated team members will receive an email containing the details of the events.

An example of the received email.

## _Webhook_

Email is useful but a Slack notification was what I was after so the webhook option sounded ideal. Slack supports webhook integrations out of the box, unfortunately though the json format of the Octopus subscription is not directly compatible with Slack so we need an intermediary that can accept the Octopus json, transform it and pass it off to the Slack webhook url.

### Zapier

The Octopus folks have [published an article](https://octopus.com/blog/subscriptions) on this subject. It involves using [Zapier](https://zapier.com/apps/integrations) as the intermediary to transform the json. I wasn't too keen on this solution. The Zapier free tier is limited to sending message at most every 15 minutes and the transform functionality was awkward too and I couldn't really get it to work how I wanted. In the end I decided I wanted more control over the process. I decided on an _Azure function_.

# Azure Function

I decided to write an Azure function that could be configured as the target of the Octopus subscription and would transform the json to the Slack format.

It's fairly simple, the basic flow is:

- Extract the json from the incoming request and de-serialize into an Octopus subscription object.
- Construct a slack message object and serialize to json.
- POST the json to the Slack webhook url.

## Incoming Octopus Message

To get an example of the Octopus json format, I used [http://webhook.site/](http://webhook.site/). This is a handy website gives you a unique url that you can use as test webhook endpoint. Anything you post to it will be captured and you can inspect the contents of the request body received. I configured my Octopus subscription to post to my webhook.site url and triggered a deployment of a test project. This is what I received...

### Octopus Json Payload

This is the Octopus subscription json format. Actually there was more to it than this but it was mostly extraneous information that I wasn't interested in. The json below is the parts that I wanted to use.

{% highlight json %}
{
"Timestamp": "2018-03-23T01:54:08.5219596+00:00",
"EventType": "SubscriptionPayload",
"Payload": {
"BatchProcessingDate": "2018-03-23T11:54:05.7407094+10:00",
"Subscription": {
"Name": "Notify Team of Deployments"
}
},
"Event": {
"Category": "DeploymentSucceeded",
"Username": "pmcilreavy",
"Occurred": "2018-03-23T00:42:01.0448185+00:00",
"Message": "Deploy to Dev succeeded for test-proj release <IP_ADDRESS> to Dev"
}
}
}
{% endhighlight %}

### Converting to C# objects

I was able to use [https://jsonutils.com/](https://jsonutils.com/) to convert the Octopus json into C# classes.

This gave me some nice C# classes ready to go, already annotated with with Newtonsoft JsonProperty attributes.

{% highlight csharp %}
public class Subscription
{

    [JsonProperty("Name")]
    public string Name { get; set; }

}

public class Payload
{

    [JsonProperty("BatchProcessingDate")]
    public DateTime BatchProcessingDate { get; set; }

    [JsonProperty("Subscription")]
    public Subscription Subscription { get; set; }

}

public class Event
{

    [JsonProperty("Category")]
    public string Category { get; set; }

    [JsonProperty("Username")]
    public string Username { get; set; }

    [JsonProperty("Occurred")]
    public DateTime Occurred { get; set; }

    [JsonProperty("Message")]
    public string Message { get; set; }

}

public class OctopusSubscriptionEvent
{

    [JsonProperty("Timestamp")]
    public DateTime Timestamp { get; set; }

    [JsonProperty("EventType")]
    public string EventType { get; set; }

    [JsonProperty("Payload")]
    public Payload Payload { get; set; }

    [JsonProperty("Event")]
    public Event Event { get; set; }

}
{% endhighlight %}

So far so good. I was able to grab the incoming json string from the request and de-serialize it to C# objects. Now to construct a Slack message payload.

## Outgoing Slack Message

Slack has a handy api tool called the [message builder](https://api.slack.com/docs/messages/builder) that allows you to experiment with the json and see how your message will look when it's delivered to a channel. Here is roughly what I ended up with.

### Converting to C# objects

Back again to [https://jsonutils.com/](https://jsonutils.com/) to convert the Slack json into C# classes.

{% highlight csharp %}
public class Attachment
{
[JsonProperty("fallback")]
public string Fallback { get; set; }

    [JsonProperty("color")]
    public string Color { get; set; }

    [JsonProperty("pretext")]
    public string Pretext { get; set; }

    [JsonProperty("text")]
    public string Text { get; set; }

    [JsonProperty("footer")]
    public string Footer { get; set; }

    [JsonProperty("footer_icon")]
    public string FooterIcon { get; set; }

    [JsonProperty("ts")]
    public int Ts { get; set; }

}

public class SlackPayload
{

    [JsonProperty("channel")]
    public string Channel { get; set; }

    [JsonProperty("attachments")]
    public IList<Attachment> Attachments { get; set; }

}
{% endhighlight %}

Sweet, so I'm able to build a Slack message from the Octopus object and all I need to do now is post it to the Slack WebHook Url.

### Slack WebHook

No need to explain this in great detail, but generally you can just go to [https://yourteamname.slack.com/apps/manage/custom-integrations](https://yourteamname.slack.com/apps/manage/custom-integrations) and from there you can create a new webhook integration. Out of this you'll get a unique webhook url that will accept the message json and create the notification in the specified channel.

Here is what my Slack notification ended up looking like...

## Security

You wouldn't want just anyone being able to post a message into your Slack channel if they found out your webhook url. It's ~~not exactly~~ definitely not foolproof, but I made at least some attempt to secure the Azure function endpoint. The Octopus subscription configuration screen allows you to specify a custom http header key/ value that will be sent with every request. So all I do is set a key called `SUBSCRIPTION_EVENT_TOKEN` to a know guid value that I then check for on the Azure function side. If they don't match then I reject the request.

# Code

I've deliberately not shown much (if any) of the actual Azure function code in this post. But I've made the code available on [GitHub](https://github.com/pmcilreavy/OctopusSubscriptionHandlerAzureFunction). It's a work in progress, so feel free to use it with the usual caution. So far I've only implemented my specific Slack message requirement although it would be pretty easy to plug in other implementations that sent a message to other systems.

[https://github.com/pmcilreavy/OctopusSubscriptionHandlerAzureFunction](https://github.com/pmcilreavy/OctopusSubscriptionHandlerAzureFunction)

# Alternatives

- There is an Octopus add-in which can post a message direct to a Slack channel but it's something you have to configure for every project as a step in the project deployment process. This wasn't feasible for me as we have hundreds of individual projects and I didn't want to have to modify them all.

- I believe Octopus Deploy is [talking about making Slack integration a first class citizen](https://github.com/OctopusDeploy/Issues/issues/3395) and may allow use directly from a subscription without the need for an intermediary so I'll keep a lookout for that. For now, my Azure function solution is working well for me.


text:
Did you ever wonder when planning a party, when will the songs in the playlist play? Wonder no more! Now you can plan for your playlist songs to play when you intend them to, by giving this script, the start time of your party! Steps to get running:

1. Clone the repo and cd to the directory
2. ```npm install ```
3. ```touch spotify-token-info.env ```
4. Edit spotify-token-info.env, with any editor of your choice, as follows:

```
CLIENT_ID=[YOUR_CLIENT_ID]
CLIENT_SECRET=[YOUR_CLIENT_SECRET]
PARTY_DATE=2019-02-23T23:30
PLAYLIST_URI=[The URI you get when you click on Share Playlist > Spotify URI]
```

4. ```node index.js ```

repository: isklikas/spotify-playlist-onTime

repo_name: isklikas/spotify-playlist-onTime


text:
# Ui Conifg Dev Server

## Prerequisites

- Docker

## Running

The config dev server comes with 2 cli commands:

- startUiConfigServer
- stopUiConfigServer

**Note:** This records the running information inside a temp folder under 'repo/root/node_modules/@kion/kg-cli-ui-config-dev-server/tmp'. If you clear the node_modules folder without stopping the service, you will have to manually stop the container. A previously running service will block any attempts at starting a new one since the database is locked on port 9001.

### Command: startUiConfigServer

This cli command starts a ui config dev server listening on a random open port. If a dev server is already running it will show the listening port.

### The underlying docker containers

You can see the docker containers running by executing the cli command:

`c:\> docker ps`

Example output:

| CONTAINER ID | IMAGE                            | COMMAND                | CREATED      | STATUS      | PORTS                  | NAMES               |
| ------------ | -------------------------------- | ---------------------- | ------------ | ----------- | ---------------------- | ------------------- |
| ff56b4c30d08 | ui-config-service:1.0.0-SNAPSHOT | "/bin/sh -c /opt/ui-…" | 17 hours ago | Up 17 hours | <IP_ADDRESS>:38760->80/tcp  | vigorous_goldwasser |
| f6bc41f7bb71 | blacklabelops/hsqldb:latest      | "/opt/hsqldb/docker-…" | 17 hours ago | Up 17 hours | <IP_ADDRESS>:9001->9001/tcp | priceless_lamarr    |

#### Docker container: ui-config-service

The 'ui-config-service' is the web application service that is running. This is the main access point for the ui config service.

- Port: Random open port. The port can be found in the ports column of the 'docker ps' cli command.

#### Docker container: blacklabelops/hsqldb

The 'blacklabelops/hsqldb' is an hsqldb running to support the ui config service. You can see the github page here 'https://github.com/blacklabelops/hsqldb' for advanced commands.

Some basic commands:

You can get the containerId from the 'docker ps' cli command.

- Execute a cli command:

  `docker exec -it {containerId} java -jar /opt/hsqldb/sqltool.jar --inlineRc=url=jdbc:hsqldb:hsql://localhost/ui-config,user=uiConfigUser,password= "--sql={query}"`
- Connect to the database using the sql tool:

  `docker exec -it {containerId} java -jar /opt/hsqldb/sqltool.jar --inlineRc=url=jdbc:hsqldb:hsql://localhost/ui-config,user=uiConfigUser,password=`

### Command: stopUiConfigServer

This command will stop the running ui config dev server. If the node_modules folder has been deleted since it was started the docker containers will have to be removed manually.

#### Manual config server stopping

To manually stop the dev server, first find the running docker containers:

`c:/> docker ps`

Find the 'ui-config-service' and 'blacklabelops/hsqldb' containers.

| CONTAINER ID | IMAGE                            |
| ------------ | -------------------------------- |
| ff56b4c30d08 | ui-config-service:1.0.0-SNAPSHOT |
| f6bc41f7bb71 | blacklabelops/hsqldb:latest      |

Then run the following command for both containers:

`c:/> docker rm -f {containerId}`

This will stop and remove the container, if you just stop the container it will still be around:

`c:/> docker ps -a`

## Injecting into index.html

Since the ui config dev server runs on a random port there is an html web pack plugin for adding the `<link />` tag into your index.html. See '@kion/kg-webpack-ui-config-plugin' package for more details.

## Adding css variables to the dev server

Now that we have the ui config dev server running we need to add our css and scss variables to it.

The ui config server compiles scss, so feel free to add scss variables into the server. For more details on the ui config server see the ui config service repo 'https://gitlab.dematic.com/diq_cloud/services/ui-config'.

### CssVariablesInjector

See './dist/jsdoc/index.html' in the published package for details.


text:
# Amazon EC2 Hazelcast

## Introduction

This project allows you to:

- deploy a Hazelcast project onto Amazon EC2 using third party tools such as [Vagrant](https://www.vagrantup.com/) and [Chef](https://www.chef.io/chef/), and

- demonstrate Hazelcast's auto discovery mechanisms for client connections and cluster formation.

## Assumptions

This project is not intended as a beginners guide to Amazon EC2, Vagrant, or Chef. If you are new to these tools, please familiarize yourself with them before proceeding.

### Amazon EC2

You should have prior knowledge of Amazon EC2; for example, you should know how to set up your own instances, maybe via the EC2 control panel.

You can try Amazon EC2 by running through the following exercise [EC2 Get Started](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EC2_GetStarted.html).

### Vagrant

Vagrant is a command line tool that lets you start up virtual machines either on your own desktop (using VirtualBox) or via another provider such as Amazon EC2. Vagrant also takes care of running provisioners, such as Chef. It simplifies mundane tasks such as connecting to the machines once they are up.

### Chef

Chef installs software on the newly created virtual machine. The instructions to do this are created in files called recipes.

## Project Structure

The project follows a standard java quickstart maven layout with some additional directories

`/src/main/vagrant` - contains the Vagranfile used for providing the linux virtual machines upon which the hazelcast project will be installed. These linux virtual machines can use either VirtualBox or Amazon EC2.

`/src/main/chef` - contains the Chef cookbook that installs the sample application.

`/src/main/java` - contains some simple java code for a Hazelcast Cluster Node and also a Hazelcast Client that connects into an Amazon EC2 Hazelcast Cluster

## Required Software

1. Install [VirtualBox](https://www.virtualbox.org/) this is the default Vagrant Provider, you'll use this to test out deployments and creating Virtual Machines on your own desktop prior to running out on Amazon EC2.

2. Install the [Chef Developers Kit](https://downloads.chef.io/chef-dk/) for your platform.  This will provide a set of command line tools, please ensure you are running at least version 0.3.5

3. Install [Vagrant](https://www.vagrantup.com/downloads) for your platform, please ensure you are running at least version 1.7.1

4. Install [Vagrant Plug-ins](https://docs.vagrantup.com/v2/plugins/usage.html) required for the Vagrant script to run.  Try to ensure you at least have the following installed...

* vagrant-aws (0.6.0)
* vagrant-berkshelf (4.0.1)
* vagrant-omnibus (1.4.1)
* vagrant-share (1.1.4, system)

For example to install vagrant-aws plugin you'll need to run on the command line

`vagrant plugin install vagrant-aws`

Additionally for the AWS provider to work you'll need to add a dummy box to Vagrant

`vagrant box add dummy https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box`
## Build the Java Binaries

Before we can deploy anything we need to build the java project and generate the jar file with dependencies.  This jar file will contain the Hazelcast server and client classes along with dependent jars, in this case the Hazelcast jar.

`mvn assembly:assembly` at the project root.

Once this is built we will have a `/target` directory that should contain `amazon-ec2-0.1-SNAPSHOT-jar-with-dependencies.jar`

## First Deployment (Virtual Box as a provider)

To begin with lets validate that everything is installed correctly.  If it is, we should be able to start up a simple hazelcast cluster running on some Ubuntu virtual machines running on your own desktop.  We'll use Vagrants default platform provider, VirtualBox to do this.

Take a look at the [VagrantFile](./src/main/vagrant/Vagrantfile) within `/src/main/vagrant`

You should see the following block of configuration that tells Vagrant to set-up an Ubuntu instance and then to run Chef Solo.

```ruby
# VirtualBox Provider

config.vm.provider :virtualbox do |vb, override|

    override.vm.box = "ubuntu/trusty64"

    # Make sure you put your own network interface name in here
    override.vm.network :public_network, bridge: "en3: Thunderbolt Ethernet"

    override.vm.provision "chef_solo" do |chef|
      chef.cookbooks_path = CHEF_COOKBOOKS_PATH
      chef.add_recipe "hazelcast-integration-amazon-ec2"
    end
end
```

This is the default provider that vagrant will run and you can see we are doing three things in this block of code.

1. Create a virtual machine based on "ubuntu/trusty64"

2. When starting the Virtual Machine create a bridged network, remember you'll have to change the network interface name to something that matches on your system replacing "en3: Thunderbolt Ethernet"

3. Once the machine is running it will execute Chef Solo and run the "hazelcast-integration-amazon-ec2" recipe.  This recipe is responsible for installing Java on this machine and then installing our Hazelcast project as a service.

One other important line of code in the VagrantFile, which is right at the top
`NUM_BOXES=2`
This configures the number of virtual machines we will create, lets leave it at 2 for now.

## How do we get the binaries onto the virtual machines?

As we're experimenting with development workflows from the desktop we need a simple and quick way to deploy our binaries to the virtual machines.

As workflow progresses to UAT/QA and ultimately production you would amend your CHEF recipies to download your developed code from a Maven repository.

But for our purposes we can simply mount the `/target` directory onto the virtual machines.  You'll see we achieve that in our VagrantFile where we mount `target` to a directory on the virtual machines called `/mnt`

```ruby
# Attach Local Release Directory to Virtual Machines
  config.vm.synced_folder "../../../target/","/mnt/hazelcast-integration-amazon-ec2/target"
```

## What is the Chef recipe doing?

You'll have noted that once Vagrant has created the virtual machines it installs Chef on those machines using the Omnibus plug-in and then executes the Chef recipe called `hazelcast-integration-amazon-ec2`.  Let's take a look at that code now, you'll find the source for that in a file called [default.rb](./src/main/chef/cookbooks/hazelcast-integration-amazon-ec2/recipes/default.rb) under `/src/main/chef/cookbooks/hazelcast-integration-amazon-ec2/recipes`

```ruby
#
# Cookbook Name:: hazelcast-integration-amazon-ec2
# Recipe:: default
#
# Apache License, Version 2.0

hazelcast_currentdir = node['hazelcast']['current_dir']

include_recipe 'java'

directory "#{hazelcast_currentdir}"

# Replaces environment specific settings in hazelcast.xml
template "#{hazelcast_currentdir}/hazelcast.xml" do
  source "hazelcast.xml.erb"
  notifies :reload, 'service[hazelcast]', :immediately
end

# Hazelcast Service Configuration
template "/etc/init/hazelcast.conf" do
  source "hazelcast.conf.erb"
  mode "0755"
  owner "root"
  group "root"
  notifies :reload, 'service[hazelcast]', :immediately
end

# Creates the Hazelcast Service
service 'hazelcast' do
  supports :status => true, :restart => true, :reload => true
  provider Chef::Provider::Service::Upstart if platform?("ubuntu")
  start_command "/usr/bin/service hazelcast start" if platform?("ubuntu")
  action [:enable, :start]
end
```

There are five steps in this Chef Recipe that we should examine.

1. Including other recipes, we know we need Java installed on our fresh Ubuntu box to run Hazelcast, so we `include-recipe 'java'`

2. We create any directories that we need using the `directory` command

3. Now we come to a really handy feature, templating.  What we're doing here is to take the [hazelcast.xml.erb](./src/main/chef/cookbooks/hazelcast-integration-amazon-ec2/templates/default) file which is under `/src/main/chef/cookbooks/hazelcast-integration-amazon-ec2/templates/default`,Chef then replaces the placeholders in this file firstly with any defaults found in the [default.rb](./src/main/chef/cookbooks/hazelcast-integration-amazon-ec2/attributes/default.rb) which is under `src/main/chef/cookbooks/hazelcast-integration-amazon-ec2/attributes`.  Also these defaults can be overridden and you'll see we do that later on in the Vagrant script when we use the chef_json attribute to set Amazon network settings for Hazelcast.  Finally it places this file in the following directory on the virtual machine `#{hazelcast_currentdir}/hazelcast.xml`

4. We use templating again when we create the hazelcast.conf file which defines the Hazelcast Upstart Service.

5. Lastly we create and start the upstart service.

### Vagrant ARISE !

Now we're ready to fire up our environment.

Within the vagrant directory where you have the VagrantFile simply type

`vagrant up`

If all goes to plan, you should see vagrant begin to provide the virtual machines and then Chef will run on this machine and install Java and finally our Hazelcast service.

### Check your virtual machines

When the command line returns we can use vagrant to ssh into the boxes.  This is one of the areas that Vagrant really makes easy, you do not have to know any IP addresses or keys to connect. You simply type

`vagrant ssh <box name>`

So in our case this would be either 'hazelcast1' or 'hazelcast2' if we created the 2 machines.

You'll recall that the Chef recipe firstly installed Java and then it installed a service which runs from our java code.  Lets check that's all started up correctly, so once you've ssh to one of the machines...

`cd /var/log/upstart`

This is where the `hazelcast.log` file will be if the service started correctly.  When you examine this log file make sure you `sudo` as it is owned by root.  If you don't you'll just be presented with an empty file.

If all went to plan you should see something like this...

```
Dec 31, 2014 2:53:21 PM com.hazelcast.config.XmlConfigLocator
INFO: Loading configuration /opt/hazelcast/hazelcast.xml from System property 'hazelcast.config'
Dec 31, 2014 2:53:21 PM com.hazelcast.config.XmlConfigLocator
INFO: Using configuration file at /opt/hazelcast/hazelcast.xml
Dec 31, 2014 2:53:21 PM com.hazelcast.instance.DefaultAddressPicker
INFO: [LOCAL] [dev] [3.4-RC1-SNAPSHOT] Prefer IPv4 stack is true.
Dec 31, 2014 2:53:21 PM com.hazelcast.instance.DefaultAddressPicker
INFO: [LOCAL] [dev] [3.4-RC1-SNAPSHOT] Picked Address[<IP_ADDRESS>]:5701, using socket ServerSocket[addr=/0.0.0.$
Dec 31, 2014 2:53:22 PM com.hazelcast.spi.OperationService
INFO: [<IP_ADDRESS>]:5701 [dev] [3.4-RC1-SNAPSHOT] Backpressure is disabled
Dec 31, 2014 2:53:22 PM com.hazelcast.spi.impl.BasicOperationScheduler
INFO: [<IP_ADDRESS>]:5701 [dev] [3.4-RC1-SNAPSHOT] Starting with 2 generic operation threads and 2 partition ope$
Dec 31, 2014 2:53:22 PM com.hazelcast.system
INFO: [<IP_ADDRESS>]:5701 [dev] [3.4-RC1-SNAPSHOT] Hazelcast 3.4-RC1-SNAPSHOT (20141215 - 24f7902) starting at A$
Dec 31, 2014 2:53:22 PM com.hazelcast.system
INFO: [<IP_ADDRESS>]:5701 [dev] [3.4-RC1-SNAPSHOT] Copyright (C) 2008-2014 Hazelcast.com
Dec 31, 2014 2:53:22 PM com.hazelcast.instance.Node
INFO: [<IP_ADDRESS>]:5701 [dev] [3.4-RC1-SNAPSHOT] Creating MulticastJoiner
Dec 31, 2014 2:53:22 PM com.hazelcast.core.LifecycleService
INFO: [<IP_ADDRESS>]:5701 [dev] [3.4-RC1-SNAPSHOT] Address[<IP_ADDRESS>]:5701 is STARTING
Dec 31, 2014 2:53:26 PM com.hazelcast.cluster.impl.MulticastJoiner
INFO: [<IP_ADDRESS>]:5701 [dev] [3.4-RC1-SNAPSHOT]

Members [1] {
        Member [<IP_ADDRESS>]:5701 this
}

Dec 31, 2014 2:53:26 PM com.hazelcast.core.LifecycleService
INFO: [<IP_ADDRESS>]:5701 [dev] [3.4-RC1-SNAPSHOT] Address[<IP_ADDRESS>]:5701 is STARTED
Dec 31, 2014 2:55:16 PM com.hazelcast.nio.tcp.SocketAcceptor
INFO: [<IP_ADDRESS>]:5701 [dev] [3.4-RC1-SNAPSHOT] Accepting socket connection from /<IP_ADDRESS>:46709
Dec 31, 2014 2:55:21 PM com.hazelcast.nio.tcp.TcpIpConnectionManager
INFO: [<IP_ADDRESS>]:5701 [dev] [3.4-RC1-SNAPSHOT] Established socket connection between /<IP_ADDRESS>:5701 and $
Dec 31, 2014 2:55:27 PM com.hazelcast.cluster.ClusterService
INFO: [<IP_ADDRESS>]:5701 [dev] [3.4-RC1-SNAPSHOT]

Members [2] {
        Member [<IP_ADDRESS>]:5701 this
        Member [<IP_ADDRESS>]:5701
}

```

## Getting Big (Hazelcast and Amazon EC2)

You could use the above steps to tinker and experiment with your Java code and your Hazelcast cluster from your own desktop machine.  However you may want to run your cluster on much more powerful hardware.  This is where vagrant comes to the rescue again.

Lets take another look at the [VagrantFile](./src/main/vagrant/Vagrantfile) within `/src/main/vagrant`

If you scroll down a little further past the VirtualBox provider code you'll see another block that deals with AWS explicitly.

```ruby
# AMAZON EC2 PROVIDER

  # To use the Amazon provider you'll need to install the AWS Vagrant Plugin
  # Follow the instructions found here :-
  # https://github.com/mitchellh/vagrant-aws

  config.vm.provider :aws do |aws, override|

    override.vm.box = "dummy"
    override.vm.box_url = "https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box"

    aws.region =  "us-east-1"
    aws.access_key_id = ENV['AWS_ACCESS_KEY']
    aws.secret_access_key = ENV['AWS_SECRET_KEY']
    aws.instance_type = 'm3.medium'
    aws.ami = "ami-9eaa1cf6" # Ubuntu Server 14.04 LTS (HVM), SSD Volume Type
    aws.keypair_name = 'david'
    aws.security_groups = 'david-us-east-1-sg'

    aws.tags = {'hazelcast_service' => 'true'}

    override.ssh.username = 'ubuntu'
    override.ssh.private_key_path = '~/.ssh/aws.pem'

    override.vm.provision "chef_solo" do |chef|
      chef.cookbooks_path = CHEF_COOKBOOKS_PATH
      chef.json = {
                      :hazelcast => {
                      :network_aws_access_key => ENV['AWS_ACCESS_KEY'],
                      :network_aws_secret_key => ENV['AWS_SECRET_KEY'],
                      :network_aws_region => "us-east-1",
                      :network_aws_host_header => "https://ec2.us-east-1.amazonaws.com",
                      :network_aws_security_group => "david-us-east-1-sg",
                      :network_aws_tag_key => "hazelcast_service",
                      :network_aws_tag_value => "true",
                      :network_multicast_enabled => "false",
                      :network_aws_enabled => "true"
                    }}
      chef.add_recipe "hazelcast-integration-amazon-ec2"
    end

  end
```

This whole section is slightly more convoluted than the previous Virtual Box deployment.  There are a number of areas that are worth discussion in more depth.

1. Observe the override.vm entries.  This is telling vagrant to use an AWS box.  This box is configured with various information which allows Vagrant to connect to AWS.  You'll need to provide your own AWS credentials here such as your access key and secret key.  Also notice that keypair_name, security_groups and ssh.private_key_path will all have to be changed to match your own personal values you have set-up in EC2.

2. By default Hazelcast uses Multicast for peer discovery and cluster set-up.  This isn't possible in Amazon. To get around this Hazelcast can discover it's peers within the Amazon region by using tags.  Each member on start-up uses the Amazon EC2 Rest API to query for IP address that hold the tag, in this case {"hazelcast_service":"true"}.  So the following line places this tag on each virtual machine `aws.tags = {'hazelcast_service' => 'true'}`

3. Finally you'll see the chef_solo configuration. The entries attributed to `chef.json` are manipulating the hazelcast.xml configuration for each member.  You can see we're setting the secret keys and access keys again, which make it possible for the Hazelcast Java Instance to query the Amazon REST API.  You'll also see we're enabling aws member discovery and disabling multicast.

### Let's do this thing

In order to run up within Amazon EC2 we have to give an extra argument to our `vagrant up` command....

`vagrant up --provider=aws`

Running this should now execute the Amazon EC2 portion of the VagrantFile.

If you have configured your amazon values correctly you should now see the Amazon instances being created.  Once finished ssh into the boxes as we have done before and check in the `/var/log/upstart` directory to confirm everything is ok with the Hazelcast cluster.

To bring the cluster down always remember

`vagrant destroy`

## Scale Up

Remember that variable we had in the VagrantFile?

`NUM_BOXES=2`

Now we're running in Amazon rather than our desktop we can create a much larger cluster to play with.  For example why not try creating a cluster of 20 members, or 50 members?

When you run with this number of instances remember to destroy the machines once you're finished or you'll end up with a very large bill from Amazon.

`vagrant destroy --force`

Using the --force flag will stop you having to confirm each machine kill, which could get boring if you have many many machines.

## Hazelcast Clients connecting to an Amazon EC2 Cluster

Now we have our Hazelcast Cluster running in EC2 we can demonstrate a cool feature of Hazelcast Clients.  Using the same Amazon REST API the Hazelcast Client can search in an EC2 region for machines that poses a particular tag.

Take a look at the Java [Client.java](./src/main/java/com/hazelcast/samples/amazon/ec2/client/Client.java) within `/src/main/java/com/hazelcast/samples/amazon/ec2`

```java
package com.hazelcast.samples.amazon.ec2.client;

import com.hazelcast.client.HazelcastClient;
import com.hazelcast.client.config.ClientAwsConfig;
import com.hazelcast.client.config.ClientConfig;
import com.hazelcast.client.config.ClientNetworkConfig;
import com.hazelcast.core.HazelcastInstance;
import com.hazelcast.core.IMap;

/**
 * Example of a client connecting to a Hazelcast Cluster running on Amazon EC2.
 *
 * By default we have set insideAws to false, this means that you can run this client from your desktop and it will
 * connect into Amazon EC2.
 */
public class Client {

    public static void main(String args[]){

        ClientConfig clientConfig = new ClientConfig();
        ClientNetworkConfig clientNetworkConfig = new ClientNetworkConfig();
        ClientAwsConfig awsConfig = new ClientAwsConfig();

        awsConfig.setInsideAws(false);
        awsConfig.setEnabled(true);
        awsConfig.setAccessKey("-- YOUR AWS ACCESS KEY --");
        awsConfig.setSecretKey("-- YOUR AWS SECRET KEY --");
        awsConfig.setRegion("us-east-1");
        awsConfig.setSecurityGroupName("david-us-east-1-sg");
        awsConfig.setTagKey("hazelcast_service");
        awsConfig.setTagValue("true");

        clientConfig.setNetworkConfig(clientNetworkConfig.setAwsConfig(awsConfig));

        HazelcastInstance hazelcastClientInstance = HazelcastClient.newHazelcastClient(clientConfig);

        // Now do something...
        IMap<Object, Object> testMap = hazelcastClientInstance.getMap("test");
        testMap.put("testKey","testValue");

    }

}
```

If you run this you should be able to connect into the Amazon Hazelcast cluster you have already running and perform the simple Map Put.  Remember though you'll have to provide you credentials in the same way that you edited the VagrantFile.  So this means providing the Access Key and Secret Key along with your Security Group Name.

## Amazon Security Gotchas

Make sure your security group allows connections to the hazelcast ports otherwise your client will not be able to connect.  By default Hazelcast searches for a port on 5701 and works its way up on a machine until it finds a free one.

Also make sure your Amazon security group allows SSH connections, otherwise when you run `vagrant ssh` it will fail.

## Finally

Once you've finished experimenting within Amazon remember to stop everything, otherwise it can get very expensive leaving instances running.  To do this you can run another vagrant command

`vagrant destroy`

repository: djkevincr/JCache-Samples

repo_name: djkevincr/JCache-Samples


text:
### Requirements

- PHP 7.2+
- Composer
- Telegram bot token ([what is it?](https://core.telegram.org/bots/api#authorizing-your-bot))

## Installing package

You can install the package via composer:

```bash
composer require westacks/telebot
```

## Laravel

Only Laravel version 5.5 or greater supported by the library!

If you are using Laravel, the library will self-register its ServiceProvider and Facade using Laravel's auto-discovery. If you turned off auto-discovery for some reason, you need to register service provider and facade manually in `config/app.php`:

```php
'providers' => [
    /*
     * Package Service Providers...
     */
    WeStacks\TeleBot\Laravel\TeleBotServiceProvider::class,
],
'aliases' => [
    'TeleBot' => WeStacks\TeleBot\Laravel\TeleBot::class,
]
```

### Publish Configuration File

Open your terminal window and fire the following command to publish config file to your config directory:

```bash
php artisan vendor:publish --tag=telebot
```
Now you can find your bots config on `config/telebot.php` file. To see more details about config parameters, you should be acquainted with `BotManager` [config](configuration.md#bot-manager-config))

repository: ak-alz/telebot

repo_name: ak-alz/telebot


text:
# Google open sources Cardboard VR after killing its Daydream project

Published at: **2019-11-07T04:27:44+00:00**

Author: **Ivan Mehta**

Original: [The Next Web](https://thenextweb.com/google/2019/11/07/google-open-sources-cardboard-vr-after-killing-its-daydream-project/?utm_campaign=tweet6)

After killing its ambitious Daydream VR project last month, Google is making the Cardboard VR project open source.
The company said the code repository includes features such as APIs for head tracking, lens distortion rendering, and input handling, for developers to build Android and iOS apps designed for Cardboard VR experiences.
Google Cardboard was released five years ago at the company’s developer conference, Google IO. The search giant claims 15 million units of Cardboard VR –made using its Cardboard Manufacturer Kit – were used worldwide.
Google said use of Cardboard VR declined over time and it’s no longer actively developing its Software Development Kit (SDK):
The Cardboard headset was an affordable way for anyone to experience the VR world. But it never took off the way Google envisioned it.
Four years ago, I had plenty of Cardboard-like headsets lying around in my house. I used them as a novelty to show off to friends or watch a VR-based video on YouTube occasionally. But latency, lag, and a lack of compelling VR apps killed my interest in Cardboard over time.
Over time, phone companies have also dialed back their VR efforts and concentrated more on providing solid AR experiences through Google’s ARCore and Apple’s ARKit.
You can check out Cardboard VR’s developer documentation here, and find the GitHub code repository here.

license: Unlicense

repository: dsadlollioygjmzvcxv/tdc-exported

repo_name: dsadlollioygjmzvcxv/tdc-exported