text:
# NB Installation Procedure

## CORE DEPENDENCIES FOR UBUNTU
On a typical debian-like (ubuntu etc...) distribution, NB requires the following base packages:

**NOTE:**
  * packages in square brackets are optional
  * core ubuntu dependencies can be installed by running 'sudo make prereqs'

These can be installed as ubuntu packages. See installation instructions below for Mac OSX.

    python (>= 3.5)
    [postgresql] (>= 8.4)
    libpq-dev
    imagemagick
    mupdf-tools (for pdfdraw)
    context (for rich, i.e. annotated pdf generation)
    apache2
    libapache2-mod-wsgi-py3
    python-setuptools (used for 'easy_install pytz' in make prereqs as well)
    libpq-dev
    g++ (used to compile node)
    nodejs
    npm

## CORE DEPENDENCIES FOR MAC OSX
### Python 3.5+
Install Python 3 on your system (3.5+). Some versions of OS X may require you to do this in a virtualenv depending on protections on the default installation.After doing that, type python --version from the command line to confirm your version of Python.

### apache2 + mod_wsgi
Install MacPorts if you haven't already. You may need to update your current installation. Then:

    sudo port install apache2 mod_wsgi

If you see a ```sudo: port: command not found error```, modify your path variable by entering the following into your terminal:

    export PATH=/opt/local/bin:/opt/local/sbin:$PATH

Alternatively, instead of using port, if using Homebrew on Mavericks, you can also run:

    sudo ln -s /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/ /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain
    brew install mod_wsgi

If you're having trouble, you can also try the following installation package: https://pypi.python.org/pypi/mod_wsgi

After installing, using your favorite text editor, add the following to ```/opt/local/apache2/conf/httpd.conf``` (```/private/etc/apache2/httpd.conf``` in Mavericks and Sierra):

    LoadModule wsgi_module modules/mod_wsgi.so

If the file is read-only, run ```sudo chmod 777 httpd.conf``` before adding the line.

In the same file, uncomment:

    Include conf/extra/httpd-vhosts.conf #Include /private/etc/apache2/extra/httpd-vhosts.conf on some systems

### Postgres
Install Postgresapp: http://postgresapp.com/

Add the following to your PATH (in .profile, .bashrc, .bash_profile, or .zshrc, in your home directory):

    cd ~/
    export PATH="/Applications/Postgres.app/Contents/Versions/latest/bin:$PATH"

Start Postgres, then run the command-line interface by typing ```psql```. If you get an error "could not connect to server", you need to start Postgres manually with a command like:

    pg_ctl -D /Users/user/nbproject/postgres -l /Users/user/nbproject/postgres/server.log start

If successful, create a local NB database, filling in blanks:

    CREATE ROLE <admin> WITH SUPERUSER;
    CREATE USER <username> WITH PASSWORD <password>;
    CREATE DATABASE <dbname>;
    GRANT ALL PRIVILEGES ON DATABASE <dbname> to <username>;

After you set it up, type ```\l``` to make sure your database has been created.

### mupdf
Run:

    sudo port install mupdf

Alternatively, using Homebrew,

    brew install mupdf

Change instances of ```pdfdraw``` in the codebase to ```mudraw``` (currently in ```apps/upload/jobs.py```, line 82; run ```grep -r 'pdfdraw'``` to find others).

NOTE: To ignore this file on git, go to your working directory, and edit ```.git/info/exclude``` to add this line (you might have to create it as a new file):

    apps/upload/jobs.py

Then in the terminal, type:

    git update-index --assume-unchanged apps/upload/jobs.py

### Miscellaneous
Install pip if you haven't already by running:

    sudo easy_install pip

Install nodejs: http://nodejs.org/en/download/

Then install Grunt: http://gruntjs.com/getting-started

Install imagemagick: http://www.imagemagick.org/script/binary-releases.php#macosx

Install ConTeXt (for rich, i.e. annotated pdf generation): http://wiki.contextgarden.net/Mac_Installation (we recommend MacText distribution)

Start postfix (to enable sending mail if faced with "Connection refused"):

    sudo postfix start

## NEXT STEPS (ALL SYSTEMS)
### Apache 2
You will need to enable mod_headers on apache2. Do the following (you may need to use sudo):

    a2enmod headers
    apache2ctl restart

### Pip installations

    cd nbproject #(or whatever name you may have choosen for the root NB code directory).
    sudo pip3 install -r requirements.txt # To install additional required dependencies such as django, PyPDF2, etc

On Mac, you will also need to do the following:

    sudo pip install django-cors-headers

If, after setting everything up, you have trouble uploading a pdf with permission denied error,check the permissions on the directories specifying HTTPD_MEDIA and HTTPD_MEDIA_CACHE in your settings_credentials.py file.  For example,

    chmod ugo+rwx /var/local/nb/pdf/repository
    chmod ugo+rwx /var/local/nb/pdf/cache2

### grunt
      sudo npm install -g grunt-cli

### [optional] Enable mod_rewrite
 If you wish to use the embedded JavaScript file or NB bookmarklet on external sites, you may not see the font-awesome icons in the NB sidebar unless you enable mod_rewrite on your Apache server to ensure it responds to CORS requests. You can do that by running:

       sudo a2enmod rewrite

 If you're interested in the CORS config, you can find it in `conf/nb_apache.conf`

