text:
# Eatit

This is an androdi App That uses Firebase For its Database Purpose

It Has Two Parts

# Client Side
[Eat It](https://github.com/DAKSHSEMWAL/Eatit/tree/master/Client%20Side/EatIt2)

  ![EatIT Logo](https://github.com/DAKSHSEMWAL/Eatit/blob/master/Client%20Side/EatIt2/eatitlogo.png)

 * Link To Vidio Showing The Working oF Clinet Side App
  [![](http://img.youtube.com/vi/-nLGb7KCfAU/0.jpg)](http://www.youtube.com/watch?v=-nLGb7KCfAU "Eat IT Client Side App")

  ![App Drawr](https://github.com/DAKSHSEMWAL/Eatit/blob/master/Client%20Side/EatIt2/Screenshot_20180919-015240.png)

  ![Main Page](https://github.com/DAKSHSEMWAL/Eatit/blob/master/Client%20Side/EatIt2/Screenshot_20180919-015329.png)

  ![Sign In Page](https://github.com/DAKSHSEMWAL/Eatit/blob/master/Client%20Side/EatIt2/Screenshot_20180919-015338.png)

  ![Sign Up Page](https://github.com/DAKSHSEMWAL/Eatit/blob/master/Client%20Side/EatIt2/Screenshot_20180919-021646.png)

  ![Menu Page](https://github.com/DAKSHSEMWAL/Eatit/blob/master/Client%20Side/EatIt2/Screenshot_20180919-015346.png)

  ![Navigation Drawer](https://github.com/DAKSHSEMWAL/Eatit/blob/master/Client%20Side/EatIt2/Screenshot_20180919-015351.png)

  ![Food List Page](https://github.com/DAKSHSEMWAL/Eatit/blob/master/Client%20Side/EatIt2/Screenshot_20180919-015403.png)

  ![Material Search Bar](https://github.com/DAKSHSEMWAL/Eatit/blob/master/Client%20Side/EatIt2/Screenshot_20180919-015411.png)

  ![Search Result](https://github.com/DAKSHSEMWAL/Eatit/blob/master/Client%20Side/EatIt2/Screenshot_20180919-020910.png)

  ![Food Detail Page](https://github.com/DAKSHSEMWAL/Eatit/blob/master/Client%20Side/EatIt2/Screenshot_20180919-020920.png)

  ![Food Cart Page](https://github.com/DAKSHSEMWAL/Eatit/blob/master/Client%20Side/EatIt2/Screenshot_20180919-021724.png)

  ![Order History](https://github.com/DAKSHSEMWAL/Eatit/blob/master/Client%20Side/EatIt2/Screenshot_20180919-035618.png)

# Server Side


text:
# Arrays

An array is an ordered list of elements that has a number as position called index, arrays are mutable, can store any type of value the typeof is object

## There are five ways to create ana array:

1. **Arrays literals**: manual creation

2. **Array constructor**: you can create an empty array or an array with a length desired it's the same as creating an array literal

```js
  const a = new Array(10); // creates an sparse array with the length of 10
  const b = new Array('rafael', 'andres'); // the same as an array literal
  const c = new Array('garcia', 'perez'); //  another array literal
  const d = new Array( b , c ) //create nested arrays [['rafael', 'andres'],['garcia', 'perez']]
  d[1][1] = 'ortega' // the array copy is referenced, it means that this modification also affect the original (side effects)
```

3. **Array.of()**: almost the same as `new Array` but with the difference that allows you to create an array with a number value that not set the length of the array

```JS
  const a = Array.of(10); //=> [10];
 ```

4. **Array.from(arrayToCopy, x => x + x):** you can copy other array and as second parameter you can pas a function to copy the elements modified.

```JS
const a  = Array.from('rafael'); // works like the spread operator
const b = Array.from(a, v =>  v.toUpperCase());
let c = b.join(''); // => RAFAEL
console.log(b); //=> ["R", "A", "F", "A", "E", "L"]; works like map
console.log(a); //=> ["r", "a", "f", "a", "e", "l"]; do not make side effects

// can filter repeated items wit `new Set`
const d = new Set([...'andreeeeesss']); //=> [[a],[n],[d],[r],[e],[s]];
const e = Array.from(d); //=> ["a", "n", "d", "r", "e", "s"];

// Create an array based on a property of DOM Elements
const images = document.getElementsByTagName('img');
const sources = Array.from(images, image => image.src);
const insecureSources = sources.filter(link => link.startsWith('http://'));
```

5. **Spread operator** `[ . .  . arrayToCopy ]` you can copy an array and also you can insert the elements of one array inside of another array, also I can convert a string in a array

```js
  // Concatenate 2 arrays
  let a = [1, 2, 3];
  let b = [4, 5, 6];
  let c = [...a, ...b]; // no side effects
  // insert arrays inside of another array
  let d  = [ 1, 2, . . . arrayToCopy, 4, 5];
  // can split strings
  let e = [ . . . “Hello”] // results will be [ “H”, “e”, “l”, “l”, “o”];
```

## Using **Set()** with _**spread operator**_

I can filter repeated elements in an array without adding the prototype of the function **Set**

```js
let a = [ . . . new Set (b)]; // a is now [ “H”, “e”, “l”, “o”];
```

## The _length_ property of the array

can be used to know the index number on the array, count also the spaces in a sparse array, you can also delete items fixing the length of an array or simply delete all the items.

```js
let b = [ . . . “Hello”] // => [ “H”, “e”, “l”, “l”, “o”]
b.length     // => the length is 5
b.length = 3 // deletes the index 3, 4.
b.length = 0 // => [] delete the elements of the array
```

## Adding and deleting arrays elements

- **pop()** this method remove the last element of the array reducing the length and return the value.

```js
  let a = [...'Rafael']; // => ['R', 'a', 'f', 'a', 'e', 'l'] length of 6
  let arrayToPop = a.pop(); // => 'l';
  // a will be modified
  console.log(a, a.length) // => ['R', 'a', 'f', 'a', 'e'] length of 5
```

- **push** this method add one element at the end of the array is the same as assigning the value to a[a.length].

 ```js
  a.push(arrayToPop); // => ['R', 'a', 'f', 'a', 'e', 'l'] length of 6
 ```

- **shift** this method remove the first element of the array reducing the length, reorder de index and return the value.

 ```js
  let arrayToShift = a.shift(); // => 'R';
  // a will be modified
  console.log(a) // => ['a', 'f', 'a', 'e', 'l'] length of 5
```

- **unshift()** this method add one element at the beginning of the array.

 ```js
  a.unshift(arrayToShift); // => ['R', 'a', 'f', 'a', 'e', 'l'] length of 6
 ```

- **splice** this method can add elements in any place of the array, add and remove at the same time or only remove, it works with 2 parameters the first is the position where is going to be inserted the element and the second the numbers of elements to delete starting from the index of the first parameter

 ```js

  let fruits = ['banana', 'fraise', 'apple', 'carrot', 'potato', 'grapes'];
  // add one fruit after fraise
  fruits.splice(2, 0, 'peach'); // => ['banana', 'fraise', 'peach', 'apple', 'carrot', 'potato' 'grapes'];
  // adding melon and after apple and delete carrot and potato
  fruits.splice(4, 2, 'melon'); // => ["banana", "fraise", "peach", "apple", "melon", "grapes"]
  // deleting at certain elements
  let bigFruit =  fruits.splice(4,1); // => melon
  // fruits final status
  console.log(fruits); // ["banana", "fraise", "peach", "apple", "grapes"]
  // delete all elements
  fruit.splice(2); // => ["banana", "fraise"]
 ```

- **slice** this method copy the elements desired in the array, uses two parameters, the first is the index where you want to start copying and the second the limiter index of the section you want to copy

```js
  let fruitsSliced =  fruits.slice(1, 4); // ["fraise", "peach", "apple"]
```

- **delete** this operator can delete an element of an array or the property of an objet _using this property in arrays do not alter the length of the array creating a sparse array_

```js
  let pets = ['dog', 'cat', 'bird', 'apple', 'rabbit'];
  delete pets[3];
  console.log(3 in pets);// false, apple is not in the array
  pets.length // => 4
```

## Iterate  with arrays

Arrays like strings can use the same iterators could be a **for**-**for of**-**while**-**forEach method**

```js
  let nameLetters = [...'rafael']; // ['r', 'a', 'f', 'a', 'e', 'l']
  let name = '';
  // Using for of => 'rafael'
  for (let element of nameLetters) {
    name += element;
  }

  // accessing to keys with a entries() method
  let newArray = [];
  for (let [key, element]  of nameLetters.entries()) {
    //// letters at even indexes
    if (index % 2 === 0)  {
      newArray.push(element);
    }
  }

  // maintaining the array dense
  let denseArray = [];
  for (let element of nameLetters) {
    if (element !== undefined && element !== null) {
      denseArray.push(element);
    }
  }

  // with regular loop

  let denseArray = [];
for (let i = 0; i < newArray.length; i++ ) {
  if (newArray[i] === undefined || newArray[i] === null) {
    continue
    } else {
      denseArray.push(newArray[i]);
    };
  }

  // accessing with a regular loop
  for (let i = 0; i < nameLetters.length; i++) {
    newArray.push(nameLetters[i]);
  }
```

## Create a multidimensional array

```js
let table = new Array(10); // 10 rows of the table
for (let i = 0; i < table.length; i++) {
  table[i] = new Array(10); // Each row has 10 columns
}
// Initialize the array
for (let row = 0; row < table.length; row++) {
  for (let col = 0; col < table[row].length; col++) {
    table[row][col] = row * col;
  }
}
// Use the multidimensional array to compute 5*7
console.log(table); // => 35
```

## Array methods

- **The forEach() method**
  The `forEach()` method iterates through an array, invoking a function you specify for each element. As described, you pass the function as the first argument to `forEach()`. `forEach()` then invokes your function with three arguments: the value of the array element, the index of the array element, and the array itself. If you only care about the value of the array element, you can write a function with only one parameter the additional arguments will be ignored, **the return value of `forEach` is undefined**

```js
  let data = [1,2,3,4,5], sum = 0; // Compute the sum of the elements of the array
  data.forEach(value => { sum += value; });
  console.log(sum); // sum = 15 // Now increment each array element
  data.forEach(function(v, i, a) { a[i] = v + 1; }); // data == [2,3,4,5,6]
  // Reverse strings
  let name = 'andres';
  let reversedUpperCased = '';
  [...name].reverse().forEach(letter => reversedUpperCased += letter.toUpperCase() );
  console.log(reversedUpperCased); // => SERDNA
```

- **The map() method**
  The `map()` method passes each element of the array on which it is invoked to the function you specify and returns an array containing the values returned by your function. Note that `map()` returns a new array: it does not modify the array it is invoked on. If that array is sparse, your function will not be called for the missing elements, but the returned array will be sparse in the same way as the original array: it will have the same length and the same missing elements. This method is very similar than `forEach()`.

```js
  let a = [1, 2, 3];
  let  b = a.map(x => x*x) // => [1, 4, 9]: the function takes input x and returns x*x
  console.log(b); // array mapped
  console.log(a); // original array not modified
```

- **The filter() method**
  If the return value is true, or a value that converts to true, then the element passed to the predicate is a member of the subset and is added to the array that will become the return value.

```js
  let a = [5, 4, 3, 2, 1];
  a.filter(x => x < 3) // => [2, 1]; values less than 3
  a.filter((x,i) => i % 2 === 0) // => [5, 3, 1]; every other value
  let dense = sparse.filter(() => true); //To close the gaps in a sparse array,
  a = a.filter(x => x !== undefined && x !== null); //close gaps and remove undefined and null elements

  let array = new Array(null, false, 12, '', NaN, 'hello', true);
  let filteredArray = array.filter(x => Boolean(x) === true );
  console.log('array filtered => ', filteredArray); // => [12, "hello", true]
  console.log('original array => ', array); // => [null, false, 12, "", NaN, "hello", true]
```

- **The find() method** this method stop iterating the first time the predicate finds an element. When that happens,  returns the matching element, if not matches fund
  find return undefined

```js
  let a = [1,2,3,4,5];
  a.find(x => x % 5 === 0) // => 5: this is a multiple of 5
  a.find(x => x % 7 === 0) // => undefined: no multiples of 7 in the array
```

- **The findIndex() method** this method stop iterating the first time the predicate finds an element. When that happens,  returns the index of the element, if not matches fund findIndex return -1

```js
  let a = [1,2,3,4,5];
  a.findIndex(x => x === 3) // => 2; the value 3 appears at index 2
  a.findIndex(x => x < 0) // => -1; no negative numbers in the array
```

- **The every() method** returns true only if all the conditions of the value are true

```js
  let a = [1,2,3,4,5];
  a.every(x => x < 10) // => true: all values are < 10.
  a.every(x => x % 2 === 0) // => false: not all values are even.
```

- **The some() method** returns true only if at least one element is true otherwise returns false

```js
  let a = [1,2,3,4,5]; a.some(x => x % 2===0) // => true; a has some even numbers.
  a.some(isNaN) // => false; a has no non-numbers.
```

- **The reduce() and reduceRight() methods**
  Combine the elements of an array, using the function you specify, to produce a single value. Takes two arguments the first is the accumulated result of the reduction, the second is the next value and as optional you can add an initializer, _Note: an empty array give typeError_

```js
  let a = [1,2,3,4,5];
  a.reduce((x,y) => x+y, 0) // => 15; the sum of the values
  a.reduce((x,y) => x*y, 1) // => 120; the product of the values
  a.reduce((x,y) => (x > y) ? x : y) // => 5; the largest of the values
  // reduceRight makes the same as reduce but from right to left
  let stringReversed = [...'andres'].reduceRight((x,y) => x + y);
  console.log(stringReversed);  // => 'serdna'
```

## Flattening arrays with flat() and flatMap()

In ES2019, the flat() method creates and returns a new array that contains the same elements as the array it is called on, except that any elements that are themselves arrays are “flattened” into the returned array. For example:

```js
  [1, [2, 3]].flat() // => [1, 2, 3]
  [1, [2, [3]]].flat() // => [1, 2, [3]]
  let a = [1, [2, [3, [4]]]];
  a.flat(1) // => [1, 2, [3, [4]]]
  a.flat(2) // => [1, 2, 3, [4]]
  a.flat(3) // => [1, 2, 3, 4]
  a.flat(4) // => [1, 2, 3, 4]
  /*------------------------------------------------*/
  let b = [1, [2, [3, [4]]]];
  console.log(a.flat(Infinity)); // => [1, 2, 3, 4];
```

The flatMap() method works just like the map() method (see “map()” except that the returned array is automatically flattened as if passed to flat(). That is, calling a.flatMap(f) is the same as (but more efficient than) a.map(f).flat():

```js
  let phrases = ["hello world", "the definitive guide"];
  let words = phrases.flatMap(phrase => phrase.split(" "));
  console.log(words); // => ["hello", "world", "the", "definitive", "guide"];
  words.splice(words.indexOf('world'), 1, 'mundo'); //=> ["hello", "mundo", "the", "definitive", "guide"]
  console.log('word changed => ', words);
```

## Array Searching and Sorting Methods

- **indexOf() and lastIndexOf()** search an array for an element with a specified value and return the index of the first such element found, or -1 if none is found. indexOf() searches the array from beginning to end, and lastIndexOf() searches from end to beginning:

```js
  let a = [0,1,2,1,0];
  a.indexOf(1) // => 1: a[1] is 1
  a.lastIndexOf(1) // => 3: a[3] is 1
  a.indexOf(3) // => -1: no element has value 3
```

  indexOf() and lastIndexOf() compare their argument to the array elements using the equivalent of the === operator. If your array contains objects instead of primitive values, these methods check to see if two references both refer to exactly the same object. Use find() for objects

- **includes()**
The ES2016 includes() method takes a single argument and returns true if the array contains that value or false otherwise. Is has a difference with lastIndex because it consider NaN equal to itself

```js
  let a = [1,true,3,NaN];
  a.includes(true) // => true
  a.includes(2) // => false
  a.includes(NaN) // => true
  a.indexOf(NaN) // => -1; indexOf can't find NaN
```

- **sort()**
  sorts the elements of an array in place and returns the sorted array. When sort() is called with no arguments, it sorts the array elements in alphabetical order (temporarily converting them to strings to perform the comparison, if necessary), **this method does not create a new array sorted, it modify the array that call the method**

  ```js
  let a = ["banana", "cherry", "apple"];
  a.sort();
  console.log(a); // => ["apple", "banana", "cherry"]
  let a = [33, 4, 1111, 222];
  a.sort();
  console.log(a); // => [1111, 222, 33, 4]; alphabetical order
  a.sort((a,b) => a-b);
  console.log(a); // => [4, 33, 222, 1111]; numerical order
  a.sort((a,b) => b-a);
  console.log(a); // => [1111, 222, 33, 4]; reverse numerical order
  ```

license: MIT

branch_name: refs/heads/main

extension: md

license_type: permissive


text:
# Raspi configuration

## Network credentials:
MAC: b8:27:eb:72:0f:55
Network: IoT-B19
password: *********

To know ip address:
`$ ifconfig`

To search raspi ip, use:
`$ sudo nmap -sP bradcast[3].1-254`

Connect using ssh:
`$ ssh<EMAIL_ADDRESS>-l pi`
hint: connection isn't strong enough, so sometimes it is not working well

## Streaming:

option 1:
`$ cd flask-video-streaming/ && python app.py`
now we can take images from:
http://<IP_ADDRESS>:5000/video_feed

option 2:
`$ cd cd Sunfounder_Smart_Video_Car_Kit_for_RaspberryPi/mjpg-streamer/mjpg-streamer/ && sh start.sh`
now we can take images from:
http://<IP_ADDRESS>:8080/?action=stream

option 3:
source: https://www.instructables.com/id/How-to-Make-Raspberry-Pi-Webcam-Server-and-Stream-/
`$ sudo service motion restart`
`$ sudo motion`
now we can take images from:
http://<IP_ADDRESS>:8081

repository: shpotes/self-driving-car

branch_name: refs/heads/master

repo_name: shpotes/self-driving-car


text:
node-exchange
=============

Currency converter API and transaction dashboard for Node.js

### Setup & Install
- Tested: Mac OSX 10.8.5 / Node v0.10.28 / Chrome v34
- `git clone https://github.com/brentwalter/exchange.git` or [download zip](https://github.com/brentwalter/exchange/archive/master.zip)
- `npm install`
- To run tests you'll need `npm install -g nodeunit`
    - Run test from project root with `npm test`

### Exchange Module
- Located `/exchange-module/index.js`
- nodeunit tests: `/exchange-module/test/exchange-spec-fileCacheOnly.js`
- Run tests from project root with: `npm test`
- Static file store in `/exchange-module/data/ratesCache.txt`
- Requests fresh rates from https://openexchangerates.org/
- List of supported currencies can be found [in the file cache](https://github.com/brentwalter/exchange/blob/master/exchange-module/data/ratesCache.txt)

### Server App
- Main file is `app.js` and supplementary modules are in `/app/` directory
- Run app with `npm start` from within the root of the project
- Run tests with `npm test` from within the root of the project (you'll need `npm install -g nodeunit`)
- List of supported currencies can be found [in the file cache](https://github.com/brentwalter/exchange/blob/master/exchange-module/data/ratesCache.txt)
- View dashboard: `http://localhost:3000/paypal/activity`
    - The dashboard has a dropdown to convert all transction amounts to a selected currency using the APIs
- View currencyConversion API: `http://localhost:3000/paypal/currencyConversion?{query}`
    - {query} example: `from=USD&to=CAD&amount=1000`
- View conversionRate API: `http://localhost:3000/paypal/conversionRate?{query}`
    - {query} example: `from=USD&to=CAD`

### Client App
- View the dashboard once the Server App is running: `http://localhost:3000/paypal/activity`
- View qUnit tests by visiting: `http://localhost:3000/script/test/index.html`
- Client app is located: `public/script/app.js`
- Client tests are located: `public/script/test/app-spec.js`

### Things Left To Do
- Exchange Module
    - Better caching of data than static file store. Redis would be a good candidate. It would also enable sharing accross multiple instances.
    - I'd use JSON, not the current data format for the static file store, because it currently incurs a lot of read/write churn
    - When reading file from disk, don't read entire file before checking timestamp, becuase full file isn't needed if http request will be made to fetch fresh data
    - Create http and fs mocks to enable more complete unit testing
    - Implement a more robust logger like Winston
    - Enable support for https
    - Remove my openexchangerates.org API key
    - Make the path parameter for accessing openexchangerate.org more flexible to support their entire API
    - Make all file system paths use path utilites rather than being UNIX, hard coded
    - Publish to NPM
- Server App
    - Improve input validation and error responses
    - Use better logger, like Winston
    - Replace my mock model with a DB-backed model
    - Write Tests for the transactions model
- Client App
    - Not use Bootstrap with hacky, brittle overrides for CSS. Implement SCSS.
    - Inject the transactions model into the client so I don't have to parse the DOM to get the amounts data before doing currency conversion
    - Share template partial to make rendering client/serverside identical
    - Source options for the dropdown dynamically from server data
    - If filtering, sorting, interacting, adding, deleting, etc. is required, convert into Require.js/Backbone app
    - Mock $.get() to have more complete unit tests
    - Add Capert.js for automated integration tests
    - Add Grunt for better asset optimization and developer conveniece (SCSS, uglify, watch, etc.)
    - Make client error messaging not use alert()

repository: brentwalter/exchange

repo_name: brentwalter/exchange


text:
## ShredState react Component

Simple state sharing among react components.

### Install

```bash
npm install --save sahred-state
```

Every state has to have own name.
Components can be assign to one or many states by setting name property of SharedState component.
It pass selected sates data to the children with the props when updated.

### Basic Usage

```javascript
import React, { Component } from 'react'
import SahredState, { update } from 'shared-state'

class App extends Component {

    render() {
        return (
            <div>
              <SharedState name={['stateName', 'anotherStateName']}>
                    <Component />
              </SharedState>
              <SharedState name="stateName">
                    <Component />
              </SharedState>
            </div>
        );
    }
}

```

### Update with js

You can update shared state data from any piece of the code by calling update method
With three arguments stateName, the name of the state

```javascript
import { update } from 'shared-state'

update('stateName', 'newValue', ()=>{})

```

### Update by html input change

```javascript
import React, { Component } from 'react'
import SahredState, { update } from 'shared-state'

class App extends Component {

    render() {
        return (
            <div>
              <SharedState name="stateName">
                    <Input />
              </SharedState>
            </div>
        );
    }
}

class Input extends Component {
  constructor(props) {
    super(props);
    this.state = {value: props.stateName.valueName};
  }
  render() {
    const {stateName, updateState} = this.props;
    return (
      <input
        type="text"
        value={this.state.value}
        onChange={(e) => updateState('stateName', {...stateName, valueName: e.target.value})}
      />
    );
  }
}
```

### License

MIT (http://www.opensource.org/licenses/mit-license.php)

repository: gen-a/shared-state

repo_name: gen-a/shared-state


text:
---
title: "Cluster creation workflow"
linkTitle: "Cluster creation workflow"
weight: 5
date: 2017-01-05
description: >
  Explanation of the process of creating an EKS Anywhere cluster
---

The EKS Anywhere cluster creation process makes it easy not only to bring up a cluster initially, but also to update configuration settings and to upgrade Kubernetes versions going forward.
The EKS Anywhere cluster versions match the same Kubernetes distribution versions that are used in the AWS EKS cloud service.

Each EKS Anywhere cluster is built from a cluster specification file, with the structure of the configuration file based on the target provider for the cluster.
Currently, VMware vSphere is the recommended provider for supported EKS Anywhere clusters.
So, vSphere is the example provider we step through here.

This document provides an in-depth description of the process of creating an EKS Anywhere cluster.
It starts by describing the components to put in place before creating the cluster.
Then it shows you what happens at each step of the process.
After that, the document describes the attributes of the resulting cluster.

## Before cluster creation

Some assets need to be in place before you can create an EKS Anywhere cluster.
You need to have an Administrative machine that includes the tools required to create the cluster.
Next, you need get the software tools and artifacts used to build the cluster.
Then you also need to prepare the provider, in this case a vCenter environment, on which to create the resulting cluster.

### Administrative machine

The Administrative machine is needed to provide:

* A place to run the commands to create and manage the workload cluster.
* A Docker container runtime to run a temporary, local bootstrap cluster that creates the resulting workload cluster.
* A place to hold the `kubeconfig` file needed to perform administrative actions using `kubectl`.
(The `kubeconfig` file is stored in the root of the folder created during cluster creation.)

The Administrative machine can be any computer (such as your local laptop) with a supported operating system that meets the requirements.
It must also have Internet access to the places where the command line tools and EKS Anywhere artifacts are made available.
Likewise, the Administrative machine must be able to reach and have access to the provider (vSphere).
See the [Install EKS Anywhere]({{< relref "../getting-started/install" >}}) guide for Administrative machine requirements.

### EKS Anywhere software

To obtain EKS Anywhere software, you need Internet access to the repositories holding that software.
EKS Anywhere does not currently support the use of private registries and repositories for the software that EKS Anywhere needs to draw on during cluster creation at this time.
EKS Anywhere software is divided into two types of components.
The CLI interface for managing clusters and the cluster components an controllers used to run workloads and configure clusters.
The software you need to obtain includes:

* **Command line tools**: Binaries to [install on the administrative machine]({{< relref "../getting-started/install" >}}), include `eksctl`, `eksctl-anywhere`, `kubectl`, and `aws-iam-authenticator`.
* **Cluster components and controllers**: These include [artifacts]({{< relref "../reference/artifacts" >}}) such as OVAs for different operating systems and Kubernetes versions to [Import to vSphere]({{< relref "../reference/vsphere/vsphere-ovas" >}}).

The sites to which the administrative machine and the target workload environment need access are listed in the [Requirements]({{< relref "../reference/vsphere/vsphere-prereq" >}}) section.
If you are operating behind a firewall that limits access to the Internet, you can configure EKS Anywhere to identify the location of the [proxy service]({{< relref "../reference/clusterspec/proxy" >}}) you choose to connect to the Internet.

For more information on the software used in EKS Distro, which includes the Kubernetes release and related software in EKS Anywhere, see the [EKS Distro Releases](https://distro.eks.amazonaws.com/#releases) GitHub page.
For information on the Ubuntu and Bottlerocket operating systems used with EKS Anywhere, see the EKS Anywhere [Artifacts]({{< relref "../reference/artifacts" >}}) page.

### Providers

EKS Anywhere uses an infrastructure provider model for creating, upgrading, and managing Kubernetes clusters that leverages the [Kubernetes Cluster API](https://cluster-api.sigs.k8s.io/) project.
The first supported EKS Anywhere provider, VMware vSphere, is implemented based on the [Kubernetes Cluster API Provider vsphere](https://github.com/kubernetes-sigs/cluster-api-provider-vsphere) (CAPV) specifications.

Like Cluster API, EKS Anywhere runs a [kind](https://kind.sigs.k8s.io/) cluster on the local Administrative machine to act as a bootstrap cluster.
However, instead of using CAPI directly with the `clusterctl` command to manage the workload cluster, you use the `eksctl anywhere` command which abstracts that process for you, including calling `clusterctl` under the covers.

As for other providers, the EKS Anywhere project documents the [Cluster API Provider Docker (CAPD)](https://github.com/kubernetes-sigs/cluster-api/tree/master/test/infrastructure/docker), but doesn’t support it for production use.
Expect other providers to be supported for EKS Anywhere in the future.
If you are interested in EKS Anywhere supporting a different provider, feel free to create an [an issue on Github](https://github.com/aws/eks-anywhere/issues) for consideration.

With your Administrative machine in place, to prepare the vSphere provider for EKS Anywhere you need to make sure your vSphere environment meets the EKS Anywhere [requirements]({{< relref "../reference/vsphere/vsphere-prereq" >}}) and that [permissions]({{< relref "../reference/vsphere/vsphere-prereq" >}}) set up properly.
If you don’t want to use the default OVA images, you can [import the OVAs]({{< relref "../reference/vsphere/vsphere-ovas" >}}) representing the operating systems and Kubernetes releases you want.

## Creating a cluster

With the provider (vSphere) prepared and the Administrative machine set up to run Docker and the required binaries, you can create an EKS Anywhere cluster.
This section steps through an example of an EKS Anywhere cluster being created on a vSphere provider.
Once you understand this process, you can use the following documentation to create your own cluster:

* [Create production cluster]({{< relref "../getting-started/production-environment" >}}) for the exact procedure to create a cluster on vSphere.
* [Troubleshooting]({{< relref "../tasks/troubleshoot/_troubleshooting" >}}) if you encounter problems along the way.

### Starting the process

To start, the `eksctl anywhere` command is used to generate a cluster config file, which you can then modify and use to create the cluster.
The following diagram illustrates what happens when you start the cluster creation process:

![Start creating EKS Anywhere cluster](/images/eksa-start.png)

#### 1. Generate an EKS Anywhere config file

When you run `eksctl anywhere generate clusterconfig`, the two pieces of information you provide are the name of the cluster ($CLUSTER_NAME) and the type of provider (`-p vsphere`, in this example).
Then you can direct the yaml cluster config output into a file (`> $CLUSTER_NAME.yaml`). For example:

```
eksctl anywhere generate clusterconfig $CLUSTER_NAME -p vpshere > $CLUSTER_NAME.yaml
```

The provider is important because the type of cluster config created is based on the provider.
The `docker` provider is the only other (although unsupported for production use) provider documented with EKS Anywhere.

The result of this command is a config file template that you need to modify for the specific instance of your provider.

#### 2. Modify the EKS Anywhere config file

Using the generated cluster config file, make modifications to suit your situation.
Details about this config file are contained in the [vSphere Config]({{< relref "../reference/clusterspec" >}})
There are several things to consider when modifying the cluster config file:

* [vSphere configuration]({{< relref "../reference/clusterspec/vsphere" >}}) describes general vSphere cluster configuration information.
* [etcd configuration]({{< relref "../reference/clusterspec/etcd" >}}) describes different etcd topologies.
* [OIDC configuration]({{< relref "../reference/clusterspec/oidc" >}}) describes choices for identity providers.
* [GitOps configuration]({{< relref "../reference/clusterspec/gitops" >}}) describes how to manage your cluster using GitOps.
* [Proxy configuration]({{< relref "../reference/clusterspec/proxy" >}}) describes how to configure EKS Anywhere to point to a proxy service, if you need to configure your cluster to connect to the Internet through a proxy server.

Pay particular attention to which settings are optional and which are required.
Also, not all properties can be upgraded, so it is important to get those settings right at cluster creation.
See supported cluster properties, related to [GitOps]({{< relref "../tasks/cluster/cluster-flux/#supported-cluster-properties" >}}) and [eksctl anywhere upgrade]({{< relref "../tasks/cluster/cluster-upgrades/#upgradeable-cluster-attributes" >}}) methods of cluster upgrades, for information on which properties can be modified after initial cluster creation.

#### 3. Launch the cluster creation

Once you have modified the cluster configuration file, use `eksctl anywhere cluster create -f $CLUSTER_NAME.yaml` as described in the [production environment]({{< relref "../getting-started/production-environment" >}}) section to start the cluster creation process.
To see details on the cluster creation process, you can increase the verbosity (`-v=9` provides maximum verbosity).

#### 4. Authenticate and create bootstrap cluster

After authenticating to vSphere and validating the assets there, the cluster creation process starts off creating a temporary Kubernetes bootstrap cluster on the Administrative machine.
If you are watching the output of `eksctl` anywhere cluster create for those steps, you should see something similar to the following:

To begin, the cluster creation process runs a series of [govc](https://github.com/vmware/govmomi/tree/master/govc) commands to check on the vSphere environment.
First, it checks that the vSphere environment is available:

```
Performing setup and validations
✅ Connected to server
```

Using the URL and credentials provided in the cluster spec files, it authenticates to the vSphere provider:

```
✅ Authenticated to vSphere
```

It validates the datacenter exists:

```
✅ Datacenter validated
```

It validates that the datacenter network exists:

```
✅ Network validated
```

It validates that the identified datastore (to store your EKS Anywhere cluster) exists, that the folder holding your EKS Anywhere cluster VMs exists, and that the resource pools containing compute resources exist.
If you have multiple `VSphereMachineConfig` objects in your config file, will see these validations repeated:

```
✅ Datastore validated
✅ Folder validated
✅ Resource pool validated
```

It validates the virtual machine templates to be used for the control plane and worker nodes (such as `ubuntu-2004-kube-v1.20.7`):

```
✅ Control plane and Workload templates validated
```

If all those validations passed, you will see this message:

```
✅ Vsphere Provider setup is valid
```

Next, the process runs the [kind](https://kind.sigs.k8s.io/docs/user/quick-start/) command to build a single-node Kubernetes bootstrap cluster on the Administrative machine.
This includes pulling the kind node image, preparing the node, writing the configuration, starting the control-plane, installing CNI, and installing the StorageClass. You will see:

```
Creating new bootstrap cluster
```

After this point the bootstrap cluster is installed, but not yet fully configured.

### Continuing cluster creation

If all goes well, the cluster should be created from the `eksctl anywhere cluster create` command and the config file you provided without any further actions from you.
The following diagram illustrates the activities that occur next:

![Continue creating EKS Anywhere cluster](/images/eksa-continue.png)

#### 1. Add CAPI management

Cluster API (CAPI) management is added to the bootstrap cluster to direct the creation of the workload cluster.

#### 2. Set up cluster

Configure the control plane and worker nodes.

#### 3. Add Cilium networking

Add Cilium as the CNI plugin to use for networking between the cluster services and pods.

#### 4. Add storage

Add the default storage class to the cluster

#### 5. Add CAPI to workload cluster

Add the CAPI service to the workload cluster in preparation for it to take over management of the cluster after the cluster creation is completed and the bootstrap cluster is deleted.
The bootstrap cluster can then begin moving the CAPI objects over to the workload cluster, so it can take over the management of itself.

The following text continues to follow along with the output from eksctl anywhere cluster create as just described.

Installs the CAPI service on the bootstrap node:

```
Installing cluster-api providers on bootstrap cluster
```

Performs provider-specific setup for core components.
For the default configuration, you should see these: etcdadm-bootstrap, etcdadm-controller, control-plane-kubeadm, and infrastructure-vsphere and sets up cert-manager.
The CAPI controller-manager is also configured:

```
Provider specific setup
```

With the bootstrap cluster running and configured on the Administrative machine, the creation of the workload cluster begins.
It uses `kubectl` to apply a workload cluster configuration.
Then it waits for etcd, the control plane, and the worker nodes to be ready:

```
Creating new workload cluster
```

Once etcd, the control plane, and the worker nodes are ready, it applies the networking configuration to the workload cluster:

```
Installing networking on workload cluster
```

Next, the default storage class is installed on the workload cluster:

```
Installing storage class on workload cluster
```

After that, the CAPI providers are configured on the workload cluster, in preparation for the workload cluster to take over responsibilities for running the components needed to manage the itself.

```
Installing cluster-api providers on workload cluster
```

With CAPI running on the workload cluster, CAPI objects for the workload cluster are moved from the bootstrap cluster to the workload cluster’s CAPI service (done internally with the `clusterctl` command):

```
Moving cluster management from bootstrap to workload cluster
```

At this point, the cluster creation process will add Kubernetes CRDs and other addons that are specific to EKS Anywhere.
That configuration is applied directly to the cluster:

```
Installing EKS-A custom components (CRD and controller) on workload cluster
Creating EKS-A CRDs instances on workload cluster
Installing AddonManager and GitOps Toolkit on workload cluster

```
If you did not specify GitOps support, starting the flux service is skipped:

```
GitOps field not specified, bootstrap flux skipped

```
The cluster configuration is saved:

```
Writing cluster config file
```

With the workload cluster up, and the CAPI service running on the workload cluster, the bootstrap cluster is no longer needed and is deleted:

![Delete EKS Anywhere bootstrap cluster](/images/eksa-delete.png)

```
Deleting bootstrap cluster
```

Cluster creation is complete:

```
🎉 Cluster created!
```

At this point, the workload cluster is ready to use, both to run workloads and to accept requests to change, update, or upgrade the cluster itself.
You can continue to use `eksctl` anywhere to manage your cluster, with EKS Anywhere handling the fact that CAPI management is now being fulfilled from the workload cluster instead of the bootstrap cluster.

## After cluster creation

With the EKS Anywhere cluster up and running, you might be interested to know how your cluster is set up and what it is composed of.
The following sections describe different aspects of an EKS Anywhere cluster on a vSphere provider and what you should know about them going forward.

See [Add integrations]({{< relref "../tasks/cluster/cluster-integrations" >}}) for information on example third-party tools for adding features to EKS Anywhere.

### Networking

Networking features of your EKS Anywhere cluster start with how virtual machines in the EKS-A cluster in vSphere are set up.
The current state of networking on the vSphere node level include the following:

* **DHCP**: EKS Anywhere requires that a DHCP server be available to the control plane and worker nodes in vSphere for them to obtain their IP addresses.
There is currently no support for static IP addresses or multinetwork clusters.
All control plane and nodes are on the same network.
* **CAPI endpoint**: A static IP address should have been assigned to the control plane configuration endpoint, to provide access to the Cluster API.
It should have been set up to not conflict with any other node IP addresses in the cluster.
This is a specific requirement of CAPI, not EKS Anywhere.
* **Proxy server**: If a [proxy server]({{< relref "../reference/clusterspec/proxy" >}}) was identified to the EKS Anywhere workload cluster, that server should have inbound access from the cluster nodes and outbound access to the internet.

Networking for the cluster itself has the following attributes:

* **Cilium CNI**: The [Cilium](https://cilium.io/) Kubernetes CNI is used to provide networking between components of the control plane and data plane components.
No other CNI plugins, including Cilium Enterprise, is supported at this time.
* **Pod/Service IP ranges**: Separate IP address blocks were assigned from the [configuration file]({{< relref "../reference/clusterspec/vsphere" >}}) during cluster creation for the Pods network and Services network managed by Cilium.
Refer to the clusterNetwork section of your configuration file to see how the cidrBlocks for pods and services were set.

Networking setups for accessing cluster resources on your running EKS Anywhere cluster include the following documented features:

* **Load balancers**: You can add external load balancers to your EKS Anywhere cluster. EKS Anywhere project documents how to configure [KubeVip]({{< relref "../tasks/workload/loadbalance/#current-recommendation-kube-vip" >}}) and [MetalLB]({{< relref "../tasks/workload/loadbalance/metallb.md" >}}).
* **Ingress controller**: You can add a Kubernetes ingress controller to EKS Anywhere.
The project documents the use of [Emissary-ingress]({{< relref "../tasks/workload/ingress" >}}) ingress controller.

### Operating systems

The Ubuntu or Mac operating system representing the Administrative machine can continue to use the binaries to manage the EKS anywhere cluster.
You may need to [update those binaries]({{< relref "../getting-started/install/#upgrade-eksctl-anywhere" >}}) (`kubectl`, `eksctl anywhere`, and others) from time to time.

In the workload cluster itself, the operating system on each node is provided from either Bottlerocket or Ubuntu OVAs.
Note that it is not recommended that you add software or change the configuration of these systems once they are running in the cluster.
In fact, Bottlerocket contains limited writeable areas and does not include a software package management system.

If you need to modify an operating system, you can [rebuild an Ubuntu OVA]({{< relref "../reference/artifacts/#building-your-own-ubuntu-ova" >}}) to use with EKS Anywhere.
In other words, all operating system changes should be done before the OVA is added to your EKS Anywhere cluster.

### Authentication

Supported authentication types are listed in the [AuthN / AuthZ]({{< relref "../reference/faq//#authn--authz" >}}) section of the EKS Anywhere FAQ.

### Storage

The amount of storage assigned to each virtual machine is 25GiB, by default.
It could be different in your case if you had changed the [diskGiB]({{< relref "../reference/clusterspec/vsphere/#diskgib" >}}) field in the EKS Anywhere config.
As for application storage, EKS Anywhere configures a default storage class and supports adding compatible Container Storage Interface (CSI) drivers to a running workload cluster.
See [Kubernetes Storage](https://kubernetes.io/docs/concepts/storage/) for details.

repository: blogtheristo/eks-anywhere

repo_name: blogtheristo/eks-anywhere


text:
eeh-navigation
=============

[![Build Status](https://travis-ci.org/ethanhann/eeh-navigation.svg)](https://travis-ci.org/ethanhann/eeh-navigation)

An AngularJS menu module that provides Bootstrap and framework-agnostic menu directives.

See https://ethanhann.github.com/eeh-navigation for more information.

The demo site's code has been moved to a [separate repo](https://github.com/ethanhann/eeh-navigation-demo).


text:
# Mango
A DSL for Swift view creation

Inspired by [Anko](https://www.github.com/Kotlin/Anko), Mango aims to bring
easy view creation in Swift.

repository: WilliamHester/Mango

repo_name: WilliamHester/Mango


text:
---
layout: default
---

# 1996-01-06 - (cpx) Re: mental cryptography (fwd)

## Header Data

From: David Vincenzetti<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Message Hash: 841af7693a7db1ad8127cd6319bd95f632fff4c88de6059cf5d2d250117b0228

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1996-01-06 18:17:43 UTC

Raw Date: Sun, 7 Jan 1996 02:17:43 +0800

## Raw message

```
{% raw  %}From: David Vincenzetti<EMAIL_ADDRESS>Date: Sun, 7 Jan 1996 02:17:43 +0800
To<EMAIL_ADDRESS>Subject: (cpx) Re: mental cryptography (fwd)
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text

> I have read one paper which attempts to solve this problem, called "Human
> Identification through Insecure Channel".  Unfortunately my papers are in
> a mess right now so I don't have the reference handy.  It was by some
> Japnese researchers, published in one of the proceedings books.  I
> believe a follow-on paper was published within the last year or two which
> had some improvements or corrections to their algorithm.  Sorry to be so
> vague, I'll try to dig out more info over the weekend.
>
> Basically they used a challenge-response system which was intended to
> be simple enough that people could do it in their heads.  The card
> would display a random challenge string, some characters of which were
> special to the user and others which he would ignore.  He would then
> input a response string, where it didn't matter what corresponded to
> the "ignore" slots, but in the special slots he had to produce certain
> symbols corresponding to the other symbols, with the rules changing as
> you move along.  The intention was that even by capturing and analyzing a
> great many challenge-response pairs you couldn't create a response to a
> challenge you hadn't seen before.
>
> I coded this up, and frankly, I couldn't do the required manipulations in
> my head, at least not without taking a very, very long time, and thinking
> very carefully.  Maybe it would get easier with practice, I don't know.
> But my overall feeling was that this would be at the limits of human
> capability even for fairly bright people.  (OTOH I suppose learning to
> read and write might seem pretty tough if you'd never done it.  Maybe
> the 1st grade classes of the future will spend months training the kids
> on how to use these kinds of algorithms.)

The paper can be found in the proceedings of Eurocrypt '91,
D.W. Davies (Ed.), Springer-Verlag.   The author is Hideki IMAI,
<EMAIL_ADDRESS>
I found the above paper very interesting, and I am actually going
to code it up.  Eventually, I would be highly interested in giving
a glance at your code.  Is your code available?

Ciao,
David

{% endraw %}
```

## Thread

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

+ Return to "[David Vincenzetti <vince@dsi.unimi.it>](/authors/david_vincenzetti_vince_at_dsi_unimi_it_)"

+ 1996-01-06 (Sun, 7 Jan 1996 02:17:43 +0800) - (cpx) Re: mental cryptography (fwd) - _David Vincenzetti<EMAIL_ADDRESS>

gha_license_id: MIT


text:
# Groom your app’s Cloud Foundry environment with `cfenv`.
[![Build Status](https://travis-ci.org/nebhale/cfenv.svg?branch=master)](https://travis-ci.org/nebhale/cfenv)

Use `cfenv` to pick a Cloud Foundry environment for your application and reduce the number of logins and targeting that you do.

**Powerful in development.** Specify your app's Cloud Foundry environment once, in a single file.  Changing directrories changes your Cloud Foundry environment.

**One thing well.** `cfenv` is concerned solely with switching Cloud Foundry environments. It's simple and predictable. A plugin architecture lets you tailor it to suit your needs.

### Special Thanks
Without [`rbenv`](https://github.com/sstephenson/rbenv) this project would not exist.  `rbenv` provided to be amazingly high quality and amenable to the modifications that make `cfenv` possible.  I cannot recommend `rbenv` enough if you're a Ruby developer and it's a model for a well written project for everyone else.  Finally, thanks to Dan Mikusa for the [inspiration](https://groups.google.com/a/cloudfoundry.org/d/msg/vcap-dev/Hy1WEJ452Xc/EGudP63gIfgJ) to create this project.

## Table of Contents

* [How It Works](#how-it-works)
  * [Understanding PATH](#understanding-path)
  * [Understanding Shims](#understanding-shims)
  * [Choosing the Cloud Foundry Environment](#choosing-the-cloud-foundry-environment)
  * [Locating the Cloud Foundry Environment](#locating-the-cloud-foundry-environment)
* [Installation](#installation)
  * [Basic GitHub Checkout](#basic-github-checkout)
    * [Upgrading](#upgrading)
  * [Homebrew on Mac OS X](#homebrew-on-mac-os-x)
  * [How cfenv hooks into your shell](#how-cfenv-hooks-into-your-shell)
  * [Creating Cloud Foundry Environments](#creating-cloudfoundry-environments)
  * [Destroying Cloud Foundry Environments](#destroying-cloudfoundry-environments)
* [Command Reference](#command-reference)
  * [cfenv local](#cfenv-local)
  * [cfenv global](#cfenv-global)
  * [cfenv shell](#cfenv-shell)
  * [cfenv environments](#cfenv-environments)
  * [cfenv environment](#cfenv-environment)
  * [cfenv rehash](#cfenv-rehash)
  * [cfenv which](#cfenv-which)
  * [cfenv whence](#cfenv-whence)
* [Development](#development)
  * [Version History](#version-history)
  * [License](#license)

## How It Works

At a high level, `cfenv` intercepts the `cf` command using a shim executable injected into your `PATH`, determines which Cloud Foundry environment has been specified by your application, and passes your commands along after setting `CF_HOME` to the appropriate location.

### Understanding PATH

When you run a command like `cf`, your operating system searches through a list of directories to find an executable file with that name. This list of directories lives in an environment variable called `PATH`, with each directory in the list separated by a colon:

    /usr/local/bin:/usr/bin:/bin

Directories in `PATH` are searched from left to right, so a matching executable in a directory at the beginning of the list takes precedence over another one at the end. In this example, the `/usr/local/bin` directory will be searched first, then `/usr/bin`, then `/bin`.

### Understanding Shims

`cfenv` works by inserting a directory of _shims_ at the front of your `PATH`:

    ~/.cfenv/shims:/usr/local/bin:/usr/bin:/bin

Through a process called _rehashing_, `cfenv` maintains a `cf` shim in that directory.

The shim is a lightweight executables that simply passes your command along to `cfenv`. So with `cfenv` installed, when you run, `cf`, your operating system will do the following:

* Search your `PATH` for an executable file named `cf`
* Find the `cfenv` shim named `cf` at the beginning of your `PATH`
* Run the shim named `cf`, which in turn passes the command along to `cfenv`

### Choosing the Cloud Foundry Environment

When you execute the shim, `cfenv` determines which Cloud Foundry environment to use by reading it from the following sources, in this order:

1. The `CFENV_ENVIRONMENT` environment variable, if specified. You can use the [`cfenv shell`](#cfenv-shell) command to set this environment variable in your current shell session.

2. The first `.cf-environment` file found by searching the directory of the script you are executing and each of its parent directories until reaching the root of your filesystem.

3. The first `.cf-environment` file found by searching the current working directory and each of its parent directories until reaching the root of your filesystem. You can modify the `.cf-environment` file in the current working directory with the [`cfenv local`](#cfenv-local) command.

4. The global `~/.cfenv/environment` file. You can modify this file using the [`cfenv global`](#cfenv-global) command. If the global environment file is not present, `cfenv` assumes you want to use the "system" Cloud Foundry environment—i.e. whatever environment would be used if `cfenv weren't in your path.

### Locating the Cloud Foundry Environment

Once `cfenv` has determined which Cloud Foundry environment your application has specified, it passes the prepends the corresponding `CF_HOME` environment variable to the command.

Each Cloud Foundry environment is installed into its own directory under `~/.cfenv/environments`. For example, you might have these environments
installed:

* `~/.cfenv/environments/development/`
* `~/.cfenv/environments/testing/`
* `~/.cfenv/environments/production/`

Environment names to `cfenv` are simply the names of the directories in `~/.cfenv/environments`.

## Installation

If you're on Mac OS X, consider [installing with Homebrew](#homebrew-on-mac-os-x).

### Basic GitHub Checkout

This will get you going with the latest version of `cfenv` and make it easy to fork and contribute any changes back upstream.

1. Check out `cfenv` into `~/.cfenv`.

    ```sh
    $ git clone https://github.com/nebhale/cfenv.git ~/.cfenv
    ```

2. Add `~/.cfenv/bin` to your `$PATH` for access to the `cfenv` command-line utility.

    ```sh
    $ echo 'export PATH="$HOME/.cfenv/bin:$PATH"' >> ~/.bash_profile
    ```

    **Ubuntu Desktop note**: Modify your `~/.bashrc` instead of `~/.bash_profile`.

    **Zsh note**: Modify your `~/.zshrc` file instead of `~/.bash_profile`.

3. Add `cfenv init` to your shell to enable shims and autocompletion.

    ```sh
    $ echo 'eval "$(cfenv init -)"' >> ~/.bash_profile
    ```

    _Same as in previous step, use `~/.bashrc` on Ubuntu, or `~/.zshrc` for Zsh._

4. Restart your shell so that PATH changes take effect. (Opening a new terminal tab will usually do it.) Now check if `cfenv` was set up:

    ```sh
    $ type cfenv
    #=> "cfenv is a function"
    ```

5. _(Optional)_ Install [cf-build][], which provides the `cfenv create` command that simplifies the process of [creating new Cloud Foundry environments](#creating-cloud-foundry-environments).

#### Upgrading

If you've installed `cfenv` manually using git, you can upgrade your installation to the cutting-edge version at any time.

```sh
$ cd ~/.cfenv
$ git pull
```

To use a specific release of cfenv, check out the corresponding tag:

```sh
$ cd ~/.cfenv
$ git fetch
$ git checkout v0.3.0
```

If you've [installed via Homebrew](#homebrew-on-mac-os-x), then upgrade via its `brew` command:

```sh
$ brew update
$ brew upgrade cfenv cf-build
```

### Homebrew on Mac OS X

As an alternative to installation via GitHub checkout, you can install `cfenv` and [cf-build][] using the [Homebrew](http://brew.sh) package manager on Mac OS X:

```sh
$ brew tap nebhale/personal
$ brew update
$ brew install cfenv cf-build
```

Afterwards you'll still need to add `eval "$(cfenv init -)"` to your profile as stated in the caveats. You'll only ever have to do this once.

### How `cfenv` hooks into your shell

Skip this section unless you must know what every line in your shell profile is doing.

`cfenv init` is the only command that crosses the line of loading extra commands into your shell. Here's what `cfenv init` actually does:

1. Sets up your shims path. This is the only requirement for `cfenv` to function properly. You can do this by hand by prepending `~/.cfenv/shims` to your `$PATH`.

2. Installs autocompletion. This is entirely optional but pretty useful. Sourcing `~/.cfenv/completions/cfenv.bash` will set that up. There is also a `~/.cfenv/completions/cfenv.zsh` for Zsh users.

3. Rehashes shims. From time to time you'll need to rebuild your shim files. Doing this automatically makes sure everything is up to date. You can always run `cfenv rehash` manually.

4. Installs the sh dispatcher. This bit is also optional, but allows `cfenv` and plugins to change variables in your current shell, making commands like `cfenv shell` possible. The sh dispatcher doesn't do anything crazy like override `cd` or hack your shell prompt, but if for some reason you need `cfenv` to be a real script rather than a shell function, you can safely skip it.

Run `cfenv init -` for yourself to see exactly what happens under the hood.

### Creating Cloud Foundry Environments

The `cfenv create` command doesn't ship with `cfenv` out of the box, but is provided by the [cf-build][] project. If you installed it either as part of GitHub checkout process outlined above or via Homebrew, you should be able to:

```sh
$ cfenv install development
```

Alternatively to the `create` command, you can create an environment manually as a subdirectory of `~/.cfenv/environments/`. An entry in that directory can also be a symlink to a Cloud Foundry environment installed elsewhere on the filesystem. `cfenv` doesn't care; it will simply treat any entry in the `environments/` directory as a separate Cloud Foundry environment.

### Destroying Cloud Foundry Environments

As time goes on, Cloud Foundry environments  you create will accumulate in your `~/.cfenv/environments` directory.

To remove old Cloud Foundry environments, simply `rm -rf` the directory of the environment you want to remove. You can find the directory of a particular Cloud Foundry environment with the `cfenv prefix` command, e.g. `cfenv prefix development`.

The [cf-build][] plugin provides an `cfenv destroy` command to automate the removal process.

## Command Reference

Like `git`, the `cfenv` command delegates to subcommands based on its first argument. The most common subcommands are:

### `cfenv local`

Sets a local application-specific Cloud Foundry environment by writing the environment name to a `.cf-environment` file in the current directory. This environment overrides the global environment, and can be overridden itself by setting the `CFENV_ENVIRONMENT` environment variable or with the `cfenv shell` command.

    $ cfenv local development

When run without an environment name, `cfenv local` reports the currently configured local environment. You can also unset the local environment:

    $ cfenv local --unset

### `cfenv global`

Sets the global Cloud Foundry environment to be used in all shells by writing the environment name to the `~/.cfenv/environment` file. This environment can be overridden by an application-specific `.cf-environment` file, or by setting the `CFENV_ENVIRONMENT` environment variable.

    $ cfenv global test

The special environment name `system` tells `cfenv` to use the system Cloud Foundry environment.

When run without an environment name, `cfenv global` reports the currently configured global environment.

### `cfenv shell`

Sets a shell-specific Cloud Foundry environment by setting the `CFENV_ENVIRONMENT` environment variable in your shell. This environment overrides application-specific environments and the global environment.

    $ cfenv shell production

When run without an environment name, `cfenv shell` reports the current value of `CFENV_ENVIRONMENT`. You can also unset the shell environment:

    $ cfenv shell --unset

Note that you'll need `rbenv`'s shell integration enabled (step 3 of the installation instructions) in order to use this command. If you prefer not to use shell integration, you may simply set the `CFENV_ENVIRONMENT` variable yourself:

    $ export CFENV_ENVIRONMENT=production

### `cgenv environments`

Lists all Cloud Foundry environments known to `cfenv`, and shows an asterisk next to the currently active environment.

    $ cfenv environments
      development
      test
    * production (set by /Users/bhale/.cfenv/environment)

### `cfenv environment`

Displays the currently active Cloud Foundry environment, along with information on how it was set.

    $ cfenv environment
    production (set by /Users/bhale/dev/sources/nebhale/build-monitor/.cf-environment)

### `cfenv rehash`

Installs the `cf` shim.

    $ cfenv rehash

### `cfenv which`

Displays the full path to the executable that `cfenv` will invoke when you run the given command.

    $ cfenv which cf
    /Users/bhale/.cfenv/environments/test/bin/cf

### `cfenv whence`

Lists all Cloud Foundry environments with the given command installed.

    $ cfenv whence cf
    development
    test
    production

## Development

The `cfenv` source code is [hosted on GitHub](https://github.com/nebhale/cfenv). It's clean, modular, and easy to understand, even if you're not a shell hacker.

Tests are executed using [Bats](https://github.com/sstephenson/bats):

    $ bats test
    $ bats test/<file>.bats

Please feel free to submit pull requests and file bugs on the [issue tracker](https://github.com/nebhale/cfenv/issues).

### Version History

**1.0.0** (June 2, 2014)

* Initial public release.

### License

(The MIT license)

Copyright (c) 2013 Ben Hale

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.

  [cf-build]: https://github.com/nebhale/cf-build#readme

repository: vchouhan/cfenv

repo_name: vchouhan/cfenv


text:
---
layout: post
title: Rubel calls out Netscape for bumping blog piece
created:<PHONE_NUMBER>
---
Yesterday, Jason Calacanis posted a rebuttal to a Times piece highlighting criticism of Netscape's revamped, Digg-inspired homepage.

Calcanis wrote of the naysayers:
Same thing here, we're in the middle of paradigm shift from top-down control to bottom-up participation, and when you make a radical change like that you're gonna get pushback. In fact, I'm really excited to see the pushback because it let's me know we are on the right track.

Steve Rubel, however, calls the handling of the Times piece a bit less than above board:

One of Netscape's editors seeded a link to the post in one of the Netscape channels, which I don't think is kosher. Let the community push that news gang, not you. Otherwise you're favoring Netscape propaganda, which at least in my view, makes you come off worse if you had just left alone.


text:
# printf

## Synopsis

```cpp
template <class FormatString, class T1, ..., class Tn>
int printf(T1 a1, ..., Tn an);
```

## Description

Wrapper of the `printf` function of the C library. It takes the format string
as a compile-time string, which is an `boost::metaparse::string`.
It type-checks the arguments based on the format string. When type-checking
fails, this function emits a compilation error. When type-checking succeeds,
this function calls the `printf` function of the C library. This thin wrapper
is likely to be inlined in which case it has no runtime overhead compared to
using `printf` without type-checking.

## Header

```cpp
#include <mpllibs/safe_printf/printf.hpp>
```

## Expression semantics

For any `s` `boost::metaparse::string` and `a1` ... `an` runtime objects:

```cpp
mpllibs::safe_printf::printf<s>(a1, ..., an)
```

When the number and types of `a1` ... `an` are correct according to `s`, the
format string, it  is equivalent to

```cpp
std::printf(boost::mpl::c_str<s>::type::value, a1, ..., an)
```

otherwise it is a compilation error.

## Example

```cpp
mpllibs::safe_printf::printf<BOOST_METAPARSE_STRING("%d %d\n")>(11, 13);
```

<p class="copyright">
Copyright Abel Sinkovics (abel at elte dot hu) 2011.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
[http://www.boost.org/LICENSE_1_0.txt](http://www.boost.org/LICENSE_1_0.txt)
</p>

[[up]](index.html)


text:
+++
date = "2017-06-20T10:11:53+08:00"
tags = ["github","javascript"]
title = "remark - A simple, in-browser, markdown-driven slideshow tool."

+++

> [remark](https://github.com/gnab/remark) is a simple, in-browser, markdown-driven slideshow tool targeted at people who know their way around HTML and CSS.<!--more-->

### featuring:

- Markdown formatting, with smart extensions
- Presenter mode with markdown formatted speaker notes and cloned slideshow view
- Syntax highlighting, supporting a range of languages
- Slide scaling, thus similar appearance on all devices / resolutions
- Simple markdown templates for customized slides
- Touch support for smart phones and pads, i.e. swipe to navigate slides

Check out [this remark slideshow](http://gnab.github.com/remark) for a brief introduction.

To render your Markdown-based slideshow on the fly, checkout [Remarkise](https://gnab.github.io/remark/remarkise).

### Getting Started

It takes only a few, simple steps to get up and running with remark:

1. Create an HTML file to contain your slideshow (see boilerplate below)
2. Open the HTML file in a decent browser
3. Edit the Markdown and/or CSS styles as needed, save and refresh!
4. Press C to clone a display; then press P to switch to presenter mode

See any of the boilerplate-*.html files, or just copy the boilerplate HTML below to start:

```html
<!DOCTYPE html>
<html>
  <head>
    <title>Title</title>
    <meta charset="utf-8">
    <style>
      @import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz);
      @import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic);
      @import url(https://fonts.googleapis.com/css?family=Ubuntu+Mono:400,700,400italic);

      body { font-family: 'Droid Serif'; }
      h1, h2, h3 {
        font-family: 'Yanone Kaffeesatz';
        font-weight: normal;
      }
      .remark-code, .remark-inline-code { font-family: 'Ubuntu Mono'; }
    </style>
  </head>
  <body>
    <textarea id="source">

class: center, middle

# Title

---

# Agenda

1. Introduction
2. Deep-dive
3. ...

---

# Introduction

    </textarea>
    <script src="https://remarkjs.com/downloads/remark-latest.min.js">
    </script>
    <script>
      var slideshow = remark.create();
    </script>
  </body>
</html>
```

### How To Use remark

The [wiki](http://github.com/gnab/remark/wiki) pages contain all the how-to, templating, and API help.

repository: charlesbao/hi-charles

repo_name: charlesbao/hi-charles


text:
# A simple setup to read FHIR CommunicationRequests and send an SMS via Twilio

### Note, all of the Twilio library is stolen directly from [twilio_flutter](https://github.com/adarshbalu/twilio_flutter), with a big thanks to [Adarsh Balachandran](https://github.com/adarshbalu) who maintains it. The pub.dev package is still certified for Flutter, although it worked perfectly well on just the Dart SDK. I will remove that directory and just include it as a dependency if the package gets updated and no longer require the Flutter SDK.

## You will need to create a twilio.yaml file, and place it in the ```lib``` directory, it should look like this:
```
## Account Sid of your Twilio Account
accountSid: 'alphaNumbericString'
## AuthToken from your Twilio Account
authToken: 'alphaNumbericString'
## Twilio Phone Number
twilioNumber: '+12345678901'
## The number you would like to try and test to
sendNumber: '+12345678901'

## The following values can be integers or "*"
## It uses this package: https://pub.dev/packages/cron
## Here is a nice tutorial: https://medium.com/flutterworld/flutter-run-function-repeatedly-using-cron-4aa030eda332
## The 5 together make up a cron string "0 * * * * *" this default value runs every hour
minute: '0'
hour: '*'
day: '*'
month: '*'
dayOfWeek: '*'

baseUrl: 'http://hapi.fhir.org/baseR4/'
```
## Create new CommuncationRequest
1. Go to Hapi's [Public Endpoint for CommunicationRequests](http://hapi.fhir.org/resource?serverId=home_r4&pretty=false&_summary=&resource=CommunicationRequest)
2. Click on the CRUD Operations Tab
3. Under Create, Place the following resource text with your editable "contentString" in place of "New Content!"
```
{
      "resourceType": "CommunicationRequest",
      "status": "active",
      "payload": [
                {
                    "contentString": "New Content!"
                 }
      ]
}
```
4. Click the Create Button

## To build your Docker Container
Quick shout outs to the following people for making my life much easier for this:
- Jermaine Oppong YouTube Tutorial
- Nick Manning YouTube Tutorial
- Tony Pujals - Google Engineer

The reason I have a file called ```server.dart``` in a ```bin``` directory is because I've stolen this docker file from my repo about [servers](https://github.com/MayJuun/servers), and this way the setup is the same (except in this case I'm copying the entire lib directory instead of just a file...although I should probably do that for the servers too) For right now it's probably just easy to leave all of the files where they are.

### Docker - let's build!
1. Ensure docker is installed, to check run:
```$ docker run hello-world```

2.  Test it:
```$ docker run projectName```

## Google Cloud
(I haven't actually tested this workflow on this Repo, but it's the same as for the server package above)
1. Get Google Cloud account
2. Create Project
3. Note Project ID
4. Enable Container Registry & Cloud Run APIs
5. Initialize gcloud
```$ gcloud init```
6. Configure docker for gcloud
```$ gcloud auth configure-docker```
7. Build container in Google Cloud Container Registry
```$ docker build -t gcr.io/projectId/projectName:version .```
8. For the above, the projectId is your GCP project ID, the projectName is the name of the docker file that we had above, and the version is however you want to define versions in the cloud so in the future you'll know which is which. For instance, if our GCP project Id is ```new-project-123456``` our docker project was called docker-project, we would write:
```$ docker build -t gcr.io/new-project-123456/docker-project:v0.1 .```
9. Push container to cloud
```$ docker push gcr.io/projectId/projectNam:version```
10. If you go to your GCP console and open the Container Registry, you should see the container that you just pushed
11. Open Cloud Run in your GCP Console
12. Create Service, choose your service name, and pick your Region
13. Select ```Deploy one revision from an existing container image```, and choose the image you just uploaded
14. Click on Advanced Settings, and under Capacity, change the Memory allocated to ```1 GiB```
15. ~~For testing purposes~~
~~- Ingress: Allow all traffic~~
~~- Authentication: Allow unauthenticated invocations~~ I'll need to update this when I get around to it.
16. Create!


text:
---
title: About the google_compute_public_delegated_prefixes resource
platform: gcp
---

## Syntax
A `google_compute_public_delegated_prefixes` is used to test a Google PublicDelegatedPrefix resource

## Examples
```
describe google_compute_public_delegated_prefixes(project: 'chef-gcp-inspec', region: 'us-east1-b') do
  it { should exist }
end
```

## Properties
Properties that can be accessed from the `google_compute_public_delegated_prefixes` resource:

See [google_compute_public_delegated_prefix.md](google_compute_public_delegated_prefix.md) for more detailed information
  * `creation_timestamps`: an array of `google_compute_public_delegated_prefix` creation_timestamp
  * `descriptions`: an array of `google_compute_public_delegated_prefix` description
  * `ids`: an array of `google_compute_public_delegated_prefix` id
  * `names`: an array of `google_compute_public_delegated_prefix` name
  * `ip_cidr_ranges`: an array of `google_compute_public_delegated_prefix` ip_cidr_range
  * `parent_prefixes`: an array of `google_compute_public_delegated_prefix` parent_prefix
  * `is_live_migrations`: an array of `google_compute_public_delegated_prefix` is_live_migration
  * `fingerprints`: an array of `google_compute_public_delegated_prefix` fingerprint
  * `statuses`: an array of `google_compute_public_delegated_prefix` status

## Filter Criteria
This resource supports all of the above properties as filter criteria, which can be used
with `where` as a block or a method.

## GCP Permissions

Ensure the [Compute Engine API](https://console.cloud.google.com/apis/library/compute.googleapis.com/) is enabled for the current project.

repository: inspec/inspec-gcp

gha_language: Ruby

gha_license_id: NOASSERTION

repo_name: inspec/inspec-gcp


text:
# TODO

# v3 alpha - hitlist

# misc

- keyboard shortcuts in menu
- think about url structure (currently /edit/live is now /live)
- detect stubbed out bin (where there's no longer an active key to write), and don't deliver the spike on those bins
- preprocessor UI
- preprocessor support on server side - jsbin.com/abc.less (raw less), jsbin.com/abc.css (compiled CSS)
- screencasts!
- static uploads for users
- remove bin from my history
- multiple templates
- jsbin collections - I want to run a workshop and create a prefix url, that all my bins are saved to, like jsbin. com/rennes-2012/abc/1, jsbin.com/rennes-2012/abc/2, etc
- delete bins from your homescreen

# URLs

/ref http://www.flickr.com/photos/remysharp/6859356800/

- /latest is fixed - not redirected
- If I'm on /latest, any new updates, notify me and I can reload/live refresh if I want
- Rewind? Possibly not.

# Code Casting

- Add data to report number of connected users
- Add visual cue that you're following

# Panels

- UI for pre-rendering
- "insertionPoint" means we can have more panels

# Save

- Add gist support back in (but do it server side) - support Lea's dabblet format (but files named jsbin.html, etc)
- Fork (as well as clone) and folk allows me to trace this heirachy of bins saved to get to this point

# Misc

- Expose API for specific tasks:
  - prefilters for panels
  - codemirror config
  - jsbin settings (key mappings?)
- Humans.txt

# IE

- Gutter is being rendered thick if the panel isn't visible - possibly solution, only render CM when made visible - problem is the .getCode won't work - so need to think about how to get around it.

repository: nbprithv/jsbin

repo_name: nbprithv/jsbin


text:
---
layout: post
cover: 'assets/images/cover3.jpg'
navigation: True
title:  SANS Security Leadership Essentials - MGT512
categories: SANS Training MGT512 Info
subclass: post
tags: sans
logo: 'assets/images/home.png'
author: kenton
---

I've taught this class for a number of years now and it has always been one of my favourites. It was usurped for a time by "Implementing and Auditing the CIS 20 Critical Controls" (SEC566) as 512 became a bit dated and I found 566 to be a bit more relevant. However, that all changed this year when a significant re-write was completed and the new version of the course went live. Frank Kim and other contributors have done a great job of bringing this back to be a true essentials course.

I've taught a couple of classes already and have a bunch more lined up this year so I thought I'd take some time to give a run-down of the new material and let you know what to expect. This class has quickly risen in the popularity ranks once again and it's a great opportunity for people in a variety of roles to get a thorough introduction to security and management principles. Stay tuned for the next 5 posts to learn more about this great class.

- Day 1

- Day 2

- Day 3

- Day 4

- Day 5


text:
Fall 2018
1130 and 1102 Think

Maybe divide 1130 into five categories from which students can choose their own direction:

1. Canadian Indigenous Reconciliation and Identity
2. Urban Renewal Plan for Your Neighbourhood
3. Sports and Economic Status
4. The Immigrant Experience
5. Resistance and Protest

MAKE A SHEET FOR THIS:

Every four weeks, everyone briefs (gives updates) everyone else about what they are doing... attendance at these briefings are mandatory. Roughly 650 words each, answering the questions below:

- current title of your research project
- list the five current key terms governing your research
- a thesis statement
- a central question that you are asking about your topic
- an answer to your question
- a bibliography of five books / articles / websites / magazines / media that you have consulted
- a minimum 350-word discussion of your research / creative process, failures, current thinking, etc.

So now is this [markdown](markdown.com) ready?

- *The Things They Carried* as a short story
- "Casey at the Bat" as the first poem we read
-

path: /General Planning File.md

filename: General Planning File.md


text:
# Discord Active Role Bot

[![Discord](https://discordapp.com/api/guilds/258167954913361930/embed.png)](https://discord.gg/WjEFnzC) [![Twitter Follow](https://img.shields.io/twitter/follow/peterthehan.svg?style=social)](https://twitter.com/peterthehan)

A Discord bot that assigns a role to a user on their first message and removes it after a fixed time.

## Setup

1. Follow the instructions in [create-discord-bot](https://github.com/peterthehan/create-discord-bot).

> Don't forget to give your bot the `Manage Roles` permission!

2. Download this widget and add it into the [src/widgets](https://github.com/peterthehan/create-discord-bot/tree/master/app/src/widgets) folder.

3. Open [config.json](https://github.com/peterthehan/discord-active-role-bot/blob/master/config.json) to configure your own settings:

```js
[
  {
    "guildId": "GUILD_ID",
    "roleId": "ROLE_ID",
    "roleDuration": 43200
  },
  // ...Add as many rules as you want.
]
```

- `roleDuration` (in seconds) is how long the role is given to the member before it is removed.

4. `npm start` to run the bot.

Visit for more help or information!

repository: BunsDev/discord-active-role-bot

repo_name: BunsDev/discord-active-role-bot


text:
# FFX Plugin for Settings (SetUI)

This is an experimental plugin to modify and query settings. To use it, please opt in by running
`ffx config set setui true`.

## Development
* Create a new folder for a new settings as a subcommand of `setui`. (Similar to `setui/privacy`)
* Set build, for example:
```
fx set core.qemu-x64 --auto-dir --with src/developer/ffx:tests
```
* Build plugins:
```
fx build ffx
```
* Run unit tests:
```
fx test <new ffx_plugin target name>_test
```
* Run plugin:
```
fx ffx setui <new subcommand name>
```

repository: gnoliyil/fuchsia

repo_name: gnoliyil/fuchsia


text:
# Contributor Covenant Code of Conduct

## Our Pledge

To paraphrase: Common sense, simple common sense.

## Our Standards

To paraphrase: Common sense, simple common sense.

## Our Responsibilities

To paraphrase: Common sense, simple common sense.

## Scope

To paraphrase: Common sense, simple common sense.

## Enforcement

To paraphrase: Common sense, simple common sense.

## Attribution

To paraphrase: Common sense, simple common sense.

repository: coldrye-archive/settings

repo_name: coldrye-archive/settings


text:
# Oops/SlimNetteBridge

[![Build Status](https://img.shields.io/travis/o2ps/SlimNetteBridge.svg)](https://travis-ci.org/o2ps/SlimNetteBridge)
[![Downloads this Month](https://img.shields.io/packagist/dm/oops/slim-nette-bridge.svg)](https://packagist.org/packages/oops/slim-nette-bridge)
[![Latest stable](https://img.shields.io/packagist/v/oops/slim-nette-bridge.svg)](https://packagist.org/packages/oops/slim-nette-bridge)

This package helps you quickly build a [Slim Framework](https://www.slimframework.com) application, utilizing the power of [Nette DI container](https://github.com/nette/di).

## THIS PACKAGE IS NO LONGER MAINTAINED!

As suggested in [#6](https://github.com/o2ps/SlimNetteBridge/issues/6), you can use [slimapi/slimapi](https://github.com/slimapi/slimapi) instead.

## Installation and requirements

```bash
$ composer require oops/slim-nette-bridge
```

Oops/SlimNetteBridge requires PHP >= 7.1.

## Usage

Register the extension in your config file.

```yaml
extensions:
    slim: Oops\SlimNetteBridge\DI\SlimExtension(%debugMode%)
```

Then configure it:

```yaml
slim:
    settings:
        addContentLengthHeader: false
    configurators:
        - App\MyConfigurator
```

- `settings` section can be used to override Slim's [default settings](https://www.slimframework.com/docs/objects/application.html#slim-default-settings);
- `configurators` is a list of `ApplicationConfigurator` implementations which, in the same order as defined in the list, can add routes and middlewares to the instance of `Slim\App`.

Once you have configured the bridge, you can create a simple `index.php` script in your document root, using [`nette/bootstrap`](https://github.com/nette/bootstrap) to build the container:

```php
<?php

// include Composer autoloader
require_once __DIR__ . '/path/to/vendor/autoload.php';

// configure and create the DI container
$configurator = new Nette\Configurator();
$configurator->setTempDirectory(__DIR__ . '/path/to/temp');
$configurator->addConfig(__DIR__ . '/path/to/config.neon');
$container = $configurator->createContainer();

// run the configured Slim application
$container->getByType(Slim\App::class)->run();
```

Don't forget to configure your web server to pass the incoming requests to the `index.php` script.

gha_language: PHP


text:
# AliexpressOrderHelper
(Linux only)
AliexpressOrderHelper is a simple tool that helps you to get summary about your orders. Because of the absence of customer API at Aliexpress side this tool is using Python Selenium.

Currently this tool has very limited functionality, but it will be expanded later.

 TODO:
1. Multiaccount (reading from a txt file, that contains multiple accounts)
2. More functionality (dispute status, order description, account level etc.)
3. Efficiency (opening webdriver every time is veeery slow)

 Usage:
1. Install geckodriver for browser that you wish to use, for example  Firefox
2. Pass your data in writing_to_db.py file:
get_information = Aliexpress(
      driver=webdriver.Firefox(), login='', password=''
    ).getting_orders()  Your account's data is not going to be saved into local database.

Local database  AliexpressOrderData.db  is gonna be created in folder of repo.
After job is done, you will see table with your orders.

repository: valentynslivko/AliexpressOrderHelper

repo_name: valentynslivko/AliexpressOrderHelper


text:
# Dreambooth on Stable Diffusion

This is an implementtaion of Google's [Dreambooth](https://arxiv.org/abs/2208.12242) with [Stable Diffusion](https://github.com/CompVis/stable-diffusion). The original Dreambooth is based on [Imagen](https://imagen.research.google/) text-to-image model. However, neither the model nor the pre-trained weights of Imagen is available. To enable people to fine-tune a text-to-image model with a few examples, I implemented the idea of Dreambooth on Stable diffusion.

This code repository is based on that of [Textual Inversion](https://github.com/rinongal/textual_inversion). Note that Textual Inversion only optimizes word embedding, while dreambooth fine-tunes the whole diffusion model.

The implementation makes minimum changes over the official codebase of Textual Inversion. In fact, due to lazyness, some components in Textual Inversion, such as the embedding manager, are not deleted, although they will never be used here.
## Update
**9/20/2022**: I just found a way to reduce the GPU memory a bit. Remember that this code is based on Textual Inversion, and TI's code base has [this line](https://github.com/rinongal/textual_inversion/blob/main/ldm/modules/diffusionmodules/util.py#L112), which disable gradient checkpointing in a hard-code way. This is because in TI, the Unet is not optimized. However, in Dreambooth we optimize the Unet, so we can turn on the gradient checkpoint pointing trick, as in the original SD repo [here](https://github.com/CompVis/stable-diffusion/blob/main/ldm/modules/diffusionmodules/util.py#L112). The gradient checkpoint is default to be True in [config](https://github.com/XavierXiao/Dreambooth-Stable-Diffusion/blob/main/configs/stable-diffusion/v1-finetune_unfrozen.yaml#L47). I have updated the codes.
## Usage

### Preparation
First set-up the ```ldm``` enviroment following the instruction from textual inversion repo, or the original Stable Diffusion repo.

To fine-tune a stable diffusion model, you need to obtain the pre-trained stable diffusion models following their [instructions](https://github.com/CompVis/stable-diffusion#stable-diffusion-v1). Weights can be downloaded on [HuggingFace](https://huggingface.co/CompVis). You can decide which version of checkpoint to use, but I use ```sd-v1-4-full-ema.ckpt```.

We also need to create a set of images for regularization, as the fine-tuning algorithm of Dreambooth requires that. Details of the algorithm can be found in the paper. Note that in the original paper, the regularization images seem to be generated on-the-fly. However, here I generated a set of regularization images before the training. The text prompt for generating regularization images can be ```photo of a <class>```, where ```<class>``` is a word that describes the class of your object, such as ```dog```. The command is

```
python scripts/stable_txt2img.py --ddim_eta 0.0 --n_samples 8 --n_iter 1 --scale 10.0 --ddim_steps 50  --ckpt /path/to/original/stable-diffusion/sd-v1-4-full-ema.ckpt --prompt "a photo of a <class>"
```

I generate 8 images for regularization, but more regularization images may lead to stronger regularization and better editability. After that, save the generated images (separately, one image per ```.png``` file) at ```/root/to/regularization/images```.

**Updates on 9/9**
We should definitely use more images for regularization. Please try 100 or 200, to better align with the original paper. To acomodate this, I shorten the "repeat" of reg dataset in the [config file](https://github.com/XavierXiao/Dreambooth-Stable-Diffusion/blob/main/configs/stable-diffusion/v1-finetune_unfrozen.yaml#L96).

For some cases, if the generated regularization images are highly unrealistic (happens when you want to generate "man" or "woman"), you can find a diverse set of images (of man/woman) online, and use them as regularization images.

### Training
Training can be done by running the following command

```
python main.py --base configs/stable-diffusion/v1-finetune_unfrozen.yaml
                -t
                --actual_resume /path/to/original/stable-diffusion/sd-v1-4-full-ema.ckpt
                -n <job name>
                --gpus 0,
                --data_root /root/to/training/images
                --reg_data_root /root/to/regularization/images
                --class_word <xxx>
```

Detailed configuration can be found in ```configs/stable-diffusion/v1-finetune_unfrozen.yaml```. In particular, the default learning rate is ```1.0e-6``` as I found the ```1.0e-5``` in the Dreambooth paper leads to poor editability. The parameter ```reg_weight``` corresponds to the weight of regularization in the Dreambooth paper, and the default is set to ```1.0```.

Dreambooth requires a placeholder word ```[V]```, called identifier, as in the paper. This identifier needs to be a relatively rare tokens in the vocabulary. The original paper approaches this by using a rare word in T5-XXL tokenizer. For simplicity, here I just use a random word ```sks``` and hard coded it.. If you want to change that, simply make a change in [this file](https://github.com/XavierXiao/Dreambooth-Stable-Diffusion/blob/main/ldm/data/personalized.py#L10).

Training will be run for 800 steps, and two checkpoints will be saved at ```./logs/<job_name>/checkpoints```, one at 500 steps and one at final step. Typically the one at 500 steps works well enough. I train the model use two A6000 GPUs and it takes ~15 mins.

### Generation
After training, personalized samples can be obtained by running the command

```
python scripts/stable_txt2img.py --ddim_eta 0.0
                                 --n_samples 8
                                 --n_iter 1
                                 --scale 10.0
                                 --ddim_steps 100
                                 --ckpt /path/to/saved/checkpoint/from/training
                                 --prompt "photo of a sks <class>"
```

In particular, ```sks``` is the identifier, which should be replaced by your choice if you happen to change the identifier, and ```<class>``` is the class word ```--class_word``` for training.

## Results
Here I show some qualitative results.  Regularization images are generated by prompt ```photo of a container```. Regularization images are shown here:

![](assets/a-container-0038.jpg)

After training, generated images with prompt ```photo of a sks container```:

![](assets/photo-of-a-sks-container-0018.jpg)

Generated images with prompt ```photo of a sks container on the beach```:

![](assets/photo-of-a-sks-container-on-the-beach-0017.jpg)

Generated images with prompt ```photo of a sks container on the moon```:

![](assets/photo-of-a-sks-container-on-the-moon-0016.jpg)

Some not-so-perfect but still interesting results:

Generated images with prompt ```photo of a red sks container```:

![](assets/a-red-sks-container-0021.jpg)

Generated images with prompt ```a dog on top of sks container```:

![](assets/a-dog-on-top-of-sks-container-0023.jpg)

repository: gammagec/Dreambooth-SD-optimized

gha_language: Jupyter Notebook

repo_name: gammagec/Dreambooth-SD-optimized


text:
---
title: Dolomites
date: 2016-8-5
blurb: with Barbara
category: climbing
layout: post
guests: Barbara
location:
  - Cinque Torri
  - Hexenstein
  - Falzarego Towers
---

{% image /cmaimages/2016/our-first-climb_28470757324_o.jpg %}
Our first climb

{% image /cmaimages/2016/what-the-hell-was-it-like-here-in-wwi_28473826423_o.jpg %}
What the hell was it like here in WWI?

{% image /cmaimages/2016/speaking-with-the-gods_28805598780_o.jpg %}
Speaking with the Gods

{% image /cmaimages/2016/we-are-having-fun_28473816583_o.jpg %}
We are having fun

## Thursday

Barbara and I went to the Dolomites, we had a long weekend to climb - Thursday through Sunday.

After a very nice drive, we pulled up to the lift station for the Cinque Torre
below the Falzarego Pass. Barbara was skeptical, but I insisted on using the lift to
get as much climbing as we possibly could!

We hiked over to climb the Bergführer Route on the Torre Grande West Summit (IV+).
But there were several people waiting, and it seemed hard/scary. We decided to
do something else first.

{% image /cmaimages/2016/in-a-hexenstein-chimney_28987009852_o.jpg %}
In a Hexenstein chimney

{% image /cmaimages/2016/time-for-pizza_28473814893_o.jpg %}
Time for pizza

{% image /cmaimages/2016/yes-this-really-happened_29015134041_o.jpg %}
Yes, this really happened

{% image /cmaimages/2016/gschafft_28805629080_o.jpg %}
G'schafft!

We hiked over to Torre Latina, to climb the Normal Route (III+). It was
three easy pitches.

This went great! We enjoyed the easy climbing. Being a cool dude, I think I wore
tennis shoes. On top, we met a nice couple from Saxony. The man was bedecked with
a bunch of slings with knots in them. That was his protection rack. Much cheaper than
all my expensive gear!

We abseiled from the other side of the mountain, making two rappels. Barbara had
a funny exchange with the woman...she wasn't really sure how safe things were, and
after asking a lot of questions felt better.

This couple told us that we should climb the Ostkamin (East Chimney), rated IV, which
was just around the other side of the peak. It offered two fun pitches. Barbara
belayed me up the first pitch, which I did according to the advice of the nice fella.
He suggested following an easier line coming in from the right and trending left.
I found it to be loose but doable. The second pitch was more adventurous, climbing
a vertical chimney to the summit. I ended up going the wrong way and having to climb
back down some distance. When Barbara came up, she was kinda freaked out from the
deep exposure. She looked down between her legs and decided that had been a mistake!

{% image /cmaimages/2016/on-our-first-summit_29059251366_o.jpg %}
On our first summit

{% image /cmaimages/2016/we-ate-at-croda-cafe-every-night_28473817843_o.jpg %}
We ate at Croda Cafe every night

{% image /cmaimages/2016/she-is-fun_28473838023_o.jpg %}
She is fun

{% image /cmaimages/2016/a-rack-of-knots_29091946715_o.jpg %}
A rack of knots

Her last moves to the summit were marked by considerable tension! She was very happy
to finish the pitch. It wasn't long however, before she was obsessing over how unreasonably
it had scared her. This led to a determination to always look down...practicing her
ability to tolerate steep terrain and constantly improving it.

We made another rappel and used the early evening hours to climb an old favorite...a
route I'd climbed with Fred Beckey a few years before - the Normal Route on
Torre Quarta Bassa (IV-). It's three wonderful pitches. Barbara enjoyed this one very
much. We had to rappel down the backside.

We went down to our apartment in Cortina and began a tradition of eating pizza every night
at the Croda Cafe. It was wonderful!

## Friday

{% image /cmaimages/2016/free-of-the-crowds_29015206771_o.jpg %}
Free of the crowds

{% image /cmaimages/2016/the-scary-spot_28805616890_o.jpg %}
The scary spot

{% image /cmaimages/2016/how-do-we-get-down-now_28987073332_o.jpg %}
"How do we get down, now?"

{% image /cmaimages/2016/this-was-a-long-pitch_29059300946_o.jpg %}
This was a long pitch.

I let us sleep in. A girl has to be gently lowered into this world, and 5 am starts
aren't the best way to do that! We got some coffee at the little shop below our apartment,
bought a few apples for snacks, and were underneath the Hexenstein at about 11:30.
We were climbing the classic and popular Südkante (IV), which has 8 wonderful pitches.
I'd done the route twice before, once with Dan Protz and once with Aidan. Super fun
memories. We hiked up to the base and waited for several parties to get started and move
a bit up the route. I think we were climbing around 1 pm. Pitch 4 had some strange moves,
and I was worried that Barbara would have a hard time following them (so was she). But
she did fine, climbing up a chimney with just a few good holds. Later, there was a
traverse into a deep chimney that was intimidating. And just after some easy ground on
pitch 6, she slipped unexpectedly. Everything was fine, but it reminded her to be
careful.

We avoided the crux crack below the summit for easier terrain on the left - Barbara
had done fantastic and we didn't need something hard!

On the summit we signed the logbook, which would prove to be helpful later.

Barbara had left two cams on the route somehow, an Alien and a Camelot #2. I didn't even
notice, because I was placing very little gear. As our trip ended, I realized I'd lost the
gear. And then Barbara got a message on Facebook saying someone had the cams! Fantastic!
In time they were mailed to us from some new friends in the north of Germany. They'd climbed
behind us on the route, and found us by photographing our names in the summit log book,
then looking on Facebook and finding Barbara. Amazing.

{% image /cmaimages/2016/sitting-with-barbara_29015182331_o.jpg %}
Sitting with Barbara

{% image /cmaimages/2016/the-falzarego-pass_28473846843_o.jpg %}
The Falzarego Pass

{% image /cmaimages/2016/on-the-hexenstein_29091962685_o.jpg %}
On the Hexenstein

{% image /cmaimages/2016/here-we-go_28805611530_o.jpg %}
Here we go

We really enjoyed the walk down through trenches from the first world war. Again, pizza
at Cafe Croda. Barbara was so happy and amazed to discover this kind of life. I was so
happy to share it with her.

## Saturday

The weather would be sunny and nice on Saturday, and I was determined to get in a full
climbing day. But I couldn't wake my sleeping angel. Finally, around 10:30 am, we were
hiking up to the
Nordwestkante on the Kleiner Falzaregoturm (IV-), which gave four fun pitches of climbing
in a beautifully exposed location. Barbara found the climbing pretty easy, but she enjoyed
the sun and the rock. There is a picture of her sitting on the summit and just feeling
the magical mountain air.

We made a steep 25 meter rappel from the summit, then descended travelling in coils back
to the base in a chimney and gully system.

At about 3 o'clock, we were ready to climb the West Face of the Großer Falzaregoturm (IV).
Five fantastic pitches got us to the top, where we found a beautiful patch of Edelweiß.
The first pitch was the most exciting, with steep and solid IV moves. Barbara was
really getting some good mileage on the rock. On the summit, we were going to share a
double rope rappel with an Italian couple. But I became dubious of the need for a double
rope rappel. Instead, Barbara and I descended a marked scrambling route, finally
making a few single rope rappels lower in the gully while the Italian couple dealt
with their impossibly twisted double ropes. Barbara loved descending in coils of rope.
She likes the excitement of "finding your own way," and fully understands that the
terrain requires concentration and care. She likes the improvised protection, found
when necessary.

{% image /cmaimages/2016/interesting-descent_28473874213_o.jpg %}
Interesting descent

{% image /cmaimages/2016/coming-down-the-back-side_28473849263_o.jpg %}
Coming down the back side

{% image /cmaimages/2016/cold-summer-day_29015145891_o.jpg %}
Cold summer day

{% image /cmaimages/2016/going-home_29059346986_o.jpg %}
Going home

Really amazing, to me, and fun, to experience this with her.

We like our traditions, and I'm pretty sure we ended the night with another trip
to Cafe Croda, our last delicious pizza in Cortina!

## Sunday

On the last day, we went and climbed the Ostkamin again on Torre Lusy.
Barbara had been practicing "looking down," and was ready for the scary last pitch
again. This time, she did it with more control. It was still a bit creepy. The thing
is, you can see your packs and shoes down beneath your feet, 60 meters directly below.
And the chimney feels kind of wild, rotten and steep. After this, we thought we'd try
the Bergführer Route again. But I went up one pitch and decided that it was too much
for us this trip. I climbed back down, happy to save this route for next time.

Barbara and I hiked over to Nuvolau, had some drinks on top, then hiked back to the car
and drove home. What an amazing trip.

repository: ripsawridge/site

gha_language: JavaScript

repo_name: ripsawridge/site