text:
#
# Be sure to run `pod lib lint OperationalActivity.podspec' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html
#

Pod::Spec.new do |s|
  s.name             = 'OperationalActivity'
  s.version          = '0.2.2'
  s.summary          = '运营活动模块'

# This description is used to generate tags and improve search results.
#   * Think: What does it do? Why did you write it? What is the focus?
#   * Try to keep it short, snappy and to the point.
#   * Write the description between the DESC delimiters below.
#   * Finally, don't worry about the indent, CocoaPods strips it!

  s.description      = <<-DESC
  运营活动广告获取和上传
                       DESC

  s.homepage         = 'git@dev.xx.com:iOS_librarys/OperationalActivity.git'
  # s.screenshots     = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2'
  s.license          = { :type => 'MIT', :file => 'LICENSE' }
  s.author           = { 'guolijun' =><EMAIL_ADDRESS>}
  s.source           = { :git => 'git@dev.xx.com:iOS_librarys/OperationalActivity.git', :tag => s.version.to_s }
  # s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>'

  s.ios.deployment_target = '8.0'

  s.source_files = 'OperationalActivity/Classes/**/*'

  s.resource_bundles = {
     'OperationalActivity' => ['OperationalActivity/Assets/*.png']
   }

  s.public_header_files = 'OperationalActivity/Classes/**/*.h'
  # s.frameworks = 'UIKit', 'MapKit'
   s.dependency 'AFNetworking', '= 3.2.1'
   s.dependency 'MJExtension', '= <IP_ADDRESS>'
   s.dependency 'SDWebImage', '=4.2.2'
   s.dependency 'Masonry', '~> 1.1.0'
   s.dependency 'YYModel', '= 1.0.4'
end

repository: applekwork/iOS

repo_name: applekwork/iOS


text:
# Arthur Charguéraud's Formal Metatheory in Coq