### [optional] Annotating YouTube Videos
If you include a Youtube video URL as a class resource, nb will not be able to retrieve the video title (and you will see a HTTP 500 error in console and the log file) unless you set your [API key](https://support.google.com/cloud/answer/6158862) in place of `CHANGE_ME` in the following line in `apps/nbsite/settings_credentials.py`. You can create different types of Google API key. In this case, you need a *SERVER* API key.

     GOOGLE_DEVELOPER_KEY    = "CHANGE_ME"

## 2 - Installation commands
   Once you've satisfied the dependencies listed above, you need to run the following installation commands (from nb root folder):

    npm install #in order to install specific grunt modules, such as grunt-css, execSync
    #[copy apps/nbsite/settings_credentials.py.skel to settings_credentials.py and]
    #[edit values in apps/nbsite/settings_credentials.py, following the direction there]
    make django #create configuration files. You can safely ignore the "Error 127" message
    sudo make create_dirs  # create root folder and some folders below that for nb data
    make django  # one more time...
    #[If you're deploying a production environmant, use the cmds given in output in order to configure apache]
    #[then configure the cron jobs (cf 5)]
    grunt  # Compiles js and css.
    #[optional]: If you want to use different slave servers for different parts of the app (i.e. one for serving
    # images, one for handling the rpc calls, and one for handling file uploads for instance), edit params in
    # content/ui/admin/conf.js: Tell which server(s) the client should use to fetch various pieces data. If you're
    # going to use just one server for the whole app, you can safely ignore this. Note that this is unrelated to
    # whether or not you're using localhost as your  databse server, but if you do use several server, make sure
    # they all use the same database, for consistency.  Don't forget to re-run 'grunt' if you change conf.js

### Debugging the installation
   * If you run into an illegal group name error, modify ```SERVER_USERNAME``` in ```nbsite/settings.py``` to be ```'_www'```.

## 3 - Database Initialization
   * Log in as someone who has postgres create role and create database privileges, such as postgres (one way is to do 'su' and then 'su postgres', or sudo -i -u postgres)

        ```
        createuser <YOUR_POSTGRES_USER> -P # replace <YOUR_POSTGRES_USER> by the user name you wish to create. Note that it's important to set it up as superuser since only superusers can create a language (used for plpythonu)
        ```

   * Then, filling in <YOUR_POSTGRES_USER> with the superuser from before:

        ```
        createdb -U <YOUR_POSTGRES_USER> -h localhost <YOUR_DB_NAME>
        ```

   * Alternatively, in psql (while logged in to the postgres user), do:

        ```
        CREATE DATABASE <YOUR_DB_NAME>;
        GRANT ALL PRIVILEGES ON DATABASE <YOUR_DB_NAME> to <YOUR_POSTGRES_USER>;
        ```

   * Exit from the database

```
    cd apps
    ./manage.py makemigrations # to create the database migrations files
    ./manage.py migrate # To create the database tables from the migrations files
    ./manage.py sqlcustom base | ./manage.py dbshell # to create custom views. If this throws an error, you could simply log in to your postgres database and run the query contained in https://github.com/nbproject/nbproject/blob/dev/apps/base/sql/ensemble.sql
```
If you run into a base_user does not exist error, you will need to run migrate commands before these two steps. Try:

    ./manage.py migrate auth
    ./manage.py migrate contenttypes
    ./manage.py migrate sites
    ./manage.py migrate base

Follow any instructions in the terminal for other migrations that may need to be done first.

   * You may also have to allow remote connections
     * sudo nano /etc/postgresql/[YOUR_VERSION]/main/pg_hba.conf
          o host    your_db_name       your_db_user       <IP_ADDRESS>/0     password
     * sudo nano /etc/postgresql/[YOUR_VERSION]/main/postgresql.conf
          listen_addresses = '*'
   * if you make a mistake:

 ```
    dropdb  -U <YOUR_POSTGRES_USER> -h localhost <YOUR_DB_NAME>
    createdb -U <YOUR_POSTGRES_USER> -h localhost <YOUR_DB_NAME>
```
    At this point you can try your installation using the Django debug server (but never use this in production...):
* From the apps directory: ```./manage.py runserver```
* In your browser visit ```http://localhost:8000```

## 4 - Extra stuff
  To be able to genereate annotated pdfs: Configure tex so that it allows mpost commands: make sure that 'mpost' is in shell_escape_commands (cf /tex/texmf/texmg.cnf)

### 5 - Crontab setup
  A sample crontab generated as part of the 'make django'. You just need to add it to your crontab for it to take effect

### 6 - Backup
  - **Database:**  use the pg_dump command:
    -pg_dump -U <YOUR_POSTGRES_USER> -h <YOUR_DB_HOST> -Fc -f <YOUR_NB_BACKUP_FILENAME> <YOUR_DB_NAME>

  - **Uploaded PDF files:** Use your favorite file backup technique (tar, rdiff-backup, unison etc...) to backup the directory:
    "%s%s" % (settings.HTTPD_MEDIA,settings.REPOSITORY_DIR) (cf your settings.py files for actual values).

### 7 - Restore
    dropdb  -U <YOUR_POSTGRES_USER> -h <YOUR_DB_HOST> <YOUR_DB_NAME>
    createdb -U <YOUR_POSTGRES_USER> -h <YOUR_DB_HOST> <YOUR_DB_NAME>
    pg_restore -U <YOUR_POSTGRES_USER> -h <YOUR_DB_HOST> -d <YOUR_DB_NAME> <YOUR_NB_BACKUP_FILENAME>

## Questions
For questions (including how to install NB on other linux distributions), use our forum at https://groups.google.com/d/forum/nbusers or email<EMAIL_ADDRESS>
## VIDEO ANNOTATOR UPDATE
Changes to the database can now be handled with Django migrations!
These instructions will get you up and running from a previous NB install.

### 1) Run the database migrations included in the codebase
    cd apps
    ./manage.py migrate

### 2) Add the new user option
    python base/jobs.py addsettings
(If this fails try changing the id fields in the function do_add_tag_email_setting)

### 3) Schedule the CRON job for automated tag reminders
(The following job runs daily at 8 PM)

    0 20 * * * (cd /home/ubuntu/nbgit/apps;  python -m 'base.jobs' tagreminders)

The tagreminders option of the base/jobs.py script sends reminders to all users about unseen tagged comments.

repository: nbproject/nbproject

branch_name: refs/heads/dev

gha_language: JavaScript

repo_name: nbproject/nbproject


text:
# [ES6: Use Destructuring Assignment to Pass an Object as a Function's Parameters](https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-pass-an-object-as-a-functions-parameters)

In some cases, you can destructure the object in a function argument itself.

Consider the code below:

```js
const profileUpdate = (profileData) => {
  const { name, age, nationality, location } = profileData;
  // do something with these variables
}
```

This effectively destructures the object sent into the function. This can also be done in-place:

```js
const profileUpdate = ({ name, age, nationality, location }) => {
  /* do something with these fields */
}
```

This removes some extra lines and makes our code look neat.

This has the added benefit of not having to manipulate an entire object in a function; only the fields that are needed are copied inside the function.

---

Use destructuring assignment within the argument to the function `half` to send only `max` and `min` inside the function.

## Setup
```js
const stats = {
  max: 56.78,
  standard_deviation: 4.34,
  median: 34.54,
  mode: 23.87,
  min: -0.75,
  average: 35.85
};
const half = (function() {
  "use strict"; // do not change this line
  // change code below this line
  return function half(stats) {
    // use function argument destructuring
    return (stats.max + stats.min) / 2.0;
  };
  // change code above this line
})();
console.log(stats); // should be object
console.log(half(stats)); // should be 28.015
```

## Solution 1
```js
const stats = {
  max: 56.78,
  standard_deviation: 4.34,
  median: 34.54,
  mode: 23.87,
  min: -0.75,
  average: 35.85
};
const half = (function() {
  "use strict"; // do not change this line

  return function half({max, min}) {
    return (max + min) / 2.0;
  };

})();
console.log(stats); // {max: 56.78, standard_deviation: 4.34, median: 34.54, mode: 23.87, min: -0.75, …}
console.log(half(stats)); // 28.015
```

## Solution 2
```js
const stats = {
  max: 56.78,
  standard_deviation: 4.34,
  median: 34.54,
  mode: 23.87,
  min: -0.75,
  average: 35.85
};
const half = (function() {
  "use strict"; // do not change this line

  return (({max, min}) => {
    return (max + min) / 2.0;
  });

})();
console.log(stats); // {max: 56.78, standard_deviation: 4.34, median: 34.54, mode: 23.87, min: -0.75, …}
console.log(half(stats)); // 28.015
```

license: MIT

repository: johnfelipe/progress

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: johnfelipe/progress


text:
![](https://philihp.com/openskill.js/logo.png)

[![Version](https://img.shields.io/npm/v/openskill)](https://www.npmjs.com/package/openskill)
![Tests](https://github.com/philihp/openskill.js/workflows/tests/badge.svg)
[![Coverage Status](https://coveralls.io/repos/github/philihp/openskill.js/badge.svg?branch=main&force=reload)](https://coveralls.io/github/philihp/openskill.js?branch=main)
![Downloads](https://img.shields.io/npm/dt/openskill)
![License](https://img.shields.io/npm/l/openskill)

Javascript implementation of Weng-Lin Rating, as described at https://www.csie.ntu.edu.tw/~cjlin/papers/online_ranking/online_journal.pdf

## Speed

Up to 20x faster than TrueSkill!

| Model                            | Speed (higher is better) | Variance |         Samples |
| -------------------------------- | -----------------------: | -------: | --------------: |
| Openskill/bradleyTerryFull       |           62,643 ops/sec |   ±1.09% | 91 runs sampled |
| Openskill/bradleyTerryPart       |           40,152 ops/sec |   ±0.73% | 91 runs sampled |
| Openskill/thurstoneMostellerFull |           59,336 ops/sec |   ±0.74% | 93 runs sampled |
| Openskill/thurstoneMostellerPart |           38,666 ops/sec |   ±1.21% | 92 runs sampled |
| Openskill/plackettLuce           |           23,492 ops/sec |   ±0.26% | 91 runs sampled |
| TrueSkill                        |            2,962 ops/sec |   ±3.23% | 82 runs sampled |

See [this post](https://philihp.com/2020/openskill.html) for more.

## Installation

Add `openskill` to your list of dependencies in `package.json`:

```bash
npm install --save openskill
```

## Usage

If you're writing ES6, you can `import`, otherwise use CommonJS's `require`

```js
import { rating, rate, ordinal } from 'openskill'
```

Ratings are kept as an object which represent a gaussian curve, with properties where `mu` represents the _mean_, and `sigma` represents the spread or standard deviation. Create these with:

```js
> const { rating } = require('openskill')
> const a1 = rating()
{ mu: 25, sigma: 8.333333333333334 }
> const a2 = rating({ mu: 32.444, sigma: 5.123 })
{ mu: 32.444, sigma: 5.123 }
> const b1 = rating({ mu: 43.381, sigma: 2.421 })
{ mu: 43.381, sigma: 2.421 }
> const b2 = rating({ mu: 25.188, sigma: 6.211 })
{ mu: 25.188, sigma: 6.211 }
```

If `a1` and `a2` are on a team, and wins against a team of `b1` and `b2`, send this into `rate`

```js
> const { rate } = require('openskill')
> const [[x1, x2], [y1, y2]] = rate([[a1, a2], [b1, b2]])
[
  [
    { mu: 28.67..., sigma: 8.07...},
    { mu: 33.83..., sigma: 5.06...}
  ],
  [
    { mu: 43.07..., sigma: 2.42...},
    { mu: 23.15..., sigma: 6.14...}
  ]
]
```

Teams can be asymmetric, too! For example, a game like [Axis and Allies](https://en.wikipedia.org/wiki/Axis_%26_Allies) can be 3 vs 2, and this can be modeled here.

### Ranking

When displaying a rating, or sorting a list of ratings, you can use `ordinal`

```js
> const { ordinal } = require('openskill')
> ordinal({ mu: 43.07, sigma: 2.42})
35.81
```

By default, this returns `mu - 3*sigma`, showing a rating for which there's a [99.7%](https://en.wikipedia.org/wiki/68–95–99.7_rule) likelihood the player's true rating is higher, so with early games, a player's ordinal rating will usually go up and could go up even if that player loses.

### Artificial Ranking

If your teams are listed in one order but your ranking is in a different order, for convenience you can specify a `ranks` option, such as

```js
> const a1 = b1 = c1 = d1 = rating()
> const [[a2], [b2], [c2], [d2]] = rate([[a1], [b1], [c1], [d1]], {
    rank: [4, 1, 3, 2] // 🐌 🥇 🥉 🥈
  })
[
  [{ mu: 20.963, sigma: 8.084 }], // 🐌
  [{ mu: 27.795, sigma: 8.263 }], // 🥇
  [{ mu: 24.689, sigma: 8.084 }], // 🥉
  [{ mu: 26.553, sigma: 8.179 }], // 🥈
]
```

It's assumed that the lower ranks are better (wins), while higher ranks are worse (losses). You can provide a `score` instead, where lower is worse and higher is better. These can just be raw scores from the game, if you want.

Ties should have either equivalent rank or score.

```js
> const a1 = b1 = c1 = d1 = rating()
> const [[a2], [b2], [c2], [d2]] = rate([[a1], [b1], [c1], [d1]], {
    score: [37, 19, 37, 42] // 🥈 🐌 🥈 🥇
  })
[
  [{ mu: 24.689, sigma: 8.179 }], // 🥈
  [{ mu: 22.826, sigma: 8.179 }], // 🐌
  [{ mu: 24.689, sigma: 8.179 }], // 🥈
  [{ mu: 27.795, sigma: 8.263 }], // 🥇
]
```

### Predicting Winners

For a given match of any number of teams, using `predictWin` you can find a relative
odds that each of those teams will win.

```js
> const { predictWin } = require('openskill')
> const a1 = rating()
> const a2 = rating({mu:33.564, sigma:1.123})
> const predictions = predictWin([[a1], [a2]])
[ 0.45110899943132493, 0.5488910005686751 ]
> predictions[0] + predictions[1]
1
```

### Predicting Draws

Also for a given match, using `predictDraw` you can get the relative chance that these
teams will draw. The number returned here should be treated as relative to other matches, but in reality the odds of an actual legal draw will be impacted by some meta-function based on the rules of the game.

```js
> const { predictDraw } = require('openskill')
> const prediction = predictDraw([[a1], [a2]])
0.09025530533015186
```

This can be used in a similar way that you might use _quality_ in TrueSkill if you were optimizing a matchmaking system, or optimizing an tournament tree structure for exciting finals and semi-finals such as in the NCAA.

### Alternative Models

By default, we use a Plackett-Luce model, which is probably good enough for most cases. When speed is an issue, the library runs faster with other models

```js
import { bradleyTerryFull } from './models'
const [[a2], [b2]] = rate([[a1], [b1]], {
  model: bradleyTerryFull,
})
```

- Bradley-Terry rating models follow a logistic distribution over a player's skill, similar to Glicko.
- Thurstone-Mosteller rating models follow a gaussian distribution, similar to TrueSkill. Gaussian CDF/PDF functions differ in implementation from system to system (they're all just chebyshev approximations anyway). The accuracy of this model isn't usually as great either, but tuning this with an alternative gamma function can improve the accuracy if you really want to get into it.
- Full pairing should have more accurate ratings over partial pairing, however in high _k_ games (like a 100+ person marathon race), Bradley-Terry and Thurstone-Mosteller models need to do a calculation of joint probability which involves is a _k_-1 dimensional integration, which is computationally expensive. Use partial pairing in this case, where players only change based on their neighbors.
- Plackett-Luce (**default**) is a generalized Bradley-Terry model for _k_ ≥ 3 teams. It scales best.

## Implementations in other languages

- Python https://github.com/OpenDebates/openskill.py
- Kotlin https://github.com/brezinajn/openskill.kt
- Elixir https://github.com/philihp/openskill.ex
- Lua https://github.com/bstummer/openskill.lua
- Google Sheets https://docs.google.com/spreadsheets/d/12TA1ZG_qpBi4kDTclaOGB4sd5uJK8w-0My6puMd2-CY/edit?usp=sharing
- Google Apps Script https://github.com/haya14busa/gas-openskill

branch_name: refs/heads/main

gha_language: TypeScript

gha_license_id: MIT


text:
---
title: Announcing Pest 2.0
description: The Pest team is thrilled to unveil the release of Pest 2.0 after a development period of 18 months and over 500 commits. This release introduces several exciting features that promise to improve the user's experience. Among the notable enhancements are robust new plugins, refined syntax, and advanced options that streamline testing, enhance usability, and boost productivity.
---

# Announcing Pest 2.0

The Pest team is thrilled to unveil the release of Pest 2.0 after a development period of 18 months and over 500 commits. This release introduces several exciting features that promise to improve the user's experience. Among the notable enhancements are robust new plugins, refined syntax, and advanced options that streamline testing, enhance usability, and boost productivity.

Today we’re finally making the long-awaited release of Pest 2.0! Our creator is eager to showcase the exciting new features this version has to offer. Tune in to the video below to learn more.

Pest 2.0 marks a major milestone in our development, packed with an array of powerful features such as:

- **[Powerful Architecture Plugin](/docs/arch-testing)**, for testing the architectural rules of your application with ease
- **[Up To 80% Speed Improvements on "--parallel" testing](/docs/optimizing-tests#parallel)**, with our fully rewritten parallel core, enjoy significantly faster test runs
- **[--profile option](/docs/optimizing-tests#content-profiling)**, to identify the slowest tests and optimize their execution
- **[--compact printer](/docs/optimizing-tests#content-compact-printer)**, a minimal printer that only outputs information about test failures
- **[--retry option](/docs/filtering-tests#retry)**, for saving time by running only previously unsuccessful tests
- **[--dirty option](/docs/filtering-tests#dirty)**, for only running tests with uncommitted changes
- **[--bail option](/docs/filtering-tests#bail)**, to immediately terminate the test suite upon encountering an error or failure.
- **[todo()](/docs/skipping-tests#content-creating-todos)** method, for creating todos within your test suite
- **[Expectation Interceptors and Pipes](/docs/custom-expectations#content-intercept-expectations)**, allowing you to tailor your expectations to fit your specific testing needs
- **[Scoped Datasets](/docs/datasets#content-scoped-datasets)**, for creating datasets that pertain only to a specific feature or set of folders

In addition to the features detailed above, there's so much more to explore with Pest 2.0! **Our website has been completely revamped**, with fresh documentation and a more user-friendly interface. There's never been a better time to dive in and start exploring.

If you're ready to get started with Pest 2.0 right away, check out our [installation guide](/docs/installation) for step-by-step instructions. And if you're currently using Pest 1, we've got you covered with detailed upgrade instructions in our [upgrade guide](/docs/upgrade-guide).

---

Thank you for reading about Pest 2.0's new features! If you're considering a testing framework for your next project, here's why you should give Pest a try: [Why Pest →](/docs/why-pest)

repository: mnaderian/docs

repo_name: mnaderian/docs


text:
Role Name
=========

Simple role to configure the /etc/bashrc

Requirements
------------

No reqs, only using template module.

Role Variables
--------------

A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.

Mandatory (not specified any way, have to be provided by the playbook or inventory or extra vars)
(none)

Optional (defaults)
```
bash_prompt_environment: 	String to show before  [user:hostname workdir]
bashrc_prompt_color:  		Set the color of the Bash Prompt. Use the tput value codes:
Color {code}	Color
0	Black
1	Red
2	Green
3	Yellow
4	Blue
5	Magenta
6	Cyan
7	White
```

Dependencies
------------

A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.

None

Example Playbook
----------------

Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:

    - hosts: servers
      roles:
         - { role: bashrc, bashrc_prompt_environment: "production", bashrc_prompt_color: 1 }

License
-------

BSD

Author Information
------------------

An optional section for the role authors to include contact information, or a website (HTML is not allowed).

repository: smossber/ansible-soe

repo_name: smossber/ansible-soe


text:
# FC50-Midi-Controller
MidiController based on a Boss FC-50 and an Arduino.

Got a Boss FC-50 (pretty beaten up) and turned it into a working and silent controller that did what I needed it do. (silent => footswitches don't make any noise when pressed)

# Features:
- PC-Mode: every footswitch sends ProgramChange at first press, second and following press becomes tap-tempo
- CC-Mode
- Looper Mode
- Song Mode
- 4 Expression Pedals

Unfortunately I have no FC-50 at the moment, so no updates. Just putting it out there for you guys who do want to use this (excellent) controller.


text:
# multicloud-operators-subscription-release

[![Build](http://<IP_ADDRESS>/badge.svg?jobs=build_multicloud-operators-subscription-release)](http://<IP_ADDRESS>/?job=images_multicloud-operators-subscription-release_postsubmit)
[![GoDoc](https://godoc.org/github.com/IBM/multicloud-operators-subscription-release?status.svg)](https://godoc.org/github.com/IBM/multicloud-operators-subscription-release)
[![Go Report Card](https://goreportcard.com/badge/github.com/IBM/multicloud-operators-subscription-release)](https://goreportcard.com/report/github.com/IBM/multicloud-operators-subscription-release)
[![Code Coverage](https://codecov.io/gh/IBM/multicloud-operators-subscription-release/branch/master/graphs/badge.svg?branch=master)](https://codecov.io/gh/IBM/multicloud-operators-subscription-release?branch=master)
[![License](https://img.shields.io/:license-apache-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0.html)

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents**  *generated with [DocToc](https://github.com/thlorenz/doctoc)*

- [multicloud-operators-subscription-release](#multicloud-operators-subscription-release)
    - [What is the multicloud-operators-subscription-release](#what-is-the-multicloud-operators-subscription-release)
    - [Community, discussion, contribution, and support](#community-discussion-contribution-and-support)
    - [Getting Started](#getting-started)
        - [Prerequisites](#prerequisites)
        - [Deployment](#deployment)
        - [Trouble shooting](#trouble-shooting)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## What is the multicloud-operators-subscription-release

The multicloud-operators-subscription-release is composed of 2 controllers. The helmchartsubscription controller which is in charge of managing the helmchartsubscription CR. That CR defines the location of the charts (helmrepo or github) and filters to select a subset of charts to deploy. the helmchartsubscription controller will then create a number of helmreleases and these are managed by the helmrelease controller. The helmrelease controller will manage the helmrelease CR, download the chart from the helmrepo or github and then call the operator-sdk helm-operator methods to start the deployment of each chart.

The helmrelease controller can be use independently without the helmchartsubscription controller. The flag `--helmchart-subscription-controller-disabled` can be used to disable the helmchartsubscription controller.

## Community, discussion, contribution, and support

Check the [CONTRIBUTING Doc](CONTRIBUTING.md) for how to contribute to the repo.

------

## Getting Started

### Prerequisites

Check the [Development Doc](docs/development.md) for how to contribute to the repo.

### Deployment

Check the [Deployment Doc](docs/deployment.md) for how to deploy the multicloud-operators-subscription-release in standalone mode.

### Trouble shooting

Please refer to [Trouble shooting documentation](docs/trouble_shooting.md) for further info.


text:
---
permalink: /about/
title: "About"
last_modified_at: 2022-11-25T12:04:24-04:00
classes: wide
---

### Bio
About Surafel Melaku LAKEW

 Surafel M. Lakew is an applied scientist at
 Amazon AWS AI Labs, since 2020.
He completed his Ph.D. at the Fondazione Bruno Kessler
HLT-MT research lab
and at the University of Trento ICT-Doctoral School,
advised by  Marcello Federico.
His thesis,  Multilingual Neural Machine Translation for Low-Resource Languages,
investigates approaches to improve the performance of neural machine translation models for language pairs without large-scale training data.

After obtaining his bachelor’s degree from  Jimma University,
he worked as an assistant lecturer at  Bahir Dar University,
Ethiopia. Before starting his Ph.D., he received his M.Sc. in computer science
from the University of Venice under the
supervision of Prof. Marcello Pelillo and
Prof. Andrea Prati, and
an MBA from Bologna Business School
in Green Management and Sustainable Businesses.

[//]: # (- Check out the updated [curriculm vita](https://surafelml.github.io/_docs/lakew_cv.pdf).)


text:
# 1:1 basics for the introvert engineering manager
[ref](https://speakerdeck.com/orenellenbogen/1-1-basics-for-the-introvert-engineering-manager?slide=38)

@reread

repository: eginwong/course-notes

gha_language: HTML

repo_name: eginwong/course-notes


text:
# 4. Collections

In this section, we will learn about several of the more complex types that are built into Serene. Collections hold a group of objects (typically of the same type), and you can access the elements of the collection using square brackets. Here, we'll learn about Array, Vectors, and Regions.

## Arrays

An array is a fixed-length sequence elements, where all of the elements are the same type. You specify what the types of elements are by using generics. We'll explain more about generics later, but for now it suffices to say that when describing a generic type like an array, you put the type of its elements in curly braces. So `Array{Float}` would be an array of floating-point numbers. However, generic types are still constructed like other objects, using the type's name followed by parameters in parenthesis (eg. `Array(0.1, 0.2, 0.3)`).

```serene
// returns the index of the leftmost occurence of x, or the next lowest number if x is not found
// Array u must be already sorted
function binarySearch(u: Array{Int}, x: Int) -> Int {
	var low = 0
    var high = u.length()
	while (low < high) {
		var mid = (low + high) / 2	// integer division
		if (u[mid] < x) {
			set low = mid + 1
		} else {
			set high = mid
		}
	}
	return low
}

function main() {
	var u = Array(5, 1, 4, -3, 9, 0)
	run u.sort!()
	print binarySearch(u, 4)
}
```

## Vectors

An vector is similar to an array, except its length can be changed after creation.

```serene
// deletes the leftmost occurence of x, or does nothing if x is not found
// Vector u must be already sorted
function binarySearchAndDelete(mutate u: Vector{Int}, x: Int) {
	var low = 0
    var high = u.length()
	while (low < high) {
		var mid = (low + high) / 2
		if (u[mid] < x) {
			set low = mid + 1
		} else {
			set high = mid
		}
	}
	if (u[low] == x) {
		run u.delete!(low)
	}
}

function main() {
	var u = Vector(Int)					// creates an empty vector of integers
	print "Length of u: ", u.length()   // Length of u: 0
	for (i = 0, 5) {
		run u.append!(i * 2)
	}
	print "Length of u: ", u.length()	// Length of u: 5
	print u								// [0, 2, 4, 6, 8]
	run binarySearchAndDelete(u, 6)
	print "Length of u: ", u.length()	// Length of u: 4
	print u								// [0, 2, 4, 8]
}
```

## Regions (and Handles)

A Region is a dynamically-sized block of memory where objects of the same type can be stored. Those objects are accessed using an index, referred to as a Handle. You can think of a Region as somewhat similar to a hash map, as it is effectively a mapping of keys to values. But unlike a hash map, the keys, called Handles in this case, are a special opaque type and are assigned by the Region when new values are added, rather than being assigned by the programmer.

Regions and Handles may sound a bit odd right now, but you'll see why they are necessary once you learn how to define your own types. For now, here is a simple demonstration of how they work.

```serene
function makeNames() {
	var reg = Region(String)
	const first_name = reg.add!("Neil")
	const middle_name = reg.add!("Patrick")
	const last_name = reg.add!("Harris")

	print reg[first_name]
	print reg[middle_name]
	print reg[last_name]
}

// This function isn't useful, as the strings won't be accessible from the calling scope
// but will still occupy memory within the Region. However, it's not a memory leak, because
// reg as a whole is still accessible and can be deallocated later.
function makeNames2() -> Region{String} {
	var reg = Region(String)
	const first_name = reg.add!("Neil")
	const middle_name = reg.add!("Patrick")
	const last_name = reg.add!("Harris")

	return reg
}
```


text:
# Scaling with docker-compose

This task consists on scalling previous deployment of the system with `docker-compose` on a local enviroment.

## Initial requirements

+ `Docker` and `docker-compose`
+ Clone `docker-chat` repository and copy it into `/demo` folder
    ```bash
    git clone https://github.com/ageapps/docker-chat
    ```
+ In order to deploy the system with `docker-compose` it's needed an additional configuration. [traefik] proxy needs to use a DNS name in order to provide session affinity. For this, the DNS name chosen is `app.docker.localhost`, and it has to be added into the `/etc/hosts` file:

    ```bash
    ...
    <IP_ADDRESS>  app.docker.localhost
    ...
    ```
## Setup
![advanced](../art/arch_2.png)
+ __Web (app):__ [NodeJS] server containin all business logic and that [features](#features)  mentioned above. It uses the official [NodeJS image] as base image.
+ __Database (db):__ [MongoDB] database. It uses the official [MongoDB image] with an additional startup script which sets up users in order to have a securized database (using `MONGO_DB_APP_PASSWORD`, `MONGO_DB_APP_USERNAME`, `MONGO_DB_APP_DATABASE` enviroment variables).

+ __Load Balancer (proxy):__ [traefik] proxy. __This service is only used when deploying with `docker-compose`__. This load balancer is needed in order to handle the service repplication and balance traffic between them aswell as session affinity for WebSocket support. It uses the official [traefik image] being the access point to the system. There is a management interface accesing `localhost` in port `8080`.
![traefik](../art/traefik.png)

+ __Message Broker (rabbit):__ This service is needed in order to scale WebSockets. It's possible to use the [RabbitMQ] as message broker. For this it's used the [Rabbit Adapter].
        To connect to the RabbitMQ service it's needed to use the `RABBIT_HOST` enviroment variable.
        RabbitMQ has a management web interface which is accessible using `localhost` in port `15672`.
        ![rabbit](../art/rabbit.png)
## Steps

### Deployment
```bash
$ cd demo
$ docker-compose -f docker-compose.rabbit.yaml up -d
Creating network "dockerchat_default" with the default driver
Starting dockerchat_proxy_1 ...
Starting dockerchat_proxy_1
Starting dockerchat_rabbit_1 ...
Starting dockerchat_rabbit_1
Creating dockerchat_db_1 ...
Creating dockerchat_db_1 ... done
Creating dockerchat_app_1 ...
Creating dockerchat_app_1 ... done
# connect in your browser to app.docker.localhost
# connect in your browser to <host IP>:8888 for the configuration pannel

$ docker ps
CONTAINER ID        IMAGE                       COMMAND                  CREATED             STATUS                    PORTS                                                                     NAMES
551c7544a539        ageapps/docker-chat:app     "nodemon ./bin/www"      27 seconds ago      Up 25 seconds             3000/tcp                                                                  dockerchat_app_1
3508a0f43d6d        ageapps/docker-chat:mongo   "docker-entrypoint..."   58 seconds ago      Up 56 seconds (healthy)   <IP_ADDRESS>:27017->27017/tcp                                                  dockerchat_db_1
ac33c8572dff        rabbitmq:3-management       "docker-entrypoint..."   4 days ago          Up 56 seconds             4369/tcp, 5671-5672/tcp, 15671/tcp, 25672/tcp, <IP_ADDRESS>:15672->15672/tcp   dockerchat_rabbit_1
7b8a8180c84f        traefik                     "/traefik --web --..."   4 days ago          Up 56 seconds             <IP_ADDRESS>:80->80/tcp, <IP_ADDRESS>:8080->8080/tcp                                dockerchat_proxy_1
```

### Scale Application
```bash
$ docker-compose -f docker-compose.rabbit.yaml scale app=5
WARNING: The scale command is deprecated. Use the up command with the --scale flag instead.
Starting dockerchat_app_1 ... done
Creating dockerchat_app_2 ...
Creating dockerchat_app_3 ...
Creating dockerchat_app_4 ...
Creating dockerchat_app_5 ...


text:
# ian

## Android specific building

First, you need to setup a keystore. Inside the keystore, you can put your private keys that you need to sign the app with.

To create a keystore and a key, you can use this command to create a RSA key with 2048 bits and a validity of 10000 days:

```
keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
```

## Config

You can add a `config.json` file in the root of the project to easily update the texts from a spreadsheet and have a easy way to sign your Android app.

### Settings for the keystore / key for Android

When setting up the `config.json`, you can add a `key` object for Android specific signing. If you use a relative path to the store, don't forget that it starts in the directory `${PROJECT_DIR}/platforms/android/`.

### Settings for the random texts

There are three settings that need to be set for the texts.

1. `outputJson` - In our case, this should always be `src/js/texts.json`. It will overwrite the existing texts with the new ones it reads from Google Spreadsheets.
2. `sheetId` - The spreadsheet id.
3. `workheetIds` - An array of the worksheets to use from the Google Spreadsheet.

It is crucial that the spreadsheet is shared for everyone. Otherwise the `gulp texts` task won't be able to download.

### Full example

Here is a full example for a `config.json`:

```
{
  "key" : {
    "store" : "../../my-release-key.keystore",
    "storePassword" : "password-for-store",
    "alias" : "alias_name",
    "aliasPassword" : "password-for-key"
  },
  "outputJson" : "src/js/texts.json",
  "sheetId" : "1TmeO6jsf53wrvAbGfN0UrQn7Ycn3G7lNMffVvuBbXTg",
  "worksheetIds" : [
    "0"
  ]
}
```

repository: Narigo/ian

repo_name: Narigo/ian


text:
THMultipeer
===========
## Nearby connectivity library for iOS 7 (bluetooth or wifi)
THMultpeer is a wrapper on top of Apple iOS Multipeer Connectivity framework. It provides an easier way to create and manage sessions. It will save you time for handling disconnection and already has a mechanism to identify peers by setting displayName to be the device identifierForVendor (UUID String). Thus there will be no conflict if two devices having the same name.

## How to use
```objective-c
THMultipeer.me().serviceType = "thkeen-Num"
THMultipeer.me().info = ["model": UIDevice.currentDevice().model]
THMultipeer.me().broadcast()
```

## Delegate methods
```objective-c
/**
 *  New peer found, insert to UI
 *
 *  @param peer  MCPeerID
 *  @param name  Device name that was put during the advertisement
 *  @param info  Other info if any
 *  @param index Insert to the appropriate index in the UIwwd
 */
- (void)multipeerNewPeerFound:(MCPeerID*)peerID withName:(NSString*)name andInfo:(NSDictionary*)info atIndex:(NSInteger)index;
/**
 *  Lost a peer, remove from UI
 *
 *  @param peer  MCPeerID
 *  @param index Index to remove
 */
- (void)multipeerPeerLost:(MCPeerID*)peerID atIndex:(NSInteger)index;
/**
 *  All found peers were removed, update UI now
 */
- (void)multipeerAllPeersRemoved;
/**
 *  Could not advertising or browsing
 *
 *  @param error
 */
- (void)multipeerDidNotBroadcastWithError:(NSError*)error;
/**
 *  This is actually a wrapper on didReceiveInvitation but we make use of it as a protocol for sending simple message without having to accept the invitation.
 *
 *  @param info NSDictionary: invitation context
 *  @param peer MCPeerID
 */
- (void)multipeerDidReceiveInfo:(NSDictionary*)info fromPeer:(MCPeerID*)peerID;
```

repository: thkeen/THMultipeer

repo_name: thkeen/THMultipeer


text:
# Connection Reset Issue between Pod and Out of Cluster

In general, when a container transmits a packet to outside the cluster, the packet is SNAT'ed. After that, when receiving a response packet from outside the container, the response packet must be DNAT'ed and delivered to the pod. However, due to the conntrack bug of the linux kernel, the response packet is regarded as an invliad packet, so there is a problem that the respose packet is not DNAT'ed and transmiited to the host. The host considers the response packet sent to the host as an incorrectly transmitted packet and disconnects the TCP connection by sending a reset packet.

## How to solve it

network-node-manager adds DROP the rules for invalid packet to INPUT chain in filter table. Below are rules set by network-node-manager.

```
$ iptables -t filter -nvL
...
Chain INPUT (policy ACCEPT 3229 packets, 597K bytes)
 pkts bytes target     prot opt in     out     source               destination
 246K   56M NMANAGER_INPUT  all  --  *      *       <IP_ADDRESS>/0            <IP_ADDRESS>/0
...
Chain NMANAGER_INPUT (1 references)
 pkts bytes target     prot opt in     out     source               destination
 246K   56M NMANAGER_DROP_INVALID_INPUT  all  --  *      *       <IP_ADDRESS>/0            <IP_ADDRESS>/0

Chain NMANAGER_DROP_INVALID_INPUT (1 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 DROP       all  --  *      *       <IP_ADDRESS>/0            <IP_ADDRESS>/0            ctstate INVALID
```

## References

* https://github.com/moby/libnetwork/issues/1090


text:
---
layout: post
title:  Do I need to recompile my AEM code for 6.2?
date:   2016-04-27
image: /assets/article_images/2016-04-27-recompile/logo.jpeg
---

With the release last week of [Adobe Experience Manager 6.2](https://docs.adobe.com/docs/en/aem/6-2/release-notes.html){:target="_blank"} many developers are going to start
testing their applications on this new release. In the past, most AEM releases have been, at least at an API level, almost entirely backwards compatible, but with this release, the product management and engineering teams have taken the opportunity to remove some long-deprecated APIs. As a result, many applications will need to be either refactored or recompiled to work with AEM 6.2.

> Now might be a good time to review the [complete list of deprecated and removed features](https://docs.adobe.com/docs/en/aem/6-2/release-notes/deprecated-removed-features.html){:target="_blank"}

You will know recompilation is necessary if, when you install your application into an AEM 6.2 instance, your bundles fail to start and the log messages complain about various unresolved dependencies. Something like:

    Unable to resolve com.myco.myco-bundle [472](R 472.0):
	missing requirement [com.myco.myco-bundle [472](R 472.0)]
	osgi.wiring.package;
	(&(osgi.wiring.package=com.day.cq.commons)(version>=5.7.0)(!(version>=6.0.0)))

> The actual log message is more verbose, but this is the key part.

What this means is that the bundle `com.myco.myco-bundle`, which is bundle ID 472 has a dependency on a package named `com.day.cq.commons`, meaning that a bundle must be export this package. This dependency has a constraint on it which requires that the exported package's version must be greater than or equal to 5.7.0 and less than 6.0.

This constraint got that way because, in general, OSGi tooling (such as the `maven-bundle-plugin` and `bnd`) will automatically generate package import constraits based on the version of the exported package on the classpath at build time and assuming that [Semantic Versioning](https://www.osgi.org/wp-content/uploads/SemanticVersioning.pdf){:target="_blank"} is being followed. In this case, the package `com.day.cq.commons` was exported in AEM 6.1 with the version 5.7.0.

But before doing some trial and error, it is actually possible to predict whether or not these types of errors will occur by looking at the changes in package versions. If your application depends upon *any* package which had a major version change between AEM 6.1 and 6.2, it will at minimum need to be recompiled. While every application will be different, what I have observed is that the key packages are these:

* `com.day.cq.commons`
* `com.day.cq.commons.jcr`
* `com.day.cq.replication`
* `com.day.cq.security`
* `com.day.cq.workflow`
* `com.day.cq.workflow.exec`

[Click here](/assets/aem62/major-package-changes.txt){:target="_blank"} for a list of the packages which have had major version changes between AEM 6.1 and 6.2.

In addition, there are some packages which have been entirely removed. These are long-deprecated features and, in some cases, packages which were never intended to be used. These have, at least in my observations, been much less problematic for early adopters, but one to call out specifically is `org.apache.sling.event`. [Click here](/assets/aem62/removed-packages.txt){:target="_blank"} for the full list. If your application depends upon any of these, it will need to be refactored. To see an example of such a refactoring, you can take a look at the [first set of changes made for 6.2 support in ACS AEM Commons](https://github.com/Adobe-Consulting-Services/acs-aem-commons/commit/d633dd4db10dfc20cd19a89ec9aaa4b7819242c9){:target="_blank"}.

## Updating the UberJar

Assuming you need to recompile, the first thing you need to do is update your project to reference the AEM 6.2 UberJar. As documented on [https://docs.adobe.com/docs/en/aem/6-2/develop/dev-tools/ht-projects-maven.html](https://docs.adobe.com/docs/en/aem/6-2/develop/dev-tools/ht-projects-maven.html){:target="_blank"}, the UberJar is available in two different versions:

* An obfuscated version which is freely available on [repo.adobe.com](http://repo.adobe.com){:target="_blank"}.
* An unobfuscated version which can only be obtained by licensed customers and partners through Adobe Support (Daycare).

There are a variety of cases when you *need* the unobfuscated version -- certain types of unit tests, certain Declarative Services use cases, etc. These are laid out in the [documentation](http://adobe.ly/1SKsJnB){:target="_blank"}. It is worth noting that these use cases **haven't changed between AEM 6.1 and AEM 6.2**. In other words, if you were using the obfuscated version before, you can continue to use the obfuscated version. And if you needed the unobfuscated version, you still need it.

To use the 6.2 UberJar, update the dependency in your project's _pom.xml_ file to:

{% highlight xml %}
<dependency>
    <groupId>com.adobe.aem</groupId>
    <artifactId>uber-jar</artifactId>
    <version>6.2.0</version>
    <classifier>obfuscated-apis</classifier>
    <scope>provided</scope>
</dependency>
{% endhighlight %}

Or, if you are using the unobfuscated version:

{% highlight xml %}
<dependency>
    <groupId>com.adobe.aem</groupId>
    <artifactId>uber-jar</artifactId>
    <version>6.2.0</version>
    <classifier>apis</classifier>
    <scope>provided</scope>
</dependency>
{% endhighlight %}

Once this is done, simply build your application. If you have compiler errors, those are most likely due to removed packages or classes and the referencing code needs to be refactored.

extension: markdown


text:
# Packaging and Deploying SQL Databases

INFO

This documentation is for FAKE version 5.0 or later. The old documentation can be found here

FAKE can be used to create a SQL DACPAC and also deploy it to a SQL Server using the MSDeploy executable. This is installed by default with Visual Studio and with the SQL Server Data Tools (SSDT) package.

DACPACs automatically diff from the source to the destination and generate the SQL script dynamically.

You can read up more on DACPac and MSDeploy arguments [here](https://msdn.microsoft.com/en-us/library/hh550081%28v=vs.103%29.aspx).

## Sample usage

Ensure that you have already built your database project (you can do this with standard MSBuild). Then, use the ``deployDb`` command to deploy the ``dbProject.dacpac`` to the ``myDatabase``.

    open Fake.Sql

    /// the database for local development + compile
    Target.create "DeployLocalDb" (fun _ ->
        let connectionString = "Data Source=(localdb)\\MSSQLLocalDB;Integrated Security=True;Database=MyDatabase;Pooling=False"
        let dacPacPath = "path/to/dbProject.dacpac"
        DacPac.deployDb (fun args -> { args with Source = dacPacPath; Destination = connectionString }) |> ignore
    )

## Deployment Options

You can optionally specify the type of command to use (again, refer to the documentation above for more detail): -

* Deploy - full deploy to destination
* Script - SQL script
* Report - XML report of diff

In addition, you can also elect to deploy to Dacpac files rather than SQL databases - simply pass in the pass to the dacpac that you wish to generate.

repository: cutff/FAKE

gha_license_id: NOASSERTION

repo_name: cutff/FAKE


text:
# Dependencies and Installation

## Distro dependencies (Debian)
There are a few dependencies which we recommend you get from your
distribution's archives.

```
sudo apt-get install build-essential python-dev python-setuptools openssl libsqlite3-dev libffi-dev
```

### Tor
You will need a Tor binary on your system. For complete instructions, see also:

```
https://www.torproject.org/docs/tor-doc-unix.html.en
https://www.torproject.org/docs/rpms.html.en
```

If you've already got Tor, or plan to compile it yourself from source, great!
You can skip this step. Otherwise, if you're installing Tor (or reinstalling),
you'll want to make sure to get our keyring package in Debian:

```
echo "deb http://deb.torproject.org/torproject.org wheezy main" | \
    sudo tee -a /etc/apt/sources.list
gpg --keyserver keys.gnupg.net --recv EE8CBC9E886DDD89
gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add -
sudo apt-get update
sudo apt-get install deb.torproject.org-keyring tor tor-geoipdb
```

### Pip (>=1.3.0)
We recommend using the Pip>=1.3.0 because it included several important
security and privacy related patches:

 * It forces the use of HTTPS for [PyPI](pypi.python.org).
 * and checks package hash sums before installation, with support for hashes
   more collision-resistant than MD5.

The least painful way (that we know of) to install a newer Pip is to use Pip's
get-pip script:

```
# Grab the get-pip installer to make sure we have pip>=1.3.0
curl -O https://raw.github.com/pypa/pip/master/contrib/get-pip.py
sudo python ./get-pip.py  ## pip (>=1.3.0) is recommended for security reasons
# And make sure we're actually using the newer one:
sudo update-alternatives --install /usr/bin/pip pip /usr/local/bin/pip 0
```

### Virtualenv
We recommend that you use a python virtualenv. The recommended commands for
setting up this up and installing are:

```
sudo pip install --upgrade virtualenv virtualenvwrapper
# Setup the virtualenv directory:
export WORKON_HOME=~/.virtualenvs && mkdir -p $WORKON_HOME
source /usr/local/bin/virtualenvwrapper.sh
# Clone ooni-backend:
git clone https://github.com/TheTorProject/ooni-backend.git && cd ooni-backend
# Create the virtualenv for ooni-backend...
mkvirtualenv -a $PWD --unzip-setuptools --setuptools --no-site-packages oonib
# ...and install ooni-backend (sudo is not necessary since we're in a virtualenv):
pip install -r requirements.txt --use-mirrors
# Note: it is important that you install the requirements before you run
# the setup.py script. If you fail to do so they will be downloaded over
# plaintext.
python setup.py install
```

# Running an OONI collector

## Configure oonib

Copy the example config file to ```oonib.conf```.

```
cp oonib.conf.example oonib.conf
```

Then edit your configuration to fit your needs. The fields you should probably
end up changing are ```report_dir``` (the public web server directory where you
would like ooni-probe clients to be able to submit reports to, for example, if
the clients should submit POSTs to https://abcdef0123456789.onion/report then
this would simply be ```'report'```) and ```tor_datadir``` (where you would
like the spawned Tor process to keep its data). If you compiled Tor yourself,
you'll likely want to specify it for the ```tor_binary``` option.

### Generate self signed certs for OONIB
If you want to use the HTTPS test helper, you will need to create a certificate:

```
openssl genrsa -des3 -out private.key 4096
openssl req -new -key private.key -out server.csr
cp private.key private.key.org
# Remove passphrase from key
openssl rsa -in private.key.org -out private.key
openssl x509 -req -days 365 -in server.csr -signkey private.key -out certificate.crt
rm private.key.org
rm server.csr
```

If you decide to put your certificate and key somewhere else, don't forget to
update oonib.conf options ```helpers.ssl.private_key``` and ```helpers.ssl.certificate``` !

### Redirect low ports with iptables
The following iptables commands will map connections on low ports to those
bound by oonib:

```
# Map port 80 to config.helpers['http-return-json-headers'].port  (default: 57001)
iptables -t nat -A PREROUTING -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 57001
# Map port 443 to config.helpers.ssl.port  (default: 57006)
iptables -t nat -A PREROUTING -p tcp -m tcp --dport 443 -j REDIRECT --to-ports 57006
# Map port 53 udp to config.helpers.dns.udp_port (default: 57004)
iptables -t nat -A PREROUTING -p tcp -m udp --dport 53 -j REDIRECT --tor-ports
# Map port 53 tcp to config.helpers.dns.tcp_port (default: 57005)
iptables -t nat -A PREROUTING -p tcp -m tcp --dport 53 -j REDIRECT --tor-ports
```

### (For Experts Only) Tor2webmode:
**WARNING**: provides no anonymity! Use only if you know what you are doing!
Tor2webmode will improve the performance of the collector Hidden Service by
discarding server-side anonymity.

You will need to build Tor from source. At the time of writing, the latest
stable Tor is tor-<IP_ADDRESS>. You should use the most recent stable Tor.

Example:

```
git clone https://git.torproject.org/tor.git
git checkout tor-<IP_ADDRESS>
git verify-tag -v tor-<IP_ADDRESS>
```

You should see:

```
object 17c24b3118224d6536c41fa4e1493a831fb29f0a
type commit
tag tor-<IP_ADDRESS>
tagger Roger Dingledine<EMAIL_ADDRESS>1353399116 -0500

tag <IP_ADDRESS>
gpg: Signature made Tue 20 Nov 2012 08:11:59 UTC
gpg:                using RSA key C218525819F78451
gpg: Good signature from "Roger Dingledine<EMAIL_ADDRESS>gpg:                 aka "Roger Dingledine<EMAIL_ADDRESS>gpg:                 aka "Roger Dingledine<EMAIL_ADDRESS>```

It is always good idea to verify.

```
$ gpg --recv-keys C218525819F78451
[...]
$ gpg --fingerprint C218525819F78451
pub   4096R/C218525819F78451 2010-05-07
      Key fingerprint = F65C E37F 04BA 5B36 0AE6  EE17 C218 5258 19F7 8451
      uid               [  full  ] Roger Dingledine<EMAIL_ADDRESS>      uid               [  full  ] Roger Dingledine<EMAIL_ADDRESS>      uid               [  full  ] Roger Dingledine<EMAIL_ADDRESS>      sub   4096R/690234AC0DCC0FE1 2013-05-09 [expires: 2014-05-09]
```

Build Tor with enable-tor2web-mode

```
./autogen.sh ; ./configure --enable-tor2web-mode ; make
```

Copy the tor binary from src/or/tor somewhere and set the corresponding
options in oonib.conf.

## To launch oonib on system boot
To launch oonib on startup, you may want to use supervisord (www.supervisord.org)
The following supervisord config will use the virtual environment in
/home/ooni/venv_oonib and start oonib on boot:

```
[program:oonib]
command=/home/ooni/venv_oonib/bin/python /home/ooni/ooni-probe/bin/oonib
autostart=true
user=oonib
directory=/home/oonib/
```

## Testing with vagrant

To test the deployment of oonib you may use [vagrant](http://www.vagrantup.com).

Once installed you will be able to install oonib in the virtual machine via:

```
vagrant up
```

repository: darius/ooni-backend

repo_name: darius/ooni-backend


text:
[TOC](Readme.md) [Prev](aliases.md) [Next](hidden.md)

_References and Visibility_

# Emit Values

By default all top-level fields are emitted when evaluating a configuration.
CUE files may define a top-level value that is emitted instead.
<!-- jba:
It's unclear how they do that. Is it the first form in the file?
And this is not in the spec AFAICT.
-->

Values within the emit value may refer to fields defined outside of it.

Emit values allow CUE configurations, like JSON,
to define any type, instead of just structs, while keeping the common case
of defining structs light.

<!-- CUE editor -->
_emit.cue:_
```
{
    a: A
    b: B
}

A: 1
B: 2
```

<!-- result -->
`$ cue eval emit.cue`
```
a: 1
b: 2
```

repository: micnncim/cue

repo_name: micnncim/cue


text:
# Jad's Curriculum Vitae

![image](cover_image.png)

## iOS Application

I am an avid iOS developer and Mac OS X dabbler who likes to think of new ways to present things. Therefore, my CV has been written in the form of a universal iOS application. The code (under a [BSD 3-Clause](http://opensource.org/licenses/BSD-3-Clause)) is [available](https://github.com/jad6/CV/releases) to download, browse and use.

This app is localised for English 🇬🇧 and French 🇫🇷! Set your device to French to run the application under its French localised from. The base localised language is English and as such the application will present its contents in English for all other languages.

## Objective-C

The Objective-C application is iOS 7.1+ and the installation intrsuction are described in the next section.

### Compiling The Application

To compile the application you will need to run Mac OS X with [Xcode 5.1+](https://developer.apple.com/xcode/) installed. Then simply open the ```Jad's CV.xcodeproj``` file and run the application.

**Note:** To run it on a personal iOS device you will need to have an active full [iOS Developer](https://developer.apple.com/programs/ios/) account. Alternatively you could go through TestFlight as per the below instructions.

### TestFlight

Through [TestFlight](http://help.testflightapp.com/customer/portal/articles/402851-testflight-faq) you can download the application without the need for the App Store.

By completing the [recruitment information](http://tflig.ht/1gycrc2) I will be able to authorise you to download the application and you will have access to the latest uploaded builds.

## Swift *(In Development)*

I am currently porting the application to Swift as a fun learning experience. The Swift application is iOS 8.0+ and aims to improve the code and paradigms used in the Objective-C version. The improvements include:

- A restructured class hierarchy for the models.
- Generics, Extensions and other usefull new Swift specific language features.
- Dynamic Font Type and accessibility extra large font size support.
- Removed the Storyboards.
	- *+ve* This allows for tighter layout controls of the subviews
	- *+ve* Enforces a clean and robust MVC structure;
	- *+ve* Merges are 100x nicer;
	- *-ve* Creates more boiler code, typically in `layoutSubviews`.

### Development

The Swift application will continue to be developed on the [`swift`](https://github.com/jad6/CV/tree/swift) branch and once the application is fully ported the `master` branch will be updated.

## Old Fashioned Way

If you cannot compile or download the app, you can download [Jad's CV.pdf](https://github.com/jad6/CV/raw/master/Jad's%20CV%20en.pdf) (a [French version](http://raw.githubusercontent.com/jad6/CV/master/Jad's%20CV%20fr.pdf) of the PDF is also available). However, the PDF version of my CV is slightly less informative than the app as the projects I worked on have been omitted.


text:
<!--
{
  "name": "Flags",
  "category": "5eed3e2ace045b343fc0a328",
  "priority": 100
}
-->
# BuildBuddy Flags

There are several configuration options that are not in the BuildBuddy configuration file. These are:

* ```--listen``` The interface that BuildBuddy will listen on. Defaults to <IP_ADDRESS> (all interfaces)
* ```--port``` The port to listen for HTTP traffic on. Defaults to 8080.
* ```--grpc_port``` The port to listen for gRPC traffic on. Defaults to 1985.

repository: mihaigalos/buildbuddy

repo_name: mihaigalos/buildbuddy


text:
# Online Training website

>Hello hii I polited request to all Help wanted: Currently I dont have time to develop this project so if anybody want to help I would love to invite to the contribution list

> Online Training website like udemy or pluralsight using ASP.Net Core and Angular 4

[![Codacy Badge](https://api.codacy.com/project/badge/Grade/76d4da06634540c39741c7f8afd211f6)](https://www.codacy.com/app/ngohungphuc95/online-training?utm_source=github.com&utm_medium=referral&utm_content=ngohungphuc/online-training&utm_campaign=Badge_Grade)
[![codebeat badge](https://codebeat.co/badges/322e5383-f2a2-4d8b-a4d2-b2cda338ee59)](https://codebeat.co/projects/github-com-ngohungphuc-online-training-master)

### Technology use in this project
  -  ASP.Net Core 2.0
  -  Gzip compression
  -  JWT Authentication with refresh token
  -  SignalR Core
  -  Automapper
  -  MongoDB
  -  Webpack
  -  Angular 4 CLI
  -  Redux (ngrx)
  -  Effect
  -  [MongoDb Driver](https://github.com/mongodb/mongo-csharp-driver)
  -  Google drive API
  -  Video streaming
  -  Docker
  -  Web job background task (Apply later)
  -  Elasticsearch (Apply later)

### Account Info
* username: phucngo
* pass: 070695

### Ref doc

##### Angular
https://vsavkin.com/angular-router-preloading-modules-ba3c75e424cb

https://vsavkin.com/angular-router-declarative-lazy-loading-7071d1f203ee

https://www.pluralsight.com/guides/front-end-javascript/building-a-redux-application-with-angular-2-part-1

https://www.pluralsight.com/guides/front-end-javascript/building-a-redux-application-with-angular-2-part-2

http://brianflove.com/2017/04/10/angular-reactive-authentication/

https://psamsotha.github.io/angular/2016/12/31/ngrx-effects-with-angular.html

https://medium.com/@flashMasterJim/setting-up-ngrx-store-in-an-angular-2-project-e5232a7b082e

https://medium.com/@flashMasterJim/the-basics-of-ngrx-effects-effect-and-async-middleware-for-ngrx-store-in-angular-2-f25587493329

http://4dev.tech/2016/03/login-screen-and-authentication-with-angular2/

https://auth0.com/blog/managing-state-in-angular-with-ngrx-store/

http://brianflove.com/2017/09/09/updating-to-ngrx-4/

https://blog.nrwl.io/using-ngrx-4-to-manage-state-in-angular-applications-64e7a1f84b7b

https://github.com/NetanelBasal/ngx-auto-unsubscribe

---

##### .Net
http://www.c-sharpcorner.com/article/handle-refresh-token-using-asp-net-core-2-0-and-json-web-token/

https://www.codeproject.com/Articles/608860/Understanding-and-Implementing-Password-Hashing

https://dotnetcoretutorials.com/2017/09/23/using-automapper-asp-net-core/

https://stackoverflow.com/questions/40275195/how-to-setup-automapper-in-asp-net-core

<EMAIL_ADDRESS>
https://code.msdn.microsoft.com/How-to-achieve-a-bearer-9448db57

http://www.talkingdotnet.com/how-to-upload-file-via-swagger-in-asp-net-core-web-api/

http://www.talkingdotnet.com/how-to-enable-gzip-compression-in-asp-net-core/

http://www.talkingdotnet.com/global-exception-handling-in-aspnet-core-webapi/

http://www.talkingdotnet.com/app-use-vs-app-run-asp-net-core-middleware/

http://www.talkingdotnet.com/use-dapper-orm-with-asp-net-core/

https://angular.io/api/core/ChangeDetectorRef#detectChanges

http://plnkr.co/edit/GC512b?p=preview

https://medium.com/front-end-hacking/javascript-make-your-code-cleaner-with-decorators-d34fc72af947

https://medium.com/beautiful-angular/show-loader-on-every-request-in-angular-2-9a0fca86afef

https://netbasal.com/listening-for-actions-in-ngrx-store-a699206d2210

https://netbasal.com/boosting-performance-with-the-new-updateon-option-in-angular-v5-18857279ace2

https://netbasal.com/optimizing-the-performance-of-your-angular-application-f222f1c16354

---

##### Google drive api
https://www.daimto.com/google-drive-api-c-upload/

##### Deploy

https://blog.devcenter.co/deploy-asp-net-core-2-0-apps-on-heroku-eea8efd918b6

https://scotch.io/tutorials/deploying-an-angular-cli-app-to-production-with-firebase

### Tool
https://www.json-generator.com/

### Url to test authorization

Authentication http://localhost:51316/auth?grant_type=password&client_id=59ee1ba3acf7c53bf4d2504c&username=phucngo&password=070695

Refresh token http://localhost:51316/api/token/auth?grant_type=refresh_token&client_id={client_id}&refresh_token={refresh_token}

license: Unlicense

gha_license_id: Unlicense


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

### Description

An issue was discovered in Suricata before 6.0.4. It is possible to bypass/evade any HTTP-based signature by faking an RST TCP packet with random TCP options of the md5header from the client side. After the three-way handshake, it's possible to inject an RST ACK with a random TCP md5header option. Then, the client can send an HTTP GET request with a forbidden URL. The server will ignore the RST ACK and send the response HTTP packet for the client's request. These packets will not trigger a Suricata reject action.

### POC

#### Reference
- https://redmine.openinfosecfoundation.org/issues/4710

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

repository: trickest/cve

repo_name: trickest/cve


text:
---
sidebar_position: 2
---

# Libraries

- Navigation using [react-navigation (v5)](https://reactnavigation.org/)
- State management using [redux](https://redux.js.org/)
- Redux middleware [redux-saga](https://redux-saga.js.org/)
- Env config management using [react-native-config](https://github.com/luggit/react-native-config)
- Splash screen using [react-native-bootsplash](https://github.com/zoontek/react-native-bootsplash)
- API request using [axios](https://github.com/axios/axios)
- Localization using [react-native-localization](https://github.com/stefalda/ReactNativeLocalization)
- Responsive UI using [react-native-size-matters](https://github.com/nirsky/react-native-size-matters)
- Image caching using [react-native-fast-image](https://github.com/DylanVann/react-native-fast-image)


text:
# awsome: simple script to quickly spin up EC2 instances

## Prerequisites
[AWS CLI Interface](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html)

## Usage
```
python3 -m awsome -h
usage: awsome.py [-h] [-f LOG_FILE] [-l LOG_LEVEL] [-w OUT_FILE]
                 {list,describe,create,start,stop,reboot,terminate} ...

awsome

positional arguments:
  {list,describe,create,start,stop,reboot,terminate}

optional arguments:
  -h, --help            show this help message and exit
  -f LOG_FILE, --log-file LOG_FILE
                        Log file
  -l LOG_LEVEL, --log-level LOG_LEVEL
                        Log level(DEBUG | INFO | WARNING | ERROR | CRITICAL)
  -w OUT_FILE, --output-file OUT_FILE
                        Output file
```

## Examples

### List Instances

List specified properties of all instances:
`python3 -m awsome list id state.Name`

### Describe Instances

Describe instances matching given instance ids or tags:
`python3 -m awsome describe -t Node:server`

### Create Instances

Create instances as described in the `config.py` and run commands
`python3 -m awsome create`

#### Instance definitions

Instance definitions for `create` command can be configured in `config.py`

Instance definitions are described in `definition` section of each instance in `instances` dictionary.
All the instances defined here inherit from `inst_def_globals`, hence the common configuration shared
by all the instances can be defined here once.

`post_actions` are a list of command that will be executed after the instance is initialized and reachable over SSH.

```
inst_def_globals = {
    "ImageId": "ami-02724d1f",
    "InstanceType": "t2.micro",
    "KeyName": "ssh_acess",
    "SecurityGroupIds": ["sg-3a6d5858"],
    "Placement": {
        "AvailabilityZone": "eu-central-1a"
    }
}

instances = {
    "client_instance": {
        "definition": {
            "MinCount": 1,
            "MaxCount": 1,
            "TagSpecifications": [{
                "ResourceType": "instance",
                "Tags": [{
                    "Key": "Node",
                    "Value": "client"
                }]
            }]
        },
        "username": "admin",
        "keyfile": "~/.ssh/aws/ssh_acess.pem",
        "post_actions": [
            "apt-get update",
            "apt-get install vim"
        ]
    }
}
```
Note: A list of supported instance definition options can be found in [AWS documentation](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RunInstances.html).

### Start Instances

Start instances by instance ids
`python3 -m awsome start i-08bae47dadb036151 i-08baf47dabb031351`

### Stop Instances

Stop instances by instance ids
`python3 -m awsome stop i-08bae47dadb036151 i-08baf47dabb031351`

### Reboot Instances

Reboot instances by instance ids
`python3 -m awsome reboot i-08bae47dadb036151 i-08baf47dabb031351`

### Terminate Instances

Terminate instances by instance ids
`python3 -m awsome terminate i-08bae47dadb036151 i-08baf47dabb031351`

repository: shrir/awsome

repo_name: shrir/awsome


text:
# προσψαύω.

<!-- Status: S2=NeedsReview -->
<!-- Lexica used for edits: BDAG, FFM, LN, A-S -->

## Word data

* Strongs: G43790.

* Alternate spellings:

,

* Principle Parts:

* Part of speech:

[Verb](http://ugg.readthedocs.io/en/latest/verb.html).

* Instances in the New Testament: 1.

* All Scriptures cited: Yes

## Etymology:

* LXX/Hebrew glosses:

* Time Period/Ancient Authors:

* Related words:

* Antonyms for all senses

* Synonyms for all senses:

## Senses:

### Sense  1.0:

#### Definition:

to touch (lightly).  (In Luke 11:46, to touch in order to help)

#### Glosses:

to touch

#### Explanation:

#### Citations:

in poët. and late writers, to touch: c. dat., [Lk 11:46](Luk 11:46).†

repository: mandolyte/uw-obsidian

repo_name: mandolyte/uw-obsidian


text:
Add additional roles for API group helmrelease to Argo role

$ kubectl get role argo-role  -n argo -o yaml > argo_role.yaml

Add the API group helm.fluxcd.io
====
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  annotations:
  name: argo-role
  namespace: argo
  selfLink: /apis/rbac.authorization.k8s.io/v1/namespaces/argo/roles/argo-role
rules:
- apiGroups:
  - ""
  resources:
  - pods
  - pods/exec
  verbs:
  - create
  - get
  - list
  - watch
  - update
  - patch
  - delete
- apiGroups:
  - "helm.fluxcd.io"
  resources:
  - helmreleases
  verbs:
  - create
  - get
  - watch
  - list
  - update
  - delete
  - patch
- apiGroups:
  - ""
  resources:
  - configmaps
  verbs:
  - get
  - watch
  - list
- apiGroups:
  - ""
  resources:
  - persistentvolumeclaims
  verbs:
  - create
  - delete
- apiGroups:
  - argoproj.io
  resources:
  - workflows
  - workflows/finalizers
  verbs:
  - get
  - list
  - watch
  - update
  - patch
  - delete
  - create
- apiGroups:
  - argoproj.io
  resources:
  - workflowtemplates
  - workflowtemplates/finalizers
  verbs:
  - get
  - list
  - watch
- apiGroups:
  - ""
  resources:
  - serviceaccounts
  verbs:
  - get
  - list
- apiGroups:
  - ""
  resources:
  - secrets
  verbs:
  - get
- apiGroups:
  - argoproj.io
  resources:
  - cronworkflows
  - cronworkflows/finalizers
  verbs:
  - get
  - list
  - watch
  - update
  - patch
  - delete
- apiGroups:
  - ""
  resources:
  - events
  verbs:
  - create
  - patch
- apiGroups:
  - policy
  resources:
  - poddisruptionbudgets
  verbs:
  - create
  - get
  - delete
=====

kubectl apply -f  argo_role.yaml

repository: roshpr/argo-workflow-samples

repo_name: roshpr/argo-workflow-samples


text:
SUM DIGITS
==========
This functions likes to take in a non negative string. It uses that number, and adds up the digits of the word.
In order to run this function, type python3 main.py. In order to run fun tests, type python3 test.py.


text:
---
title: "\n\t\t\t\tThe Cost of Groceries\t\t"
date: 2012-06-02 20:50:00 Z
categories:
- jim
author<EMAIL_ADDRESS>comments: true
excerpt: "\n\t\t\t\t\t\t"
layout: post
link: https://jim.am/the-cost-of-groceries/
wordpress_id: 5270
---

[![](http://jim.am/images/2012/06/apples.png)](http://jim.am/the-cost-of-groceries/apples/)

I don’t know what’s going on lately, but the only reason our grocery bill has been so high must be that the dog  has grown thumbs and has long last figured out to open the fridge. That’s the only reasonable explanation we can think of.

There’s just the two of us here at the OK corral and but in the past two weeks we’ve burned through $460.00 on food. That’s a lot of money in our  world. B makes a good wage, and I try my best but holy smokes where does the food go?

Granted we picked up at the grocery store some gift cards for birthdays and baptisms and who knows what else. The conversation at the store usually goes something like this:

B: “We need to get xxx  a gift for xxx”.

Me. “ We do? Why?

B: Because we do. Life is expensive.

Me:  sigh.

And this brings me to my next rant : Half of what we bought at the grocery store **was not food**. Unless you count paper towels, batteries, shampoos and toothpaste as food. I think eventually it will all be one big store called **store **and there won’t be any need to go to individual stores anymore.

Also,  I’ve never seen us go through the toothpaste like we have lately.  Again, I blame the dog. Her teeth are looking mighty white lately. I know she sleeps on the couch while we’re away so  I don’t put the toothpaste thing past her as she’s pretty smart.

And why isn’t there an app for my phone called “**Where’s my Wife**?”.  I’ll be in the aisle and then I turn around and she is gone. One minute I’m looking for raisin bran and then  I spend twenty minutes roaming the aisles looking for her as she has disappeared and then I find her eight aisles over after. I just don’t understand, and I hate using my phone to call her and ask where she is…it just seems wrong. I’m a grown man in a grocery store. Surely I can keep tabs on my SO for more than five minutes.

repository: ramseeker/sidey

repo_name: ramseeker/sidey


text:
---
title: Expense Entry v1.1
layout: reference

redirect_from:
  - /api-reference-deprecated/version-one-one/expense-entry/expense-entry-resource.html
  - /api-reference-deprecated/version-one-one/expense-entry/get-expense-entry.html
  - /api-reference-deprecated/version-one-one/expense-entry/post-expense-entry.html
---

# Expense Entry v1.1

{% include deprecation-alert.html %}

An expense entry in an expense report.

**NOTE:** You can find version 3.0 [here](/api-reference/expense/expense-report/expense-entry.html)

## URI

```
https://www.concursolutions.com/api/expense/expensereport/v1.1/report/{reportId}/entry/{entryId}
```

## Get Expense Entry Details Request

Retrieves the details for the specified expense entry

### Supported Accept Types

application/xml

### Parameters

Query Parameter|Description
-----|------
`{_reportId_}`|**Reqired** The unique identifier for the expense report.
`{_entryId_}`|The unique identifier for the expense entry.

### Request Headers

* Authorization header with OAuth token for valid Concur user.

### XML Example Request

```shell
GET https://www.concursolutions.com/api/expense/expensereport/v1.1/report/nxxKgLlnROz3zHJBCRksaas23dsfs/entry/n7We3qWw99u1KoWTMaLhSC$pXBYzQ1UDhn HTTP/1.1
Authorization: OAuth {access token}
```

### Response

This request will return an **ExpenseEntry** parent element with the following child elements:

Element|Description
---|---
ApprovedAmount|The approved amount of the entry in the user's reimbursement currency. The Get Report Details function returns the report currency, which is the user's reimbursement currency, in the **CrnCode** element.
Attendee-Url|The URL to the attendees list for the entry.
Allocation-Url|The URL to the allocations list for the entry.
BusinessPurpose|The business purpose field from the report header.
EreceiptId|The ID for the attached e-receipt, if available.
ExchangeRate|The exchange rate that applies to the entry.
ExpenseKey|The expense type key for the entry. Use the Get Expense Group Configuration endpoint to get the full list of expense types.
ExpenseName|The expense type for the entry.
SpendCategory|The spend category specified for this expense type. Varies by client, used in reporting.
HasAllocation|Defines the amount of allocations for the expense. Possible values are: P, for partial allocation, F, for full allocation, or N, for no allocation.
HasAttendees|Whether the expense has attendees.
HasComments|Whether the expense has comments.
HasExceptions|Whether the expense has exceptions.
HasVat|Whether the expense has VAT data.
ImageRequired|Whether a receipt image is required for the entry.
IsCreditCardCharge|Whether the expense came from a credit card feed.
IsItemized|Whether the expense has itemizations.
Itemizations-Url|The URL to the itemization list.
IsPersonal|Whether the expense is personal.
IsPersonalCardCharge|Whether the expense came from a personal card feed.
LastModified|The UTC date when the entry was last modified.
LocationName|The location for the expense entry, usually the city name.
OrgUnit1 through OrgUnit6|The details from the Org Unit custom fields. These may not have data, depending on configuration.
PaymentTypeKey|The key for the payment type for the entry. Use the Get Expense Group Configuration function to map the payment type key to the payment type name.
PostedAmount|The amount of the expense entry in the user's reimbursement currency. The Get Report Details function returns the report currency, which is the user's reimbursement currency, in the **CrnCode** element.
ReceiptImageId|The ID for the receipt image attached to the entry.
ReceiptRequired|Whether the original receipt is required for the entry.
ReportEntryID|The ID of the report entry.
ReportID|The unique key of the report the entry is in.
TransactionAmount|The amount of the expense entry in the original transaction currency.
TransactionCurrencyName|The currency name of the expense entry transaction amount.
TransactionDate|The date of the expense entry.
VendorDescription|The vendor name of the expense entry, which can be entered manually by the user or imported from the card transaction Merchant Name field.
X_UserID|The user ID associated with the entry.
Custom1 through Custom40|The details from the Custom fields. These may not have data, depending on configuration. If the custom field is a list field, the data will be returned as: (list item short code) list item name.  Use the Post Expense Report Header function to create the report, then use this endpoint to create the expense line items. You can update existing expense entries using this endpoint.

**NOTE**: Posting new expense reports is a multi-stage process. Refer to the Processes section of the Expense Report Web Service page for the steps required to post new expense reports and entries.

**NOTE**: Concur recommends that you post one expense entry per request. Future versions of this endpoint will require this behavior.

### Supported Content Types

application/xml

### Parameters

Query Parameters - Required|Query Parameters - Optional
-----|------
`{_reportId_}/entry`|**Required** The unique identifier for the expense report and the entry keyword. Example: `https://www.concursolutions.com/api/expense/expensereport/v1.1/report/_{reportId}_/entry`.

URI Source: The reportId value is returned in the **ReportID** element by the Get List of Reports function, and as part of the **Report-Details-Url** element of the Post Expense Report Header function.
`{_entryId_}`|The unique identifier for the expense entry. Example: `https://www.concursolutions.com/api/expense/expensereport/v1.1/report/_{reportId}_/entry/{_entryId_}`.

URI Source: The entryId value is returned in the **RpeKey** element of the [Expense Report Full Details v1.1](/api-reference/expense/expense-report/v1dot1.report-full-details.html) function, and as part of the **Report-Entry-Details-Url** value returned by this function.

### Request Headers

* Authorization header with OAuth token for valid Concur user. The OAuth Consumer must have one of the following roles to post entries for reports that they do not own: Web Services Admin for Professional, or Can Administer for Standard.

### Payload

This request should contain a **ReportEntries** parent element with an **Expense** parent element for each included entry. The **Expense** element contains the following child elements:

Element|Required (must contain value)?|Description
---|---|---
CrnCode|Y|The 3-letter ISO 4217 currency code for the expense transaction amount. Example: USD.
ExpKey|Y|The expense type key for the expense. Required for new or updated entries. Expense Type Keys are returned in the **ExpKey** element by the Get Expense Group Configuration function. The expense type key cannot be modified when updating expense entries.
Description|Depends on configuration|The description for the expense, also known as business purpose. This information is returned in the **BusinessPurpose** element by the Get Report Details function. Refer to the Processes > **Post Expense Report Data** section of Expense Report for the steps necessary to gather required field information.
TransactionDate|Y, for new entries|The date the expense was incurred. Format: YYYY-MM-DD
TransactionAmount|Y|The total amount of the expense in the original currency, with up to three decimal places. Example: 123.654
LocationID|Depends on configuration|The Location code. May be required, if the City field is required. Use the Get Location function to retreive the valid values for this field. Refer to the Processes > **Post Expense Report Data** section of Expense Report for the steps necessary to gather required field information.
OrgUnit1 through OrgUnit6|Depends on configuration|The Expense Entry Form org unit fields. May be required depending on configuration. Refer to the Processes > **Post Expense Report Data** section of Expense Report for the steps necessary to gather required field information.
Custom1 through Custom40|Depends on configuration|The Expense Entry Form custom fields. May be required depending on configuration. Refer to the Processes > **Post Expense Report Data** section of Expense Report for the steps necessary to gather required field information. **NOTE**: If any of the custom fields are configured to contain list values, please refer to the Posting Custom List Items page for information on how to correctly submit list item values.
ExchangeRate|N|The exchange rate between the transaction and posted amounts. This element is typically not provided. If this element is empty for transactions in a currency different than the user's reimbursement currency, Expense will use the company's configured exchange rates to determine the posted amount for the transaction. If the system is not able to determine the exchange rate, the request will return an HTTP 500 error.
Comment|Depends on configuration|The expense entry comment. Max length: 2000\. Refer to the Processes > **Post Expense Report Data** section of Expense Report for the steps necessary to gather required field information.
VendorDescription|N, but recommended for sandbox|This element contains the descriptive text for the vendor for the entry. This field is not required to successfully post an entry, however the field is a required field for expense entries in the developer sandbox. If this field is not provided for the sandbox, you will see an exception in the user interface stating that a required field is missing.
IsPersonal|N|Whether the expense entry is a personal expense. Personal expenses are not reimbursed in Concur Expense. Format: Y/N
PaymentTypeID|N|The unique identifier for the payment type for the expense entry. Use the **PaymentTypeID** value from the Get Expense Group Configuration endpoint. If you do not provide this value, the payment type defaults to Cash. The supported Payment Type Codes are: Cash and Company Paid.  The Pending Card Transaction system payment type is also supported, if the client has configured their company to use it.

**NOTES**

* The minimum fields required for new expense entries are: **CrnCode**, **ExpKey**, **TransactionDate**, and **TransactionAmount**. The required fields that depend on configuration will not prevent an expense entry from being saved. If you create an entry with only the minimum fields, any additional configured required fields will cause the expense entry to have an exception in the user interface. The user will have to fill in the required fields before he/she can save any updates to the entry.
* The update request must include the **ExpKey** and **TransactionAmount** fields. All other fields only need to be included if they were updated.
* Update requests cannot change the **ExpKey** for an existing entry.

### XML Example Request

```shell
POST https://www.concursolutions.com/api/expense/expensereport/v1.1/report/nxxKgLlnROz$sQ6SKJFjLNs4OWBErcJ8yX/entry/ HTTP/1.1
Authorization: OAuth {access token}
Content-Type: application/xml
```

```xml
<ReportEntries xmlns="http://www.concursolutions.com/api/expense/expensereport/2011/03">
  <Expense>
    <CrnCode>USD</CrnCode>
    <ExpKey>BUSPR</ExpKey>
    <Description>Business Promotions</Description>
    <TransactionDate>2011-01-12</TransactionDate>
    <TransactionAmount>29.23</TransactionAmount>
    <Comment>Brochure sample</Comment>
    <VendorDescription>Kinkos</VendorDescription>
    <IsPersonal>N</IsPersonal>
  </Expense>
  <Expense>
    <CrnCode>USD</CrnCode>
    <ExpKey>BRKFT</ExpKey>
    <Description>Description</Description>
    <TransactionDate>2011-01-12</TransactionDate>
    <TransactionAmount>15.54</TransactionAmount>
    <Comment>Breakfast meeting</Comment>
    <VendorDescription>Starbucks</VendorDescription>
    <IsPersonal>N</IsPersonal>
  </Expense>
</ReportEntries>
```

### Response

#### Supported Content Types

application/xml

#### Payload

This request will return a **ReportEntryStatusList** parent element with the **ReportEntryStatus** child element for each posted entry. The **ReportEntryStatus** element will contain the following child elements:

Element|Description
---|---
Index|The entry's sequence in the request.
Status|The status of the request.
Message|When the status is FAILED, the details of the failure appear in this element.
Report-Entry-Details-Url|The URI to get the expense entry details.

#### XML Example of Successful Response

```shell
HTTP/1.1 200 OK
Content-Type: application/xml
```

```xml
<ReportEntryStatusList xmlns="http://www.concursolutions.com/api/expense/expensereport/2011/03" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <ReportEntryStatus>
    <Index>1</Index>
    <Status>SUCCESS</Status>
    <Report-Entry-Details-Url>https://www.concursolutions.com/api/expense/expensereport/v1.1/report/nxxKgLlnROz$sQ6SKJFjLNs4OWBErcJ8yX/entry/nE0avYnILN9mHdTErNSd2pH45udFoNQ$po</Report-Entry-Details-Url>
  </ReportEntryStatus>
  <ReportEntryStatus>
    <Index>2</Index>
    <Status>SUCCESS</Status>
    <Report-Entry-Details-Url>https://www.concursolutions.com/api/expense/expensereport/v1.1/report/nxxKgLlnROz$sQ6SKJFjLNs4OWBErcJ8yX/entry/awEDvYnILN9g$s6lCFX0jFBWmHAiTYYf9C</Report-Entry-Details-Url>
  </ReportEntryStatus>
</ReportEntryStatusList>
```

branch_name: refs/heads/preview


text:
# Win32 AppService Client

This sample demostrates a Windows Presentation Foundation (WPF) app calling a
universal app service. App services are a new feature of universal Windows 10
apps that allow an app to provide services to other apps. These services can
be accessed by other apps as well as Win32 apps such as WPF or WinForms apps.

This sample demonstrates how a WPF app can call into an app service. To run
the sample you will need Visual Studio 2015 and the Windows SDK. Both of these
can be found at <http://developer.windows.com>.

With Visual Studio, open the solution Win32AppServiceClient.sln. There are three
projects in this solution:
* **RandomNumberService** - This project is a Windows Runtime component. It contains
the code for the background task that implements the app service we use for the
sample. RandomNumberGeneratorTask.cs contains the background task class. The
background tasks' main entrypoint is the Run method. In this method, the
RandomNumberGeneratorTask sets itself up with a deferral so it can stay running
and provide the app service. It also uses the incoming AppServiceTriggerDetails
to attach an event handler to the AppServiceTriggerDetails.RequestReceived event.
This enables the RandomNumberGeneratprTask to respond to requests from the app
service client. The OnRequestReceived handler simply parses the input for minimum
and maximum integer values. It then generates a random number between those values
and returns it.

* **AppServicesProvider** - AppServicesProvider is the universal Windows app that
contains RandomNumberService. The AppServicesProvider project contains a reference to
**RandomNumberService**. The Package.appxmanifest file in AppServicesProvider also
contains a windows.appService extension. This is how the AppServicesProvider app
exposes the RandomNumberService to other apps. In the Package.appxmanifest's uap:Extension
element the EntryPoint attribute represents the type name of the background
task providing the app service. The Name attribute in the uap:AppService element
represents the name of the app service.

* **Win32AppServiceClient** - The Win32AppServicesClient is a WPF application. The
project file of this WPF application (Win32AppServiceClient.csproj) has been modified
to include references to the universal Windows 10 APIs. This enables us to use the
Windows.ApplicationModel.AppService.AppServiceConnection class that lets an app
connect to an app service. The MainWindow.xaml page of Win32AppServiceClient does
exactly that. It presents the user the option to provide minimum and maximum integer
values. The Click handler of the *Generate Random Number* button then calls the
random number service exposed by AppServicesProvider with these values. The result
is then displayed on screen.

Feel free to submit pull requests on this README.md or the code if you think it could
use improvement. Happy hacking!

[@aruntalkstech](https://twitter.com/aruntalkstech)

repository: nielsabels/SampleCode

repo_name: nielsabels/SampleCode


text:
# Vislib general overview

`vis.js` constructor accepts vis parameters and render method accepts data. it exposes event emitter interface so we can listen to certain events like 'renderComplete'.

`vis.render` will create 'lib/vis_config' to handle configuration (applying defaults etc) and then create 'lib/handler' which will take the work over.

`vis/handler` will init all parts of the chart (based on visualization type) and call render method on each of the building blocks.

## Visualizations

Each base vis type (`lib/types`) can have a different layout defined (`lib/layout`) and different building blocks (pie charts dont have axes for example)

All base visualizations extend from `visualizations/_chart`

### Pie chart

### Map

### Point series chart

`visualizations/point_series` takes care of drawing the point series chart (no axes or titles, just the chart itself). It creates all the series defined and calls render method on them.

currently there are 3 series types available (line, area, bars), they all extend from `visualizations/point_series/_point_series`.


text:
# SUMMARY
Tescrape uses Tesseract OCR to scrape websites for useful data. It will
determine rows and columns based off of X,Y location and a set of starting data
for the beginning of rows.

# REQUIREMENTS
All the gems in sel.rb and tesseract-ocr (tested with v4.0.0).

repository: bill-rich/tescrape

repo_name: bill-rich/tescrape


text:
# Bidirectional conversion between JSON(-LD) and iRODS AVUs

## Introduction

This is a companion repository to the [irods_avu_json](https://github.com/MaastrichtUniversity/irods_avu_json) Python
module. Please read the README of that repository for an introduction on the goal of these repositories.

This repository contains the iRODS rules, policies and microservices to make the conversion code operational in iRODS.

### Docker
A description of a docker contain running this ruleset, its microservices and python dependencies exists in the
[irods_avu_json-docker](https://github.com/MaastrichtUniversity/irods_avu_json-docker) repository. You can use this
to quickly try out this ruleset.

## Requirements
The following are required to run.

* iRODS > 4.2.x (For Python rule engine)
* The iRODS Python rule engine
* Python dependencies (see requirements.txt)

## Installation

### Microservices

iRODS 4.2.x is missing the microservices to modify the unit field of an AVU triple. Please vote for
[this iRODS issue](https://github.com/irods/irods/issues/4185) to  get this fixed.

To get around this, a set of custom iRODS microservices have to be installed. These have been included in this repository.

Build requirements:
* irods-dev
* irods-externals-clang-runtime3.8-0
* irods-externals-clang3.8-0
* cmake

Build instructions:
```bash
mkdir build
cd build
cmake ../
make
```

Install instructions
```bash
make install
```

### Rules and Policies

First make sure that the Python package [irods_avu_json](https://github.com/MaastrichtUniversity/irods_avu_json) and
other requirements have been installed globally in order for the iRODS Python rule engine to pick it up.

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

Finally, copy the rule file `rules/core.py` to `/etc/irods/core.py`.

## Usage

### Rules

#### setJsonToObj(*object, *objectType, *jsonNs, *json)

#### getJsonFromObj(*object, *objectType, *jsonNs)

#### setJsonSchemaToObj(*object, *objectType, *jsonSchema, *jsonNs)

#### getJsonSchemaFromObj(*object, *objectType, *jsonNs)

### Policies

Whenever an iRODS object (file, collection, resource, user) has an AVU called `$id` set, the value of the AVU determines
the JSON-schema controlling the object and the unit field determines the JSON-namespace used by the JSON-AVU conversion.

The policies then implements:

* Direct modification of AVU under control of the JSON-schema set by `$id` AVU is not allowed.
* Modification of those AVUs is only allowed using setJsonToObj()

Modifications of other AVUs on an iRODS object are not affected by the policies.

## Tests

Each microservice and rule function comes with a little test rule file that can be executed with `irule`.

A more complete test script of the policies is available in `tests/pep_tests.sh`.

## Authors
Paul van Schayck (p.vanschayck@maastrichtuniversity.nl), Ton Smeele, Daniel Theunissen and Lazlo Westerhof

## Copyright and license

(c) Maastricht University

Apache License 2.0

gha_language: Python