Description
===========

   - Folder `ln` contains locally nameless developments.
     See the paper "The Locally Nameless Representation" (JAR'11)
     http://www.chargueraud.org/research/2009/ln/main.pdf

   - Folder `pretty` contains pretty-big-step developments.
     See the paper Pretty Big Step Semantics (ESOP'13)
     http://www.chargueraud.org/research/2012/pretty/pretty.pdf

   - Folder `Tuto` contains course notes:

      + File `Classic` is a tutorial on using classical logic in Coq

      + File `Coind` are incomplete notes on coinduction

Compilation
===========

The files should compile with Coq v8.15.

The compilation of the files depends on the TLC library.
TLC is available from `opam`, package named `coq-tlc`.

TLC can also be installed by hand.

```
  git clone git@github.com:charguer/tlc.git
  cd src
  make install
```

The command for compiling all files:

```
   make -j4 all
```

The command `make -j4 vos` processes all files in a faster way,
to make them ready for interactive use.

License
=======

All files are distributed under the MIT X11 license. See the LICENSE file.

Authors
=======

See the AUTHORS file.

license: MIT

repository: charguer/formalmetacoq

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: charguer/formalmetacoq


text:
# azure_devops_sdk.model.PredefinedQuery

## Load the model package
```dart
import 'package:azure_devops_sdk/api.dart';
```

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**hasMore** | **bool** | Whether or not the query returned the complete set of data or if the data was truncated. | [optional] [default to null]
**id** | **String** | Id of the query | [optional] [default to null]
**name** | **String** | Localized name of the query | [optional] [default to null]
**results** | [**List<WorkItem>**](WorkItem.md) | The results of the query.  This will be a set of WorkItem objects with only the 'id' set.  The client is responsible for paging in the data as needed. | [optional] [default to []]
**url** | **String** | REST API Url to use to retrieve results for this query | [optional] [default to null]
**webUrl** | **String** | Url to use to display a page in the browser with the results of this query | [optional] [default to null]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


text:
This module is an auxiliary module containing an implementation of sets
of vertices.

```
module VertexSet
 ( Vertex, VertexSet, empty, insert, insertAll, inSet, remove, vertexListToSet, vertexSetToList,
   singleton )
 where
```

```
import FiniteMap ( FM, emptyFM, addToFM, elemFM, delFromFM, keysFM )
```

Vertices are simply integers for simplicity.

```
type Vertex = Int
```

Vertex sets are represented using finite maps with unit values. Unit
values do not require any combination of values in case a key is already
contained in the map.

```
type VertexSet = FM Vertex ()
```

The empty finite map.

```
empty :: FM a b
empty = emptyFM (<)
```

Inserts a vertex in a vertex set.

```
insert :: Vertex -> VertexSet -> VertexSet
insert i m = addToFM m i ()
```

Inserts a list of vertices into a vertex set.

```
insertAll :: [Vertex] -> VertexSet -> VertexSet
insertAll xs m = foldr insert m xs
```

Checks whether a given vertex is contained in the vertex set.

```
inSet :: Vertex -> VertexSet -> Bool
inSet = elemFM
```

Deletes a vertex from a vertex set.

```
remove :: Vertex -> VertexSet -> VertexSet
remove = flip delFromFM
```

Turns a list of vertices into a set of vertices. Multiple occurrences of
elements are removed automatically.

```
vertexListToSet :: [Vertex] -> VertexSet
vertexListToSet xs = insertAll xs empty
```

Creates a vertex set that contains exactly one element.

```
singleton :: Vertex -> VertexSet
singleton v = vertexListToSet [v]
```

Turns a set of vertices into a list of vertices.

```
vertexSetToList :: VertexSet -> [Vertex]
vertexSetToList = keysFM
```

repository: nikitaDanilenko/ndga

repo_name: nikitaDanilenko/ndga


text:
---
title: Animating vapour with JavaScript on canvas\
subtitle: Particle animation rendered on the canvas element\
classes: language-markup\
date: 2013-11-13T20:44:47+00:00
---

<hgroup>
Animating vapour with JavaScript on canvas
==========================================

## Particle animation rendered on the canvas element

</hgroup>

As my day to day development must include support for IE8 and sometimes even IE7 playing with the recent toys is not possible, unless they degrade gracefully. But with mobile development, the story is different, now I have to replicate a vapour animation done in flash, but in regular HTML/Javascript. Enter `<canvas>`... All my experience with canvas has been just a few shapes a few years ago, it seemed really similar to the ActionScript drawing API and Bitmap Classes, today I'll put that to the test.

## _Mise en place_ {#ac1}

-   Get some proper documentation. The best I could find was the WHATWG spec document for `canvas` <http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html>
-   You need a modern browser, with `<canvas>` support, to properly view this article.

## Set up the HTML {#ac2}

Basically nothing, I'm resetting a few things and the JS code we'll do on the same html.

<!doctype html>

<meta charset="utf-8">

<title>
Canvas particle system for vapour

</title>

<canvas id="vapour">
</canvas>

Testing the canvas {#ac3}
------------------

We must select the canvas and get the `2d` context to work there. We must set the size of the element and we'll add a rectangle to test.

bc(language-javascript).\
var canvas = document.getElementById('vapour');\
var cntxt2d = canvas.getContext('2d');\
canvas.width = window.innerWidth;\
canvas.height = window.innerHeight;\
cntxt2d.fillStyle = "rgba(69, 188, 210, 0.8)";\
cntxt2d.fillRect(64,64,256,218);

That should give you someting like this:

![A cyan rectangle over gray background](img/content/particles-first-rect.png 'A cyan rectangle over gray background')

## Our basic particle {#ac4}

As this is going to be vapour it must be a _flufy_ particle, it should be a disc with a radial gradient fill.

To draw a disc in canvas is pretty easy (way easier than writing a series of bezier paths), and a radial gradient is also easier the the CSS syntax. You must first generate a `CanvasGradient` object with the `createRadialGradient` method and then add color stops with addColorStop. The `CanvasGradient` can then be assigned as a `fillStyle` to the context.

The `arc()` method is one of the `CanvasPathMethods` so the context needs to be initiated in the drawing mode with `beginPath()` and ended with `fill()` (if you want to fill the path with the fillStyle).

bc(language-javascript).\
var rGrad = cntxt2d.createRadialGradient(64,64,0,64,64,32);\
rGrad.addColorStop(0,'rgba(252, 194, 18, 1)');\
rGrad.addColorStop(1,'rgba(252, 194, 18, 0)');\
cntxt2d.fillStyle = rGrad;\
cntxt2d.beginPath();\
cntxt2d.arc(64,64,32, 0, Math.PI\*2, false);\
cntxt2d.fill();

notextile.

<canvas id="first-grad" style="background:#555;max-width:100%">
</canvas>

Actually I don't need a disc to hold the radial gradient, it could perfectly be a square. But the problem I see right away is that the position of the circles that generate the radial gradient is relative to the canvas, so I shouldn't even need the arc. The problem with doing particles with radialGradients as fillStyle is performance, I did a [little test](http://cdpn.io/sDpld) modifying a [particle emmiter by Jarrod Overson](http://codepen.io/jsoverson/full/chGDt) so the particles where some small gradients rendered as the `fillStyle` and the “little test” just crashed Chrome.

### Pixel manipulation {#ac5}

What if we generate the gradient only once, and store that data and then paste it in as many places as we need? Let's try that.

bc(language-javascript).\
//this time we'll put the disk at the top.\
var rGrad = cntxt2d.createRadialGradient(10,10,0,10,10,10);\
rGrad.addColorStop(0,'rgba(252, 194, 18, 1)');\
rGrad.addColorStop(1,'rgba(252, 194, 18, 0)');\
cntxt2d.fillStyle = rGrad;\
cntxt2d.beginPath();\
cntxt2d.arc(10,10,10, 0, Math.PI\*2, false);\
cntxt2d.fill();\
var dotImage = cntxt2d.getImageData(0,0,20,20);\
cntxt2d.putImageData(dotImage,128,128);

notextile.

<canvas id="second-grad" style="background:#555;max-width:100%">
</canvas>

That doesn't look right. How am I going to build a cloud with bitmaps that don't respect the alpha channel? This took me a while to figure out, and it turns out that if you look at the data inside the `ImageData` object the alpha transparency is there, also if we check for the pixels in the canvas where we put the `ImageData` there's also the supposed transparency. The problem is that `PutImageData()` method doesn't blend the pixels with what is already on the canvas, it just replaces them. At stackoverflow [there was a suggestion](http://stackoverflow.com/questions/14110754/transparency-lost-with-getimagedata-html5-2d-context) to use the `drawImage` method. Which can be an image, or a canvas element. It also turns out that `drawImage` is, at least, 10 times faster in most browsers.

So we add an extra canvas, just the size we need for the gradient bitmap and use that as an image to print on the animation canvas.

<canvas id="small-one" style="display:none">
</canvas>
We add the `display:none;` because we only need the data, we don't need it to render. And to the JS code we add:

bc(language-javascript).\
var dotImage = cntxt2d.getImageData(0,0,20,20);\
cntxt2d.putImageData(dotImage,128,128);\
var smallCanvas = document.getElementById('small-one');\
var bufcntxt = smallCanvas.getContext('2d');\
smallCanvas.width = 20;\
smallCanvas.height = 20;\
bufcntxt.putImageData(dotImage,0,0);\
cntxt2d.drawImage(smallCanvas,172,172);

notextile.

<canvas id="third-grad" style="background:#555;max-width:100%">
</canvas>
<canvas id="small-one" style="display:none">
</canvas>

Hooray! now let's animate.

## Animation {#ac6}

Particles can be very complex beings needing many properties to describe their behaviour on screen. In some cases they can have weight, friction, acceleration, max-speed, size, opacity and be afected by fields, etc. In this case we are building a very simple particle system, speed is going to be constant and there's not going to be any interaction with the particles.

### `requestAnimationFrame` {#ac7}

Instead of timeouts or intervals we use this method with far better performance. It's simple to use, you just pass one argument, the function you want to be executed on one frame. For backwards compatibility we'll use Erik Möller and Paul Irish's [requestAnimationFrame polyfill that works even with browsers without support](https://gist.github.com/paulirish/1579671) .

To test the method we'll place particles randomly at every frame. For that we need to create `render` function that will update the canvas on every frame. Adding to what we wrote before.

bc(language-javascript).\
function randRange(min, max) {\
return Math.random() \* ( max - min ) + min;\
}\
function render(){\
cntxt2d.clearRect(0,0,759,300);\
var len = 150;\
while(len--){\
cntxt2d.drawImage(smallCanvas, randRange(10,549) , randRange(10, 270));\
}\
window.requestAnimationFrame(render);//this makes this function recursive\
}\
render();

notextile.

<canvas id="fourth-grad" style="background:#555;max-width:100%">
</canvas>
<canvas id="small-two" style="display:none">
</canvas>

If this is annoying you, sorry. The most important part in the `render()` function is the `clearRect()` method. It clears the canvas in the area defined by the four parameters it takes.

We also defined a function we'll use next, `randRange(min, max)`, it returns a random float number between the two numbers provided as `min` and `max`.

To animate with some order we'll need something more than just the renderer function, we'll build a `animationLoop()` function that will call the following methods on each frame.

-   `genParticles()` This will generate the particles as object and store them in the `particleList` array.
-   `positionParticles()` This will calculate the position of each particle and kill old particles.
-   `render()` This will render the `dotImage` on the canvas according to the position and age of each particle.
-   `requestAnimationFrame(animationLoop)` This will call this function on the next frame.

We must initialize the global variables and define the functions, so the cod so far should look something like this (assuming you already have the polyfill and the randRange function).

bc(language-javascript).\
var ratePF = 1;\
var particleList = \[\];\
var originPoint = { x:405, y:391 };\
var canvas = document.getElementById('vapour');\
var cntxt2d = canvas.getContext('2d');\
var running = true;\
var particleLife = 100;\
canvas.width = 579;\
canvas.height = 695;\
var bufferCanvas = document.getElementById('dot-buffer');\
var bufcntxt = bufferCanvas.getContext('2d');\
bufferCanvas.width = 10;\
bufferCanvas.height = 10;\
var rGrad = bufcntxt.createRadialGradient(5,5,0,5,5,5);\
rGrad.addColorStop(0,'rgba(252, 194, 18, 1)');\
rGrad.addColorStop(1,'rgba(52, 14, 208, 0)');\
bufcntxt.fillStyle = rGrad;\
bufcntxt.fillRect(0,0,10,10);\
var dotImage = bufcntxt.getImageData(0,0,10,10);\
bufcntxt.putImageData(dotImage,0,0);\
function genParticles(){\
var len = ratePF;\
while(len--){\
var oneParticle = {\
x: originPoint.x,\
y: originPoint.y,\
velx: randRange(-1.2,0.8),//this is the range of speed on the x-axis\
vely: randRange(-3,-0.75),//this is the range of speed on the y-axis\
life: particleLife,//this will be reduced by one on each frame.\
totalLife: particleLife,\
maxSize: randRange(60,100)\
};\
oneParticle.x -= oneParticle.velx;\
oneParticle.y -= oneParticle.vely;\
particleList.push(oneParticle);\
}\
}\
function positionParticles(){\
var len = particleList.length;\
while(len--){\
var op = particleList\[len\];//op = one particle\
op.life--;\
if(op.life < 1){\
particleList.splice(len,len+1);\
continue;\
}\
//if(!len%1000)console.log(op.life);\
op.x += op.velx;\
op.y += op.vely;\
}\
}\
function render() {\
cntxt2d.clearRect(0,0,window.innerWidth,window.innerHeight);\
var len = particleList.length;\
while(len--){\
var op = particleList\[len\];//op = one particle\
ga = op.life / op.totalLife;\
cntxt2d.globalAlpha = ga;\
var size = op.maxSize - op.maxSize \* ga + 10;\
cntxt2d.drawImage(bufferCanvas, op.x, op.y, size, size);\
}\
}\
function animationLoop(){\
genParticles();\
positionParticles();\
render();\
if(running) {\
requestAnimationFrame(animationLoop);\
}\
}\
animationLoop();

notextile.

<canvas id="vapour" style="background:url('img/content/tetera-canvas.jpg');max-width:100%">
</canvas>
<canvas id="dot-buffer" style="display:none">
</canvas>

This rather dramatic concoction looks better for this image than a white vaporous cloud.

I did a codepen [Gradient particles on canvas](http://cdpn.io/ACDbI) with this code, where you can play with the variables.

This is just the basics with `<canvas>` and I must say: I'm impressed with the performance; in the end the math behind particles are always the same, the drawing API wasn't complicated and easier than others I've seen.

repository: baamenabar/blog-inabar

repo_name: baamenabar/blog-inabar


text:
# AWS Route53 record update
Do you use **aws** (amazon web service) as DNS for your domains?

Are you looking for an easy way to update your aws route53 record with your public IP without logging into the aws management console?

This is the driver that motivated me to develop this small project as I did not find any tool out there accomplishing this task.

This is a **Java** based program to install on any machine that will detect its public IP to update a certain aws route53 record (**type A**) of your AWS account.

**As simple as that!**

E-mail notification feature is available as well so that you'll get emails upon the events that matters (e.g. DNS update, general software errors and so on)

## Requirements
In order to use this tool you will need the following

- Active aws account
- The hosted zone configured within aws Route53
- Valid aws credentials (**secretKey** and **accessKey**) with write access to your aws Route53 service
- Java installed on the machine where you intend to run this utility

In case the configured record name is not present within the aws hosted zone, it will be created (type A) otherwise it will be simply updated with the new detected public IP.

## Download and Install
Download the latest release from [Releases repository](https://github.com/renatodelgaudio/renatodelgaudio.github.io/tree/master/IpUpdaterReleases "Releases repository")

At the moment the following platform packages are available:
- **Windows** (file name IpUpdater-XXX-win-package)
- **Linux/Mac** (file name IpUpdater-XXX-linux-mac-package)

1. Unzip the package in any directory
2. Locate the file named **aws.properties** and provide the correct values
3. Run the launcher (e.g. run.sh or rub.bat)

More details on installation steps are available on the wiki
[Linux manual installation steps](https://github.com/renatodelgaudio/awsroute53/wiki/Linux-manual-installation-steps "Linux manual installation steps")

## Reports
The releases reports are viewable from http://renatodelgaudio.github.io/IpUpdaterReleases/versionxxx/reports/

e.g. http://renatodelgaudio.github.io/IpUpdaterReleases/1.0.3/reports/

Feel free to create a Pull request and I will be happy to integrate it.

Renato Del Gaudio

gha_language: Java


text:
# LinkedIn Profile Scraper

A script to scrape data from user profiles that have commented on a certain post on LinkedIn.

## Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

### Prerequisites

Download and install Python 3(https://www.python.org/downloads/release/python-376/)

### Installing

Start by installing the requirements as follows:

```
pip3 install -r requirements.txt
```

## Running

Download the chrome driver(https://chromedriver.chromium.org/downloads)

Open LinkedIn.txt and put in your email, password, path to chrome driver and link to post from which you would like to scrape

Run the script using the following command:

```
python3 LinkedIn_Scraper.py
```

## License

This project is licensed under the MIT License


text:
---
path: "/iteration-domains"
date: "2018-02-26T04:41:53+00:00"
title: "Iteration Domains: Let's Draw Shapes"
author: "Evan Conrad"
author_link: "https://twitter.com/flaqueeau"
---

An **iteration domain** is the total range of values
that a program is iterating over.

## Example

Take the following code:

```C++
for (int i = 0; i < 6; i++) {
    for (int j = i; j < 10; j++) {
        // Do something
    }
}
```

If we plot a point at every `i` and `j` value, we've mapped the "iteration domain" of the program:

![Visualization of Iteration Domain](https://i.imgur.com/O4eE95T.png)

[Source](https://www.cs.indiana.edu/~achauhan/Teaching/B629/2010-Fall/StudentPresns/PolyhedralModelOverview.pdf)

repository: gu-app-club/blog

gha_language: JavaScript

gha_license_id: MIT

repo_name: gu-app-club/blog


text:
# This repo contain an Elastic Stack example configuration

## Prerequisite

- [Vagrant](https://www.vagrantup.com/) installed.
- Basic knowledge about the Elastic Stack.

## Clone the repo

```
git clone https://github.com/chavo1/elastic.git
cd elastic/elastic-nginx
vagrant up
```
## A following software will be installed on CentOS7
- [Elasticsearch](https://www.elastic.co/products/elasticsearch)
- [Logstash](https://www.elastic.co/products/logstash)
- [Kibana](https://www.elastic.co/products/kibana)
- [Filebeat](https://www.elastic.co/products/beats/filebeat)

## When Vagrant provision the VMs

- To access a Kibana UI type the following on your command line.

```
$ ssh<EMAIL_ADDRESS>-L 5601:localhost:5601
<EMAIL_ADDRESS>password: vagrant
```
- Than open the browser and login in Kibana http://localhost:5601


text:
---
layout: post
title: "Not-So-CLEVR: Visual Relations Strain Feedforward Neural Networks"
date: 2018-02-09 18:55:34
categories: arXiv_AI
tags: arXiv_AI QA Attention CNN Relation VQA Recognition
author: Matthew Ricci, Junkyung Kim, Thomas Serre
mathjax: true
---

* content
{:toc}

##### Abstract
The robust and efficient recognition of visual relations in images is a hallmark of biological vision. Here, we argue that, despite recent progress in visual recognition, modern machine vision algorithms are severely limited in their ability to learn visual relations. Through controlled experiments, we demonstrate that visual-relation problems strain convolutional neural networks (CNNs). The networks eventually break altogether when rote memorization becomes impossible such as when the intra-class variability exceeds their capacity. We further show that another type of feedforward network, called a relational network (RN), which was shown to successfully solve seemingly difficult visual question answering (VQA) problems on the CLEVR datasets, suffers similar limitations. Motivated by the comparable success of biological vision, we argue that feedback mechanisms including working memory and attention are the key computational components underlying abstract visual reasoning.

##### Abstract (translated by Google)
对图像中视觉关系的强大有效识别是生物视觉的一个标志。在这里，我们认为，尽管最近在视觉识别方面取得了进展，但是现代机器视觉算法在学习视觉关系的能力方面受到严重限制。通过对照实验，我们证明视觉关系问题应变卷积神经网络（CNN）。当死记硬背的时候，网络最终会崩溃，例如当班内变异超过他们的能力时。我们进一步表明，另一种称为关系网络（RN）的前馈网络，被证明能成功地解决CLEVR数据集上看起来难以回答的视觉问题（VQA）问题，也有类似的局限性。受到生物视觉的相当成功的启发，我们认为包括工作记忆和注意力在内的反馈机制是抽象视觉推理的关键计算组件。

##### URL
[http://arxiv.org/abs/1802.03390](http://arxiv.org/abs/1802.03390)

##### PDF
[http://arxiv.org/pdf/1802.03390](http://arxiv.org/pdf/1802.03390)


text:
---
name: Bug report
about: Create a report to help us improve

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior.

**Desktop (please complete the following information):**
 - OS: [e.g. CentOS Linux]
 - Version [e.g. 6]

**Python version**
Version: [e.g. 3.5.3]

**LIBeSocial version**
Version: [e.g. 0.0.1dev0]

**Taceback**
The traceback, if any. You can add only the lines that make sense to the bug described.

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

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

repository: qualitaocupacional/libesocial

branch_name: refs/heads/main

gha_language: Python

repo_name: qualitaocupacional/libesocial


text:
# Four Word Phrase

Four Word Phrase is a toolkit for the creation of short phrases by
pseudo-randomly picking words from a provided dictionary. When using a given
seed and dictionary the sequence of phrases generated is identical.

## Install via NPM

```
npm install four-word-phrase
```

## Example: Moby Dick

Generate a dictionary from the text of Moby Dick and use it to create
pseudo-random phrases:

```
var _ = require('underscore');
var async = require('async');
var fwp = require('four-word-phrase');
var mobyDick = fwp.example.mobyDick;

// Parse the book into a set of unique words and write that to a dictionary
// file.
var generateDictionary = mobyDick.generateDictionary;

// Use the dictionary file and seed to generate pseudo-random four word
// phrases.
var generatePhrases = function (callback) {
  var seed = 'a random seed';
  var phraseLength = 4;
  mobyDick.generatePhrases(seed, phraseLength, callback);
};

async.series([
  generateDictionary,
  generatePhrases
], function (error, results) {
  if (error) {
    return console.error(error);
  }
  var phrases = results[1];
  _.each(phrases, function (phrase) {
    console.info(phrase.join(' '));
  });
});

```

## Example: Project Gutenberg

Generating a dictionary from all of the English language text files served by
Project Gutenberg is a more ambitious undertaking, but readily accomplished.

Firstly download the files, an operation that will take 36 to 48 hours since it
is configured to put only a light load on the Project Gutenberg servers. The
process prints progress to the console. If prematurely ended it will pick up
where it left off when restarted.

As of Q2 2014 these files are ~7G zipped and ~21G unpacked, so make sure you
have at least 30G of disk space to spare for this process.

```
var fwp = require('four-word-phrase');
fwp.example.projectGutenberg.downloadFiles(function (error) {
  if (error) {
    console.error(error);
  }
});
```

Next, generate the dictionary. This again is a fairly intensive process and will
take the better part of a day on an average machine. It also keeps track of
progress and will pick up somewhere close to where it left off if restarted.

```
var fwp = require('four-word-phrase');
fwp.example.projectGutenberg.generateDictionary(function (error) {
  if (error) {
    console.error(error);
  }
});
```

Dictionary in hand, you can then generate phrases:

```
var _ = require('underscore');
var fwp = require('four-word-phrase');

var seed = 'a random seed';
var phraseLength = 4;
fwp.example.projectGutenberg.generatePhrases(seed, phraseLength, function (error, phrases) {
  if (error) {
    return console.error(error);
  }
  _.each(phrases, function (phrase) {
    console.info(phrase.join(' '));
  });
});
```

## Notes on Sufficient Uniqueness

UUIDs have a space of ~10e38 possible options, so there is a vanishing chance of
collision even if you generate a lot of them. Word sequences that are usefully
short (meaning short enough to memorize reliably) can't approach that. Four
words is probably the practical limit, and this has a far smaller space:

|                       | 3 words | 4 words | 10 words |
| --------------------- | ------- | ------- | -------- |
| Dictionary: 1,000     | ~10e9   | ~10e12  | ~10e30   |
| Dictionary: 10,000    | ~10e12  | ~10e16  | ~10e40   |
| Dictionary: 100,000   | ~10e15  | ~10e20  | ~10e50   |
| Dictionary: 1,000,000 | ~10e18  | ~10e24  | ~10e60   |

For reference, a dictionary generated from Moby Dick and restricted to words of
five to fourteen letters (including hyphens) has ~14,000 words. The English
language as a whole may have ~1,000,000 words, but far from all of those are
useful for this purpose. Sequences of short words are no easier to remember, but
are less secure as they can be more readily brute-forced.

## Creating a New Dictionary Implementation

To create a Dictionary with a different storage backend, subclass the base
`Dictionary` class and implement its undefined methods.

```
var util = require('util');
var Dictionary = require('four-word-phrase').dictionary.Dictionary

var MyDictionary = function (options) {
  MyDictionary.super_.call(this, options);

  // Setup here.

}
util.inherits(MyDictionary, Dictionary);

// Implement the necessary methods. e.g:
MyDictionary.prototype.appendWords = function (words, callback) {
  // ...
};
```

## Creating a New Generator Implementation

To create a Generator with a different storage backend, subclass the base
`Generator` class and implement its undefined methods.

```
var util = require('util');
var Generator = require('four-word-phrase').generator.Generator

var MyGenerator = function (dictionary, options) {
  MyGenerator.super_.call(this, dictionary, options);

  // Setup here.

}
util.inherits(MyGenerator, Generator);

// Implement the necessary methods. e.g:
MyGenerator.prototype.getCount = function (callback) {
  // ...
};
```

repository: exratione/four-word-phrase

repo_name: exratione/four-word-phrase


text:
---
title: "Set up the Provisioner"
weight: 30
draft: false
---

## Setting up a simple (default) CRD Provisioner

Karpenter configuration comes in the form of a Provisioner CRD (Custom Resource Definition).
A single Karpenter provisioner is capable of handling many different pod shapes. Karpenter makes scheduling and provisioning decisions based on pod attributes such as labels and affinity. A cluster may have more than one Provisioner, but for the moment we will declare just one: the default Provisioner.

One of the main objectives of Karpenter is to simplify the management of capacity. If you are familiar with other Auto Scalers, you will notice Karpenter takes a different approach. You may have heard the approached referred as **group-less auto scaling**. Other Solutions have traditionally used the concept of a **node group** as the element of control that defines the characteristics of the capacity provided (i.e: On-Demand, EC2 Spot, GPU Nodes, etc) and that controls the desired scale of the group in the cluster. In AWS the implementation of a node group matches with [Auto Scaling groups](https://docs.aws.amazon.com/autoscaling/ec2/userguide/AutoScalingGroup.html). Over time, clusters using this paradigm, that run different type of applications requiring different capacity types, end up with a complex configuration and operational model where node groups must be defined and provided in advance.

Let's deploy the following configuration:
```bash
cat <<EOF | kubectl apply -f -
apiVersion: karpenter.sh/v1alpha5
kind: Provisioner
metadata:
  name: default
spec:
  labels:
    intent: apps
  provider:
    instanceProfile: KarpenterNodeInstanceProfile-${CLUSTER_NAME}
    tags:
      accountingEC2Tag: KarpenterDevEnvironmentEC2
  ttlSecondsAfterEmpty: 30
EOF
```

The configuration for this provider is quite simple. We will change in the future the provider. For the moment let's focus in a few of the settings used.

* **Instance Profile**: Instances launched by Karpenter must run with an InstanceProfile that grants permissions necessary to run containers and configure networking.
* **Requirements Section**: The [Provisioner CRD](https://karpenter.sh/v0.4.3-docs/provisioner-crd/) supports defining node properties like instance type and zone. For example, in response to a label of topology.kubernetes.io/zone=us-east-1c, Karpenter will provision nodes in that availability zone. We could set the `karpenter.sh/capacity-type` to procure EC2 Spot instances. If nothing provided it will default to on-demand. You can learn which other properties are [available here](https://karpenter.sh/v0.4.3-docs/cloud-providers/aws/aws-spec-fields/). We will work on a few more during the workshop.
* **ttlSecondsAfterEmpty**: value configures Karpenter to terminate empty nodes. This behavior can be disabled by leaving the value undefined. In this case we have set it for a quick demonstration to a value of 30 seconds.
* **Tags**: Provisioners can also define a set of tags that the EC2 instances will have upon creation. This helps to enable accounting and governance at the EC2 level.

{{% notice info %}}
Karpenter has been designed to be generic and support other Cloud and Infrastructure providers. At the moment of writing this workshop (Karpenter 0.5.1) main implementation and Provisioner available is on AWS. You can read more about the **[configuration available for the AWS Provisioner here](https://karpenter.sh/docs/aws/)**
{{% /notice %}}

## Displaying Karpenter Logs

{{% notice tip %}}
You can create a new terminal window within Cloud9 and leave the command below running so you can come back to that terminal every time you want to look for what Karpenter is doing.
{{% /notice %}}

To read Karpenter logs from the console you can run the following command.

```bash
kubectl logs -f deployment/karpenter-controller -n karpenter
```

{{% notice info %}}
Karpenter log configuration is stored as a Kubernetes ConfigMap. You can read the configuration by running the following command `kubectl describe configmap config-logging -n karpenter`. You can increase the logging level to `debug` using the following command `kubectl patch configmap config-logging -n karpenter --patch '{"data":{"loglevel.controller":"debug"}}'`
{{% /notice %}}

repository: cfregly/eks-workshop

gha_license_id: NOASSERTION

repo_name: cfregly/eks-workshop


text:
# Flogo Web UI - Helper

_This code is no longer maintained. Feel free to fork and use it if you want though :smile:_

Flogo Web UI - Helper is a utility to help work with the Flogo Web UI. Especially tasks like importing and exporting apps are considerably easier...

You can build an executable out of this app using the command
```
go build
```

## Usage
```
CLI to interact with the Project Flogo Web UI

Usage:
  flogowebhelper [command]

Available Commands:
  apps        Apps management for the Project Flogo Web UI
  docker      Docker container management for the Project Flogo Web UI
  help        Help about any command

Flags:
  -h, --help   help for flogowebhelper

Use "flogowebhelper [command] --help" for more information about a command.
```

### apps
```
The Apps command supports the app management capabilities.
The commands available are:

export................... Exports Flogo apps from the Flogo Web UI
import................... Imports Flogo apps into the Flogo Web UI
```

### apps - export
```
Exports Flogo apps from the Flogo Web UI

Usage:
  flogowebhelper apps export [flags]

Flags:
  -h, --help          help for export
      --host string   The URL for the Flogo Web UI (default "http://localhost:3303")
```

### apps - import
```
Imports Flogo apps into the Flogo Web UI

Usage:
  flogowebhelper apps import [flags]

Flags:
      --dir               import all JSON files in the current directory
      --filename string   The name of the file you want to import if you do not specify 'dir' (default "flogo.json")
  -h, --help              help for import
      --host string       The URL for the Flogo Web UI (default "http://localhost:3303")
```

### docker
```
The Docker command supports the container management capabilities.
The commands available are:

build.................... Builds a new docker image
latest................... Pulls the latest version of the Flogo Web UI from Docker Hub
start.................... Starts a new instance of the Flogo Web UI with default settings
```

### docker - start
```
Starts a new instance of the Flogo Web UI with default settings

Usage:
  flogowebhelper docker start [flags]

Flags:
  -h, --help           help for start
      --image string   The image name for the Flogo Web UI container (default "flogo/flogo-docker")
```

### docker - latest
```
Pulls the latest version of the Flogo Web UI from Docker Hub

Usage:
  flogowebhelper docker latest [flags]

Flags:
  -h, --help   help for latest
```

### docker - build
```
Builds a new docker image

Usage:
  flogowebhelper docker build [flags]

Flags:
  -h, --help             help for build
      --image string     The image name for the Flogo Web UI container (default "flogo/flogo-docker")
      --imports string   An imports file in case you want to add additional activities (like /home/user/Downloads/imports.go)
```

_Check out [this example](https://github.com/retgits/dockerfiles/blob/master/flogoweb/imports.go) of an imports.go_

## License
The MIT License (MIT)

Copyright (c) 2018 retgits

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

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

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

repository: retgits/flogowebhelper

repo_name: retgits/flogowebhelper


text:
# terminal-package-update

A Debian package that launches a terminal when you log in and updates all of your packages and removes obsolete packages.

![](demo.gif)

## Why was this created?

Of course you could just configure your package manager to update packages automatically, but that's not fun. I personally enjoy seeing which packages are being updated. I also like to monitor the updates for any failures.

## System Requirements

Ubuntu 18.04 or higher. I tested it on Ubuntu 20.10. If anyone aside from myself ends up using this I will work to make it compatibile with other systems.

## Installation Instructions

Download releases/terminal-package-update_1.0.0.deb to your working directory and then run

```shell
sudo apt install ./terminal-package-update_1.0.0.deb
```

repository: bkarai/terminal-package-update

repo_name: bkarai/terminal-package-update


text:
---
title: "Test"
---

# Directory Index

{{< directoryindex path="/scss" pathURL="/" >}}

# This file =

```
{{< readfile file="/content/test.md" >}}
```

## Colors are nice

<style>
  {{< readfile file="/scss/title.scss" >}}
</style>

repository: nqthqn/mauxy

gha_language: HTML

repo_name: nqthqn/mauxy


text:
www.RecallVault.io
==============

Recall Vault is a free application that alerts users to unsafe, hazardous, and defective products using data drawn from several federal agencies including EPA, FDA, USDA, NHTSA, CPSC, and USA.gov.


text:
---
layout:     post
title:      Lecture Notes 09
subtitle:   Reinforcement Learning - David Silver's Course
date:       2018-02-03
author:     Sun Yin
header-img: img/rlsilver/fengmian.png
catalog: true
tags:
    - Reinforcement Learning
---
## Lecture 09

**1. Multi-Armed Bandits**

---

### 1. Multi-Armed Bandits

**1.1** What is *multi-armed bandits* problem? What is regret?

**1.2** what is the trend of total regret of greedy algorithm and $$\epsilon-greedy$$ algorithm?

**1.3** What is optimistic initialisation? What is its total regret's trend?

**1.4** What is decaying $$decaying \epsilon-Greedy$$ algorithm? Waht is its total regret's trend?

**1.5** What is *lower bound theorem*?

**1.6** How to derive *UCB algorithm*?

**1.7** What is *Bayesian UCB*?

**1.8** What is *Thompson sampling*?

**1.9** What is *information state*, how to solve it?


text:
---
title: Create A User
layout: reference
---

## Create A User

### Adding User Records:

It is critical for clients & Partners to understand the difference between establishing employee data for a base User record vs. the employee data that serves other Concur features.

Many Expense features require employee data that User Provisioning applications cannot populate since the current User API does not include those features at this time.  Therefore, the data pertaining to these features must be populated by the client using Concur specified import files. Concur Implementation staff will assist with the import file process.

The higher number of Concur features the client elects to use, the more data they will need to import via files for those features to work. Changes to base records can be accomplished via the User Provisioning app such as when an employee terminates or changes Cost Center.

  - Some Standard Edition clients may be able to completely add a user via a User Provisioning application without the need to import files if their configuration choices are very basic.
  - It is unlikely that Professional Edition clients will be able to add a user via a User Provisioning application without the need to import files for additional employee data.
  - The fields that can be populated by the User Provisioning app are specified here:
https://developer.concur.com/api-reference/user/company-notification-subscription-resource/user.html#createUser

### Availability:
  1.	Small Business – not available to App Center Partner applications
  2.	Standard Edition – see additional information below
  3.	Professional Edition – see additional information below
      - Premium Edition – same as Professional Edition
  4.	Standard to Professional (upgrade) - see additional information below

### How to Determine the Edition Type:

A client can determine the Edition-type by having their administrator login to their Concur site.  If they see a “Setup” menu and a sub option for Expense within the main, Administration menu, then this is a Standard Edition site.  If the client administrator does not see the “Expense” menu within the Setup menu, then they have a Professional Edition site.  See:

A Partner can determine the Edition type by the field Label value populated in Custom21 data element.  This data element can be obtained by making a GET request to this API:	https://www.concursolutions.com/api/user/v1.0/FormFields

  1. Standard Edition:

            <Id> Custom21 </Id>
            <Label> EmployeeAdministrationCountry </Label>

  2. Professional Edition:

            <Id> Custom21 </Id>
            <Label> EmployeeGroup </Label>

  3. Standard-to-Professional Upgrade Edition:

            <Id> Custom21 </Id>
            <Label> EmployeeGroup </Label>
            In addition, these clients will have this field & Label:
            <Id> PmtMethodCode </Id>
            <Label> ReimbursementMethod </Label>

### Import Notes across the Edition Types:

#### Standard Edition:
1.	Client must have the Expense Service enabled.  i.e. Travel-only is not supported
2.	Ledger Code:
  - required to be part of the User Post.
  - For all Standard Edition clients the Ledger code = DEFAULT
3.	Employee Group:
  - This is optional for Standard Edition clients. If it is used, then Custom21 & OrgUnit1 fields will be the fields to use.  These fields will point to a 2-level list.
  - To determine Group Codes for Standard Edition, see this [page](/api-guides/expense/how-to-identify-group-codes-for-standard-edition-clients.html).
4.	Custom Fields:
  - Partner must determine the base record custom field(s).  These fields will vary per client.
  - Partner must determine if the custom field(s) are defined as a List field.
          * If the field has a List, then the Partner must locate the List Code values in order to populate the List Item Code for each base employee record
          * The List can be configured as a multi-level list (aka “Connected List”).
  - See Appendix document to learn how to obtain the above data.

#### Professional Edition:
1.	Client must have the Expense Service enabled.  i.e. Travel-only is not supported
2.	Ledger Code (required for POST body)
  - This value can vary and a Pro Edition client could have 2 or more.
  - The Ledger code must be obtained from Concur since the Code is not available in the API and it is not exposed to the client administrator in the Concur UI (Accounting Administration menu).
          * Contact us via this <a<EMAIL_ADDRESS>for the Client’s Ledger codes.
3.	Employee Group: (required for POST body)
  - This will be used for all Pro Edition Clients.
  - Custom21 will be used for the Expense Group value.  Custom 22 will be used for the Invoice Group value.   Both will be a List field.  Invoice is not necessary for all clients.
  - See appendix document to learn how to determine the Group Codes
4.	Custom Fields:
  - Partner must determine the base record custom field(s).  These fields will vary per client.
  - Partner must determine if the custom field(s) are defined as a List field.
          * If the field has a List, then the Partner must locate the List values in order to populate the List Item Code for each base employee record
          * The List can be configured as a multi-level list (aka “Connected List”).
  - See Appendix document to learn how to obtain the above data.

#### Standard-to-Professional Upgrade Edition:
1.	Same as Professional except the Reimbursement Method field:
  - See Appendix document for more information.
2.	Partners need to contact Concur to ensure everyone is on the same page.

#### Appendix:	How to Provision a Base User Record

For the APIs to use and the steps to take in your app to successfully post a base user record, see this [page](/api-guides/expense/how-to-provision-a-basic-user-record-into-Concur.html).

#### Reminder:

Communicate to the client the likelihood that they will need to import files to accommodate the Expense features that they have elected to use.

Standard Edition clients that are not using extended features can use the User Provisioning app to add records without having to import additional data.  However, even some Standard Edition features require additional file imports or manually added information in Concur by the client.

branch_name: refs/heads/preview

extension: markdown


text:
# Sniffing and Evasion

### Basic Knowledge

 - Sniffing is capturing packets as they pass on the wire to review for interesting information
 - **MAC**  (Media Access Control) - physical or burned-in address - assigned to NIC for communications at the Data Link layer
    - 48 bits long
    - Displayed as 12 hex characters separated by colons
    - First half of address is the **organizationally unique identifier** - identifies manufacurer
    - Second half ensures no two cards on a subnet will have the same address
 - NICs normally only process signals meant for it
 - **Promiscuous mode** - NIC must be in this setting to look at all frames passing on the wire
 - **CSMA/CD** - Carrier Sense Multiple Access/Collision Detection - used over Ethernet to decide who can talk
 - **Collision Domains**
    - Traffic from your NIC (regardless of mode) can only be seen within the same collision domain
    - Hubs by default have one collision domain
    - Switches have a collision domain for each port

### Protocols Susceptible

- SMTP is sent in plain text and is viewable over the wire.  SMTP v3 limits the information you can get, but you can still see it.
- FTP sends user ID and password in clear text
- TFTP passes everything in clear text
- IMAP, POP3, NNTP and HTTP all  send over clear text data
- TCP shows sequence numbers (usable in session hijacking)
- TCP and UCP show open ports
- IP shows source and destination addresses

### ARP

- Stands for Address Resolution Protocol
- Resolves IP address to a MAC address
- Packets are ARP_REQUEST and ARP_REPLY
- Each computer maintains it's own ARP cache, which can be poisoned
- **Commands**
  - arp -a - displays current ARP cache
  - arp -d * - clears ARP cache
- Works on a broadcast basis - both requests and replies are broadcast to everyone
- **Gratuitous ARP** - special packet to update ARP cache even without a request
  - This is used to poison cache on other machines

### IPv6

- Uses 128-bit address
- Has eight groups of four hexadecimal digits
- Sections with all 0s can be shorted to nothing (just has start and end colons)
- Double colon can only be used once
- Loopback address is ::1

| IPv6 Address Type | Description                                                       |
| ----------------- | ----------------------------------------------------------------  |
| Unicast           | Addressed and intended for one host interface but can be mirrored |
| Multicast         | Addressed for multiple host interfaces                            |
| Anycast           | Large number of hosts can receive; nearest host opens             |

| IPv6 Scopes | Description                                                  |
| ----------- | ------------------------------------------------------------ |
| Link local  | Applies only to hosts on the same subnet (Address block fe80::/10) |
| Site local  | Applies to hosts within the same organization (Address block FEC0::/10) |
| Global      | Includes everything                                          |

- Scope applies for multicast and anycast
- Traditional network scanning is **computationally less feasible**

### Wiretapping

- **Lawful interception** - legally intercepting communications between two parties
- **Active** - interjecting something into the communication
- **Passive** - only monitors and records the data
- **PRISM** - system used by NSA to wiretap external data coming into US

### Active and Passive Sniffing

- **Passive sniffing** - watching network traffic without interaction; only works for same collision domain
- **Active sniffing** - uses methods to make a switch send traffic to you even though it isn't destined for your machine
- **Span port** - switch configuration that makes the switch send a copy of all frames from other ports to a specific port
  - Not all switches have the ability to do this
  - Modern switches sometimes don't allow span ports to send data - you can only listen
- **Network tap** - special port on a switch that allows the connected device to see all traffic
- **Port mirroring** - another word for span port

### MAC Flooding

- Switches either flood or forward data
- If a switch doesn't know what MAC address is on a port, it will flood the data until it finds out
- **CAM Table** - the table on a switch that stores which MAC address is on which port
  - If table is empty or full, everything is sent  to all ports
- This works by sending so many MAC addresses to the CAM table that it can't keep up
- **Tools**
  - Etherflood
  - Macof
- **Switch port stealing** - tries to update information regarding a specific port in a race condition
- MAC Flooding will often destroy the switch before you get anything useful, doesn't last long and it will get you noticed.  Also, most modern switches protect against this.

### ARP Poisioning

- Also called ARP spoofing or gratuitous ARP
- This can trigger alerts because of the constant need to keep updating the ARP cache of machines
- Changes the cache of machines so that packets are sent to you instead of the intended target
- **Countermeasures**
  - Dynamic ARP Inspection using DHCP snooping
  - XArp can also watch for this
  - Default gateway MAC can also be added permanently into each machine's cache
- **Tools**
  - Cain and Abel
  - WinArpAttacker
  - Ufasoft
  - dsniff

### DHCP Starvation

- Attempt to exhaust all available addresses from the server
- Attacker sends so many requests that the address space allocated is exhausted
- DHCPv4 packets - DHCPDISCOVER, DHCPOFFER, DHCPREQUEST, DHCPACK
- DHCPv6 packets - Solicit, Advertise, Request (Confirm/Renew), Reply
- **DHCP Steps**
  1. Client sends DHCPDISCOVER
  2. Server responds with DHCPOFFER
  3. Client sends request for IP with DHCPREQUEST
  4. Server sends address and config via DHCPACK
- **Tools**
  - Yersinia
  - DHCPstarv
- Mitigation is to configure DHCP snooping
- **Rogue DHCP Server** - setup to offer addresses instead of real server.  Can be combined with starvation to real server.

### Spoofing

- **MAC Spoofing** - changes your MAC address.  Benefit is CAM table uses most recent address.
- Port security can slow this down, but doesn't always stop it
- MAC Spoofing makes the switch send  all packets to your address instead of the intended one until the CAM table is updated with the real address again
- **IRDP Spoofing** - hacker sends ICMP Router Discovery Protocol messages advertising a malicious gateway
- **DNS Poisioning** - changes where machines get their DNS info from, allowing attacker to redirect to malicious websites

### Sniffing Tools

- **Wireshark**
  - Previously known as Ethereal
  - Can be used to follow streams of data
  - Can also filter the  packets so you can find  a specific type or specific source address
  - **Example filters**
    - ! (arp or icmp or dns) - filters out the "noise" from ARP, DNS and ICMP requests
    - http.request - displays HTTP GET requests
    - tcp contains string - displays TCP segments that contain the word "string"
    - ip.addr==<IP_ADDRESS> && tcp.port==23 - displays telnet packets containing that IP
    - tcp.flags==0x16 - filters TCP requests with ACK flag set
- **tcpdump**
  - Recent version is WinDump (for Windows)
  - **Syntax**
    - tcpdump flag(s) interface
    - tcpdump -i eth1 - puts the interface in listening mode
- **tcptrace**
  - Analyzes files produced by packet capture programs such as Wireshark, tcpdump and Etherpeek
- **Other Tools**
  - **Ettercap** - also can be used for MITM attacks, ARP poisoning.  Has active and passive sniffing.
  - **Capsa Network Analyzer**
  - **Snort** - usually discussed as an Intrusion Detection application
  - **Sniff-O-Matic**
  - **EtherPeek**
  - **WinDump**
  - **WinSniffer**

### Devices To Evade

- **Intrusion Detection System** (IDS) - hardware or software devices that examine streams of packets for malicious behavior
  - **Signature based** - compares packets  against a list of known traffic patterns
  - **Anomaly based** - makes decisions on alerts based on learned behavior and "normal" patterns
  - **False negative** - case where traffic was malicious, but the IDS did not pick it up
  - **HIDS** (Host-based intrusion detection system) - IDS that is host-based
  - **NIDS** (Network-based intrusion detection system) - IDS that scans network traffic
- **Snort** - a  widely deployed IDS that is open source
  - Includes a sniffer, traffic logger and a protocol analyzer
  - Runs in three different modes
    - **Sniffer** - watches packets in real time
    - **Packet logger** - saves packets to disk for review at a later time
    - **NIDS** - analyzes network traffic against various rule sets
  - Default actions: Pass, Drop, Alert, Log
  - Configuration is in /etc/snort on Linux and c:\snort\etc in Windows
  - **Rule syntax**
    - alert tcp !HOME_NET any -> $HOME_NET 31337 (msg : "BACKDOOR ATTEMPT-Backorifice")
      - This alerts about traffic coming not from an external network to the internal one on port 31337
  - **Example output**
    - 10/19-14:48:38.543734 0:48:542:2A:67 -> 0:10:B5:3C:34:C4 type:0x800 len:0x5EA
      **xxx -> xxx TCP TTL:64 TOS:0x0 ID:18112 IpLen:20 DgmLen:1500 DF**
    - Important info is bolded
- **Firewall**
  - An appliance within a network that protects internal resources from unauthorized access
  - Only uses rules that **implicitly denies** traffic unless it is allowed
  - Oftentimes uses **network address translation** (NAT) which can apply a one-to-one or one-to-many relationship between external and internal IP addresses
  - **Screened subnet** - hosts all public-facing servers and services
  - **Bastion hosts** - hosts on the screened subnet designed to protect internal resources
  - **Private zone** - hosts internal hosts that only respond to requests from within that zone
  - **Multi-homed** - firewall that has two or more interfaces (standard for hardware)
  - **Packet-filtering** - firewalls that only looked at headers (Layer 3)
  - **Stateful inspection** - firewalls that track the entire status of a connection
  - **Circuit-level gateway** - firewall that works on Layer 5 (Session layer)
  - **Application-level gateway** - firewall that works like a proxy, allowing specific services in and out
- **THOR**
  - Scans for APT activity

### Evasion Techniques

- **Slow down** - faster scanning such as using nmap's -T5 switch will get you caught.  Pros use -T1 switch to get better results
- **Flood the network** - trigger alerts that aren't your intended attack so that you confuse firewalls/IDS and network admins
- **Fragmentation** -  splits up packets so that the IDS can't detect the real intent
- **Unicode encoding** - works with web requests - using Unicode characters instead of ascii can sometimes get past
- **Tools**
  - **Nessus** - also a vulnerability scanner
  - **ADMmutate** - creates scripts not recognizable by signature files
  - **NIDSbench** - older tool for fragmenting bits
  - **Inundator** - flooding tool

### Firewall Evasion

- ICMP Type 3 Code 13 will show that  traffic is being blocked by firewall
- ICMP Type 3 Code 3 tells you the client itself has the port closed
- Firewall type can be discerned by banner grabbing
- **Firewalking** - going through every port on a firewall to determine what is open
  - Gives a TTL error when a port is closed
- **Tools**
  - CovertTCP
  - ICMP Shell
  - 007 Shell
- The best way around a firewall will always be a compromised internal machine

### Honeypots

- A system setup as a decoy to entice attackers
- Should not include too many open services or look too easy to attack
- **High interaction** - simulates all services and applications and is designed to be completely compromised
- **Low interaction** - simulates a number of services and cannot be completely compromised
- **Examples**
  - Specter
  - Honeyd
  - KFSensor

url: https://raw.githubusercontent.com/madtempest/CEHv10StudyGuide/91c49b5d4ff657c659ac49db108fd3dfc848f570/4 - Sniffing and Evasion.md

path: /4 - Sniffing and Evasion.md

filename: 4 - Sniffing and Evasion.md


text:
---
project.description: Achieve at-least-once semantics with offset committing in Alpakka Kafka.
---
# At-Least-Once Delivery

At-least-once delivery semantics, the requirement to process every message, is a basic requirement of most applications.

When using committable sources (@ref:[Offset Storage in Kafka](consumer.md#offset-storage-in-kafka-committing)), care is needed to ensure at-least-once delivery semantics are not lost inadvertently by committing an offset too early.

Below are some scenarios where this risk is present. These risks can easily be overlooked. Problems can also go undetected during tests since they depend on abruptly interrupting
the flow in a particular state, and that state could be unlikely to occur.

## Multiple Effects per Commit

### Multiple Messages

When connecting a committable source to a producer flow, some applications may require each consumed message to produce more than one message. In that case, in order to preserve at-least-once semantics, the message offset should only be committed after all associated messages have been produced.

To achieve this, use the @scaladoc[ProducerMessage.MultiMessage](akka.kafka.ProducerMessage$$MultiMessage) implementation of @scaladoc[ProducerMessage.Envelope](akka.kafka.ProducerMessage$$Envelope):

Scala
: @@ snip [snip](/tests/src/test/scala/docs/scaladsl/AtLeastOnce.scala) { #oneToMany }

Java
: @@ snip [snip](/tests/src/test/java/docs/javadsl/AtLeastOnceTest.java) { #oneToMany }

### Batches

If committable messages are processed in batches (using `batch` or `grouped`), it is also important to commit the resulting @scaladoc[CommittableOffsetBatch](akka.kafka.ConsumerMessage$$CommittableOffsetBatch) only after all messages in the batch are fully processed.

Should the batch need to be split up again, using mapConcat, care should be taken to associate the @scaladoc[CommittableOffsetBatch](akka.kafka.ConsumerMessage$$CommittableOffsetBatch) only with the last message. This scenario could occur if we created batches to more efficiently update a database and then needed to split up the batches to send individual messages to a Kafka producer flow.

### Multiple Destinations

In the Conditional Message Processing section below we discuss how to handle producing to multiple Kafka topics, but here we consider writing to other types of persistent storage, or performing other side-effects, perhaps in addition to producing to Kafka topics.

To commit an offset or an offset batch only after the multiple effects have been performed, we will usually want to assemble our side-effecting flows in series, one after the other. This still allows the side effects to be performed concurrently on distinct messages, using `mapAsync` for example.

Alternatively, we could split-off the flow using `alsoTo` to perform the effects in distinct parallel flows. We would then use `zip` to bring the two flows back together and re-associate the matching committable offsets. This step is important to ensure that we only commit an offset once the effects from both flows are complete. This constrains the two flows to output the exact same sequence of committable offsets. So this approach may not be significantly more flexible then a serial arrangement.

## Non-Sequential Processing

Messages from committable sources should be processed in order, otherwise a larger offset for a partition could be committed before the work associated to a smaller offset has been completed.

Reordering would be acceptable if the original order was reconstituted before committing the offsets, but that is a fairly complex and possibly brittle process that we will not consider here.

Using `mapAsync` is safe since it preserves the order of messages. That is in contrast to `mapAsyncUnordered` which would not be safe to use here. As indicated in the @extref[Akka Streams documentation](akka:/stream/stream-flows-and-basics.html#stream-ordering) almost all stages will preserve input ordering.

### Using groupBy

Using `groupBy` followed at some point by a `mergeSubstreams` can reorder messages, so in general it is not safe with respect to the at-least-once guarantee.

However it can only lead to reordering between messages sent to different substreams, so it is possible to use `groupBy` and preserve at-least-once semantics as long as all messages from the same partition are sent to the same substream.

If a particular substream expects to see all messages regarding some entity, it then requires that writers to the source topic become responsible for placing messages about various entities in the appropriate partitions. If your application already has a requirement to preserve the order of messages about a particular entity within a Kafka topic, you will already need to ensure those messages go to the same partition since Kafka only preserves order information within a partition.

## Conditional Message Processing

Most flows will require some messages to be handled differently from others. Unfortunately this is difficult to do while preserving the at-least-once guarantee because the order of messages must be maintained.

We cannot safely send off the messages to be handled differently to a distinct flow: this other flow cannot commit on its own, and even if we merge it back, downstream, with the main flow, ordering will not be preserved. The reason this separate flow cannot commit on its own is that it will only be seeing a subset of the committable messages. If it commits an offset, it cannot know that all prior offsets have been processed in the main flow.

This is a significant challenge. Below we suggest a few strategies to deal with some special cases of this general problem.

### Publishing to Message-Dependent Topics

Since @javadoc[ProducerRecord](org.apache.kafka.clients.producer.ProducerRecord) contains the destination topic, it is possible to use a single producer flow to write to any number of topics. This preserves the ordering of messages coming from the committable source. Since the destination topics likely admit different types of messages, it will be necessary to serialize the messages to the appropriate input type for the common producer flow, which could be a byte array or a string.

In case a committable message should lead to the production of multiple messages, the @scaladoc[ProducerMessage.MultiMessage](akka.kafka.ProducerMessage$$MultiMessage) is available. If no messages should be produced, the @scaladoc[ProducerMessage.PassThroughMessage](akka.kafka.ProducerMessage$$PassThroughMessage) can be used.

Scala
: @@ snip [snip](/tests/src/test/scala/docs/scaladsl/AtLeastOnce.scala) { #oneToConditional }

Java
: @@ snip [snip](/tests/src/test/java/docs/javadsl/AtLeastOnceTest.java) { #oneToConditional }

### Excluding Messages

Failure to deserialize a message is a particular case of conditional message processing. It is also likely that we would have no message to produce to Kafka when we encounter messages that fail to deserialize. As described above, the producer flow will not let us pass through the corresponding committable offset without producing a message.

Why can't we commit the offsets of bad messages as soon as we encounter them, instead of passing them downstream? Because the previous offsets, for messages that have deserialized successfully, may not have been committed yet. That's possible if the downstream flow includes a buffer, an asynchronous boundary or performs batching. It is then likely that some previous messages would concurrently be making their way downstream to a final committing stage.

Note that here we assume that we take the full control over the handling of messages that fail to deserialize. To do this, we should not ask for the deserialization to be performed by the committable source. We can instead create a @apidoc[ConsumerSettings$] parametrized by byte arrays. A subsequent `map` can deserialize and use @scaladoc[ProducerMessage.PassThroughMessage](akka.kafka.ProducerMessage$$PassThroughMessage) to skip bad messages.


text:
# Hebelomatis ingratum (Bruchet) Locq., 1979 SPECIES

#### Status
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Fl. Mycol. , 3. Cortinariales-A. 1463 (1979)

#### Original name
Hebeloma ingratum Bruchet, 1970

### Remarks
null

repository: mdoering/backbone

path: /life/Fungi/Basidiomycota/Agaricomycetes/Agaricales/Strophariaceae/Hebeloma/Hebeloma ingratum/ Syn. Hebelomatis ingratum/README.md

repo_name: mdoering/backbone


text:
# Slonik - An experiment from the past for the Python PostgreSQL driver of the Future

[![CircleCI](https://circleci.com/gh/peopledoc/slonik.svg?style=shield)](https://circleci.com/gh/peopledoc/slonik)

Rust Inside™

A Python binding to [`rust-postgres`](https://github.com/sfackler/rust-postgres), a native PostgreSQL driver for Rust.

IRC channel: [#slonik](https://webchat.freenode.net/?channels=slonik) on [freenode](https://freenode.net/).

**Note: Slonik started as an experiment, and will probably never go past that.** We've learned tons of things during its creation, two of them being that programs using CFFI are bound to be slower (with CPython) than implementations using the Python C API, and that interfacing the Python Event Loop with the async support of Rust is… challenging at best.

repository: peopledoc/slonik

repo_name: peopledoc/slonik


text:
# oakfest.net

[![Build Status](https://travis-ci.org/oakfest/oakfest.github.io.svg?branch=develop)](https://travis-ci.org/oakfest/oakfest.github.io)

## Contributing
Make all pull requests to develop. All changes to develop are automatically built and deployed to master by travisci.
Pull requests containing corrections, typo fixes, rewording, or additional info are greatly appreciated.

### Site content

All of the site content is generated from [data.js](https://github.com/oakfest/oakfest.github.io/blob/develop/data.js).
You can edit anything on the site by changing it in that file. All of the sponsors are in there too and the list of rules and faqs.

All sponsor images are stored in [src/images/sponsors](https://github.com/oakfest/oakfest.github.io/tree/develop/src/images/sponsors).
Logos can be updated by just overwriting the images in that directory.

## Building Locally
```
$ yarn install
$ yarn run build
```

branch_name: refs/heads/develop


text:
## capslockstate jQuery plugin

capslockstate is a jQuery plugin for monitoring and reporting the state of the Caps Lock key.  It will trigger events when the state changes and has a method to return the current state.

### Quickstart and demo

You can experiment with and see how capslockstate works on [jsFiddle](http://jsfiddle.net/nosilleg/zVCU5/).

### Documentation

Documentation on how to use this plugin can be found at the [Wiki](https://github.com/nosilleg/capslockstate-jquery-plugin/wiki).

### License

capslockstate is released under the MIT license.  See the [license](https://github.com/nosilleg/capslockstate-jquery-plugin/blob/master/MIT-LICENSE.txt) for details.


text:
[![codecov](https://codecov.io/gh/Wikunia/Enigma.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/Wikunia/Enigma.jl)
[![Docs](https://img.shields.io/badge/docs-latest-blue.svg)](https://wikunia.github.io/Enigma.jl/dev)

[Blog post](https://opensourc.es/blog/enigma-and-bombe)

# Enigma

You'll be able to decode and encode messages like using the [Enigma Machine](https://en.wikipedia.org/wiki/Enigma_machine)
with this package.

## Installation
You can install this julia package using
`] add Enigma` or if you want to change code you might want to use
`] dev Enigma`.

## Simple usage

```
using Enigma

# initialize the Enigma machine with standard settings
enigma = EnigmaMachine()
# set the rotors to I, II, III (left to right)
set_rotors!(enigma, 1,2,3)
# the start of the rotor positions
set_rotor_positions!(enigma, 10,20,4)
# set the reflector (ukw = Umkehrwalze = reflector) to UKW B
set_ukw!(enigma, 2)
# Connecting A and C, B and E, ... on the plugboard
set_plugboard!(enigma, "AC BE GZ JK ML")

message = "Secret message"
encoded = encode!(enigma, message)
println("encoded: $encoded")
```

This will generate:

```
encoded: KPXDG MWRWF SNN
```

and to decode that message you have to set the starting positions of the rotors again and decode the message. (Actually it's the same as encoding it.)

```
set_rotor_positions!(enigma, 10,20,4)
decoded = decode!(enigma, encoded)
println("decoded: $decoded")
```

and surprise we get:

```
decoded: SECRE TMESS AGE
```

## Cracking using the Bombe

The Enigma code was famously cracked by Alan Turing and Co. in Bletchley Park.

This package also support to crack codes.

```
crack_message = "HGHXI AGYEY NDIFW PRMDD QSMJG DCAKP FMIZL RVQIZ WRLJM "
hint = "weatherreport"
```

You got that weird message and you think that the word `weatherreport` starts at the first 5 chars to support something like
`A weatherreport` or `The weatherreport` and stuff like that.

First you define the `BombeMachine` by given the secret text and the `hint`.
Then you can crack the code and it will check `weatherreport` on all positions and all possible plug setting, rotors, rotor positions and the three ukws.

```
bombe = BombeMachine(crack_message, hint)
enigmas = run_cracking(bombe; log=false)
```
That might take a while. Therefore you can give more hints.

```
# you know that rotor V is not used and the left most rotor is III
set_possible_rotors!(bombe, 3,1:4,1:4)
# Maybe you also know that the rotor position of III is something between 1 and 5.
set_possible_rotor_positions!(bombe, 1:5,1:26,1:26)
# The ukw is UKW A
set_possible_ukws!(bombe, 1)
# and the hint positions
set_possible_hint_positions!(bombe, 1:5)
enigmas = run_cracking(bombe; log=false);
```

This gets cracked in a few seconds now. The result is a set of enigma machines.

Then you can run:

```
for enigma in enigmas
    encoded = encode!(enigma, crack_message)
    println(encoded)
end
```

One of the 11 found solutions is the message.

Unfortunately sometimes the hint is not enough to get the correct solution because some plugs can be removed from the real setting and still produce the hint. These extra plugs are hard to generate (well sometimes there are a lot)
Of course this package gives you the possibility to test all those combinations which often takes much longer and you probably be able to guess the message without it.

You really want to set this option? Okay here you go:

```
enable_ambiguous!(bombe)
```

and then run `enigmas = run_cracking(bombe; log=false);` again.

## Videos about this project

[![Enigma Video](https://img.youtube.com/vi/4cf7dc_8u44/0.jpg)](https://www.youtube.com/watch?v=4cf7dc_8u44)
[![Bombe Video](https://img.youtube.com/vi/bRT5YKez8m4/0.jpg)](https://youtu.be/bRT5YKez8m4)

gha_language: Julia