text:
---
layout: post
title: "Monitoring the SRE Four Golden Signals"
date: 2023-08-01
categories: sre devops
tags: sre devops monitoring observability
image:
    path: /assets/images/prometheus-grafana.webp
mermaid: true
---

In the world of Site Reliability Engineering (SRE), monitoring plays a crucial role in maintaining the reliability and availability of systems. Google's SRE team introduced the concept of "Four Golden Signals" to effectively monitor and assess the health of services. These signals are essential metrics that provide valuable insights into the system's performance and help SREs in identifying and resolving issues proactively. In this blog post, we'll delve into the details of the SRE 4 Golden Signals, their significance, and how to monitor them effectively.

## What are the SRE 4 Golden Signals?

The SRE 4 Golden Signals consist of four key metrics that provide a well-rounded view of service health. These signals are:

### 1. Latency

This metric measures the time taken for a request to be processed from start to finish. It indicates how responsive the service is to incoming requests. Latency can be critical for user satisfaction and is typically measured in milliseconds.

### 2. Errors

The error rate represents the proportion of requests that result in errors or failures. Monitoring this signal helps in identifying potential issues affecting the service and highlights areas that require improvement.

### 3. Traffic

This signal refers to the volume of requests or the amount of traffic that the service is handling. It gives an understanding of the load on the system and can help in capacity planning and resource allocation.

### 4. Saturation

Saturation indicates the utilization level of critical system resources, such as CPU, memory, or network bandwidth. High saturation levels can lead to performance degradation and service instability.

## Importance of Monitoring the Golden Signals

Monitoring the SRE 4 Golden Signals is crucial for the following reasons:

### Early Detection of Issues

By monitoring latency and error rates, SREs can quickly detect and address potential problems before they escalate. Proactive identification of anomalies helps in maintaining a high level of service reliability.

### Performance Optimization

Analyzing traffic patterns and resource saturation allows SREs to optimize the system's performance. Understanding the load and resource usage helps in fine-tuning the infrastructure to handle varying levels of demand efficiently.

### Service-Level Objectives (SLOs) Compliance

SREs often define SLOs, which are specific targets for service performance. Monitoring the golden signals ensures that the service meets its SLOs, and if not, it aids in diagnosing the reasons and taking corrective measures.

### Incident Response and Troubleshooting

During incidents or outages, the golden signals act as valuable diagnostic tools. They provide essential data to understand the root cause of the problem and help in identifying the scope and impact of the issue.

## Latency Monitoring Strategies

![image](/assets/images/grafana-latency-graph.webp)

### Request Tracing

Implement distributed tracing to trace the journey of a request through various components of the system. This provides insights into the time spent at each step, helping identify bottlenecks.

### Percentile Latency

While average latency can give a general idea of the system's performance, it does not represent the complete picture. The distribution of latency values can vary widely, and certain requests may experience much higher latency than others. Percentile latency is a more robust approach to understanding the system's responsiveness.

### P50 (Median) Latency

The P50 (or median) latency represents the value below which 50% of the requests fall. In other words, it indicates the typical or median latency experienced by users. Monitoring P50 latency helps identify the majority of users' experiences and provides a baseline for comparison against Service Level Indicators (SLIs).

### P90 (90th Percentile) Latency

The P90 latency represents the value below which 90% of the requests fall. This metric gives insight into the performance experienced by most users, but it also considers the impact of a small fraction of requests that experience higher latency.

### P99 (99th Percentile) Latency

The P99 latency represents the value below which 99% of the requests fall. It focuses on the tail end of the distribution, capturing the latency experienced by the vast majority of users while considering the outliers. This metric is particularly important because even though a small percentage of requests may experience significantly higher latency, it can still affect user experience and satisfaction.

### SLIs (Service Level Indicators)

Define SLIs based on latency thresholds, such as "95% of requests should be served within 200ms." Monitor these SLIs and trigger alerts if they breach the defined thresholds.

## Error Monitoring Strategies

![image](/assets/images/grafana-availability-graph.webp)

### Error Rate Calculation

Track the number of requests resulting in errors and calculate the error rate as a percentage of total requests. Monitor this rate over time to detect spikes or unusual patterns.

### Error Budgets

Set error budgets (acceptable level of errors) based on SLOs. Monitor error rates against these budgets to ensure that the service remains within acceptable limits.

### Error Alerts

Configure alerts to notify SREs when error rates exceed predefined thresholds. This allows for timely intervention in case of issues.

## Traffic Monitoring Strategies

![image](/assets/images/grafana-traffic-graph.webp)

### Request Counting

Count incoming requests over specific intervals (e.g., requests per second). This provides an overview of the service's workload.

### Load Balancer Metrics

If applicable, monitor load balancer metrics to understand how traffic is distributed across instances or regions.

### Seasonality Analysis

Analyze historical traffic data to identify patterns, trends, and seasonality. This helps in capacity planning and handling anticipated spikes in traffic.

## Saturation Monitoring Strategies

![image](/assets/images/grafana-cpu-saturation-graph.webp)
![image](/assets/images/grafana-memory-saturation-graph.webp)

### Resource Utilization Metrics

Collect and monitor key resource utilization metrics like CPU usage, memory usage, disk I/O, and network bandwidth.

### Queue Lengths

If applicable, track queue lengths for critical components. Long queues may indicate resource saturation and potential performance issues.

### Autoscaling

Implement autoscaling based on resource utilization metrics. Autoscaling ensures that resources are dynamically adjusted to meet varying demands.

## Visualization and Alerting

Visualization and alerting are two of the most essential and fundamental aspects that play a paramount role in successfully monitoring and maintaining the SRE 4 Golden Signals, as they not only provide a comprehensive and easily digestible visual representation of the critical metrics encompassing latency, errors, traffic, and saturation, but they also ensure timely and proactive detection of any deviations or anomalies from predefined thresholds, empowering Site Reliability Engineering (SRE) teams to swiftly respond to potential incidents, make data-driven decisions, and implement necessary optimizations, ultimately safeguarding the overall reliability, availability, and performance of the services in question.

### Visualization

Create intuitive dashboards and graphs to visualize the golden signals. Tools like Grafana, Kibana, or Datadog can be used to create real-time visualizations that enable SREs to quickly grasp the system's health.

### Alerting

Configure alerting rules based on the thresholds defined for each golden signal. Alerts should be timely, actionable, and sent to the relevant personnel through channels like email, Slack, or PagerDuty.

## Conclusion

Monitoring the SRE 4 Golden Signals is fundamental to building and maintaining highly available, reliable, and performant services. By closely tracking latency, errors, traffic, and saturation, SREs can ensure that systems meet their performance goals and deliver a seamless user experience. Effective monitoring enables early detection of issues, optimized performance, and efficient incident response – all contributing to a robust and reliable service.


text:
# Scalate support for SBT 0.1x.x

Integration for SBT that lets you generate sources for your Scalate templates and precompile them as part of the normal compilation process. This plugin is published to scala-tools.org.

## Usage

Include the plugin in `project/plugins.sbt`:

```scala
libraryDependencies <+= sbtVersion(v => "com.mojolly.scalate" %% "xsbt-scalate-generator" % (v + "-0.1.5"))
```

Configure the plugin in `build.sbt`:

```scala
// import must be at top of build.sbt, or SBT will complain
import com.mojolly.scalate.ScalatePlugin._

seq(scalateSettings:_*)

scalateTemplateDirectory in Compile <<= (baseDirectory) { _ / "src/main/webapp/WEB-INF" }

scalateImports ++= Seq(
  "import foo._",
  "import bar._"
)

scalateBindings += Binding("flash", "org.scalatra.FlashMap")
```

## Patches

Patches are gladly accepted from their original author. Along with any patches, please state that the patch is your original work and that you license the work to the *xsbt-scalate-generate* project under the MIT License.

## License

MIT licensed. Check the [LICENSE](https://raw.github.com/mojolly/xsbt-scalate-generate/master/LICENSE) file.

license: MIT

repository: jlarmstrong/xsbt-scalate-generate

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: jlarmstrong/xsbt-scalate-generate


text:
# Working With Models With Dynamic Shapes In TensorRT

## Introduction

In order to use dynamic input shapes with TensorRT, we have to specify a range
(or multiple ranges) of possible shapes when we build the engine.
For details on how this works, refer to
[API example 07](../../../api/07_tensorrt_and_dynamic_shapes/).

When using the CLI, we can specify the per-input minimum, optimum, and maximum
shapes one or more times. If shapes are specified more than
once per input, multiple optimization profiles are created.

## Running The Example

1. Build an engine with 3 separate profiles:

    ```bash
    polygraphy convert dynamic_identity.onnx -o dynamic_identity.engine \
        --trt-min-shapes X:[1,3,28,28] --trt-opt-shapes X:[1,3,28,28] --trt-max-shapes X:[1,3,28,28] \
        --trt-min-shapes X:[1,3,28,28] --trt-opt-shapes X:[4,3,28,28] --trt-max-shapes X:[32,3,28,28] \
        --trt-min-shapes X:[128,3,28,28] --trt-opt-shapes X:[128,3,28,28] --trt-max-shapes X:[128,3,28,28]
    ```

    For models with multiple inputs, simply provide multiple arguments to each `--trt-*-shapes` parameter.
    For example: `--trt-min-shapes input0:[10,10] input1:[10,10] input2:[10,10] ...`

    *TIP: If we want to use only a single profile where min == opt == max, we can leverage the runtime input*
        *shapes option: `--input-shapes` as a conveneint shorthand instead of setting min/opt/max separately.*

2. **[Optional]** Inspect the resulting engine:

    ```bash
    polygraphy inspect model dynamic_identity.engine
    ```

## Further Reading

For more information on using dynamic shapes with TensorRT, see the
[developer guide](https://docs.nvidia.com/deeplearning/tensorrt/developer-guide/index.html#work_dynamic_shapes)

repository: NVIDIA/TensorRT

repo_name: NVIDIA/TensorRT


text:
# Cookie Engineer's Talks

I created this Repository just for the sake of easyness.

I'm lazy and I kind of hated "wasted" Repositories, so
this is kind of the new collection of talks that I do
from time to time.

Slides are written in a subset of CommonMark, so the
`./bin/generate.sh` part requires node.js installed to
function properly. The `./bin/serve.sh` just calls the
generator and then serves stuff via python's http.server
or (if on old Macbook) via SimpleHTTPServer.

# Contents

[ANN Guide](./book/00-Introduction.md)

- hold on FrankfurtJS July 2016
- hold on Machine Learning Meetup Rhein-Neckar July 2016
- [Video on Youtube](https://www.youtube.com/watch?v=ksVlFfrrhtg)

[Evolutionary AI](./book/01-Evolutionary-AI.md)

- hold on FFM Analytics November 2016
- hold on KarlsruheJS April 2017
- Demo is available at [rawgit.com/.../demo/flappy-plane/index.html](https://rawgit.com/cookiengineer/talks/master/demo/flappy-plane/index.html)
- Demo is in folder [flappy-plane](./flappy-plane)
- [(Low Quality) Video on Periscope](https://www.periscope.tv/w/1ypJdAwQlXrxW)

[lychee.js Architecture](./book/02-lycheejs-Architecture.md)

- hold on FrankfurtJS December 2015
- No Video :(

Reinforcement AI

- not yet held
- Demo is available at [rawgit.com/.../demo/pong/index.html](https://rawgit.com/cookiengineer/talks/master/demo/pong/index.html)
- Demo is in folder [pong](./pong)

[AI Crash Course Part 1](./book/04-AI-Crash-Course.md)

- hold on Heidelberg AI Meetup August 2017

[AI Crash Course Part 2](./book/04-AI-Crash-Course2.md)

- hold on Heidelberg AI Meetup August 2017
- Live-Coding Talk, so highly experimental
- Demo is in folder [pong-evolution](./pong-evolution)

## Live Demo

NEAT Reinforcement AI

- not yet held
- Demo is in folder [pong-neat](./pong-neat)

## License

CC4-BY-SA

repository: superkley/dl-playground

repo_name: superkley/dl-playground


text:
# BranaganScheduler
8 Hour Day planner
------

This app is for the user to input their schedule and help them plan their day, as the day progresses the current hour displays as red, past hour is grey, and future hour is green, to keep the user on track.

-------
https://katers0259.github.io/BranaganScheduler/
------
![calendar2](https://user-images.githubusercontent.com/69743567/96212052-17ae9c00-0f33-11eb-9108-df72c11c549e.PNG)
![calendar 3](https://user-images.githubusercontent.com/69743567/96212054-17ae9c00-0f33-11eb-8662-d6e4b2aa7aef.PNG)
------
MIT License

Copyright (c) 2020 Kaitlyn Branagan

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

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

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

branch_name: refs/heads/main


text:
# Gatsby testing with Puppeteer

This is an example of how to test Gatsby sites with Puppeteer.

## Setup

Clone this repository and run `yarn install` to install its dependencies.

As an alternative, you can build the site with Docker by running `yarn build:docker`.

## Starting

Run `yarn develop` and then go to `http://localhost:8000` in a web browser.

As an alternative, you can run the site with Docker by running `yarn develop:docker`.

## Testing

To run tests locally, run `yarn test`.

The tests also run automatically as part of the  `yarn build:docker` command.

repository: timothymcmackin/gatsby-puppeteer-tests

repo_name: timothymcmackin/gatsby-puppeteer-tests


text:
# OPAQUE in Go

[![GoDoc](https://godoc.org/github.com/frekui/opaque?status.png)](https://godoc.org/github.com/frekui/opaque)
[![Build Status](https://travis-ci.com/frekui/opaque.svg?branch=master)](https://travis-ci.com/frekui/opaque)

This repo contains a Go implementation of OPAQUE, a password authenticated key
exchange protocol described in [1] and [2].

**Important note**: This code has been written for educational purposes only. No
experts in cryptography or IT security have reviewed it. Do not use it for
anything important.

## Installation

`go get -u github.com/frekui/opaque`

## Documentation

https://godoc.org/github.com/frekui/opaque

## Testing

`./run-tests.sh`

## Examples

The repo contains a sample [client](cmd/client/main.go) and
[server](cmd/server/main.go) that authenticates each other using package opaque.

## License

Copyright (c) 2018 Fredrik Kuivinen<EMAIL_ADDRESS>Use of this source code
is governed by the BSD-style license that can be found in the [LICENSE](LICENSE)
file.

## References

[1] https://tools.ietf.org/html/draft-krawczyk-cfrg-opaque-00

[2] Jarecki, S., Krawczyk, H., and J. Xu, "OPAQUE: An Asymmetric PAKE Protocol
Secure Against Pre-Computation Attacks", Eurocrypt , 2018. (Full version
available at https://eprint.iacr.org/2018/163)

repository: nangongyiling/opaque

repo_name: nangongyiling/opaque


text:
# LVMd

[![Docker Repository on Quay](https://quay.io/repository/picoprod/lvmd/status "Docker Repository on Quay")](https://quay.io/repository/picoprod/lvmd)

**This is not an official Google product**

LVMd provides GRPC-based access to LVM management.

repository: bluedatainc/lvmd

gha_language: Go

repo_name: bluedatainc/lvmd


text:
# TESS Backdrop

Check out the [documentation](https://ssdatalab.github.io/tess-backdrop/).

`tess-backdrop` is a tool to 1) create a background correction for TESS images 2) apply a background correction to any block of TESS data.

# What does `tess-backdrop` make?

`tess-backdrop` makes sets of *fits* files for every TESS sector, camera and CCD. These fits files are quite small (10s of Mb) and contain all the information needed to create a scattered light background correction for any pixel, at any time. Below is an example of the sorts of corrections `tess_backdrop` makes.

![](example1.png)

Each of the background estimates is fast to evaluate for any given TESS FFI dataset. This means you can apply the scattered light correction really quickly, without having to download anything else from MAST.

# How do you install `tess-backdrop`?

You can install with pip using

`pip install tess-backdrop`

# How do you use `tess-backdrop`?

There are tutorials available on our [documentation](https://ssdatalab.github.io/tess-backdrop/) pages. Here are some really simple examples. You can obtain a TESSCut TPF using `lightkurve`

```python
import lightkurve as lk
tpf = lk.search_tesscut('TIC 441075486', sector=2).download(cutout_size=(20, 21), quality_bitmask=None)
```

You can then correct the background in the TPF using

```python
import tess_backdrop as tbd

b = tbd.BackDrop()
b.load(sector=2, camera=1, ccd=3)
corrected_tpf = b.correct_tpf(tpf)
```

Or you could create a corrected light curve using

```python
r = tbd.TESSCutCorrector(tpf, aperture_mask=tpf.create_threshold_mask())
corrected_lc = r.correct(npca_components=10, spline_timescale=1)
```

repository: jorgemarpa/tess-backdrop

repo_name: jorgemarpa/tess-backdrop


text:
# Instructions

![pinout](http://arduinoelettronica.files.wordpress.com/2012/02/attiny85_pinout.png)

Make these connections:

* VCC -> 3.3V (can be in parallel with the ESP)
* GND -> GND
* PCINT3 -> one side of the reed switch
* Other side of the reed switch -> ground
* PC0 -> connect to ESP Reset pin with a 10-100 K resistor in series between them

The internal pullup resistor is switched on for the input pin, so when the
reed switch is open the input pin will be high. Very little current will
flow because of the pullup resistor. This helps alleviate false triggers.
When the switch closes it will pull the pin to ground and trigger the interrupt
and wake the ATTiny with a 30 low pulse.

The ATTiny will normally hold the reset pin of the ESP high because that's
normal operations. The resistor between PC0 and reset is to limit the
current flow.

The makefile is designed for Linux, you're on your own for others. To build,
make sure you have avr-gcc and avrdude installed and in your PATH. Run
`make` to build the code.

Make sure to flash the ATTiny BEFORE permanently fixing it into your circuit
or it'll be a headache.

To flash, first grab an Arduino like an Uno or Nano. Flash the ArduinoISP
sketch as on https://www.arduino.cc/en/Tutorial/ArduinoISP but stop at
step 4. Instead, wire up the correct connections to the ATTiny (MISO on the
Arduino to MISO on the ATTiny and so on). Set the variable in the Makefile
to match the serial port of your Arduino and then do `make flash`.


text:
## About

The JBehave JUnit Reporter is an addon to [JBehave](http://jbehave.org) 2 that provides fine-grained visualisation and reporting around the progress of your stories. Each JBehave step is tracked and reported on as an individual test case.

If you're running a story as a JUnit test through your favorite IDE, you'll be able to get output like this:

You can gain this capability by simply dropping the jbehave-junit-reporter JAR file in your classpath, and then telling the reporter what you'd like to report on using the @ReportOn annotation. Visit the [downloads](https://github.com/BrandonJohnGrenier/jbehave-junit-reporter-2/downloads) page to grab a copy of the library.

## What You Need

#### JUnit 4.4 or Later
The JBehave JUnit Reporter depends on JUnit 4.4 or later, and is not compatible with earlier versions of JUnit.

#### JBehave 2
The JBehave JUnit Reporter depends the 2.x series of JBehave (2.0.0 to 2.5.9), and is not compatible with JBehave 3.0.0 or above. Please visit [JBehave JUnit Reporter 3](https://github.com/BrandonJohnGrenier/jbehave-junit-reporter-3) homepage if you're looking for support for JBehave 3.0.0 or above.

## How it Works

The reporter will visually mark failing steps, and also provides a count of the number of steps and stories that are failing.

The reporter will visually mark pending steps, and also provides a count of the number of steps that are pending. These are reported as 'ignored' in JUnit.

## A Walkthrough
To show you how to use the JBehave JUnit Reporter, we'll go through a complete example

First, we'll create a plain text file named **staff_member_logs_in** with the following content:

	Story: As a staff member, I want to login so that I can get my work done.

	Scenario: A staff member provides a valid username and password

	Given a staff member is on the Login page
	When the staff member enters a username Administrator and password Password
	And the staff member clicks on the Login button
	Then the staff member should be redirected to the Home page

	Scenario: A staff member provides an invalid username

	Given a staff member is on the Login page
	When the staff member enters a username Rubbish and password Password
	And the staff member clicks on the Login button
	Then the staff member should be redirected to the Login page
	And the staff member is presented with a login message: Invalid username or password, try again

Next, we'll create a Java class named **LoginSteps.java** which will map our text descriptions to Java methods. Note the use of the @Given, @When and @Then annotations, and how they map to the steps above. For readability purposes we've just mapped a few text descriptions.

Also take note of the Assert.assertTrue(true) calls within each method. This is where your standard JUnit assert-y calls would typically go in actual tests.

	import junit.framework.Assert;

	import org.jbehave.scenario.annotations.Given;
	import org.jbehave.scenario.annotations.Then;
	import org.jbehave.scenario.annotations.When;
	import org.jbehave.scenario.steps.Steps;

	public class LoginSteps extends Steps {

		@Given("a staff member is on the Login page")
		public void onTheLoginPage() {
			Assert.assertTrue(true);
		}

		@When("the staff member enters a username $username and password $password")
		public void enterCredentials(String username, String password) {
			Assert.assertTrue(true);
		}

		@Then("the staff member should be redirected to the Home page")
		public void shouldBeRedirectedToTheHomePage() {
			Assert.assertTrue(true);
		}

	}

To wrap things up, create a class named **StaffMemberLogsIn.java**, and place it in the same directory as our text file.

    import org.jbehave.scenario.JUnitScenario;
	import org.jbehave.scenario.reporters.ScenarioReporter;
	import org.junit.runner.RunWith;

	import com.moralesce.jbehave.JUnitScenarioRunner;
	import com.moralesce.jbehave.DefaultStoryConfiguration;
	import com.moralesce.jbehave.annotations.ReportOn;
	import com.moralesce.jbehave.examples.steps.LoginSteps;

	@RunWith(JUnitScenarioRunner.class)
	@ReportOn(LoginSteps.class)
	public class StaffMemberLogsIn extends JUnitScenario {

		public StaffMemberLogsIn(ScenarioReporter reporter) {
			super(new SimplePropertyBasedConfiguration(reporter), new LoginSteps());
		}

	}

That's it! You should be able to report on your first JBehave test. A few points to note here:

1. We're configuring JUnit to @RunWith our JUnitScenarioRunner.
2. As we've touched on before, we want to @ReportOn the steps we defined in our LoginSteps class.
3. Our class extends JUnitScenario - every JBehave test must extend JUnitScenario.
4. You should be able to run this test as a JUnit test, and get output similar to the screenshots presented above.

We are using a PropertyBasedConfiguration instance named SimplePropertyBasedConfiguration instance. Custom JBehave configuration is a bit beyond our scope, however it is important to note that if you do want to use a different PropertyBasedConfiguration implementation you can. You'll just need to setup the @UseConfiguration annotation, shown in the example below:

	import org.jbehave.scenario.JUnitScenario;
	import org.jbehave.scenario.reporters.ScenarioReporter;
	import org.junit.runner.RunWith;

	import com.moralesce.jbehave.JUnitScenarioRunner;
	import com.moralesce.jbehave.annotations.ReportOn;
	import com.moralesce.jbehave.annotations.UseConfiguration;
	import com.moralesce.jbehave.examples.steps.LoginSteps;

	@RunWith(JUnitScenarioRunner.class)
	@ReportOn(LoginSteps.class)
	@UseConfiguration(MyCustomPropertyConfiguration.class)
	public class StaffMemberLogsIn extends JUnitScenario {

		public StaffMemberLogsIn(ScenarioReporter reporter) {
			super(new MyCustomPropertyConfiguration(reporter), new LoginSteps());
		}

	}

## Liscence

The JBehave JUnit Reporter is licensed under Apache 2.0.


text:
---
name: Update info for an existing Textpattern plugin
about: Use this form to update information for an existing Textpattern plugin within the plugins website.
title: "[UPDATE] xxxxx"
labels: plugin-add
---

**Name of plugin (including author prefix)**

xxx_xxxxx

**Requested changes**

Stable or beta?

- [ ] Stable
- [ ] Beta

Version:

{semver}

Release date:

{yyyy}-{mm}-{dd}

Download URL of source code/PHP version if known:

{url-of-php-plugin}

Download URL of TXT version if known:

{url-of-txt-plugin}

**Textpattern min and max compatibility of latest plugin version, if known (x all that apply)**

Textpattern version compatibility:

- [ ] 4.8
- [ ] 4.7
- [ ] 4.6
- [ ] 4.5

repository: colak/textpattern-curated-plugins-list

gha_license_id: MIT

repo_name: colak/textpattern-curated-plugins-list


text:
To get logs from a container simply run (skip the last param to get logs form all the containers):
```
$ docker-compose logs [service]
```

Example: real-time logs of the PHP container:
```
$ docker-compose logs -f php
```

gha_language: Shell


text:
---
description: riptide_controllers
---

# Controllers

## The Riptide Controllers Package

This package handles vehicle controls \(for maneuverabiltity\) using a decoupled PID control system. Our AUV's actuators consist of 8x [BlueRobotics T200 Thrusters](https://www.bluerobotics.com/store/thrusters/t100-t200-thrusters/t200-thruster/).

## Config Files \(cfg/\)

This folder contains a plethora of configuration files needed by the PID controllers \(namely the Kp, Ki, and Kd constants\), properties for each control node, location of each thruster relative to the CoM, and vehicle properties.

## Source Code \(src/\)

### Active ROS Nodes

#### depth\_controller

This node uses a PID controller to maintain our vehicle's depth.

* Input Topics: /state/depth, /state/imu, /command/depth, /controls/reset
* Output Topics: /command/accel\_depth, /status/controls/depth

**attitude\_controller**

This node contains three nodes \(rcpid, pcpid, and ycpid\) that each use a PID controller to maintain our vehicle's orientation \(roll, pitch, and yaw\).

* Input Topics: /state/imu, /command/attitude, /controls/reset
* Output Topics: /command/accel\_angular, /status/controls/angular

**alignment\_controller**

This node contains three nodes \(surge, sway, and heave\) that each use a PID controller to align our vehicle with a desired bounding box obtained from the camera footage.

* Input Topics: /state/object, /state/depth, /command/alignment, /task/info, /controls/reset
* Output Topics: /command/accel\_x, /command/accel\_y, /command/depth, /status/controls/linear,

**command\_combinator**

This node reads in all of the acceleration commands from the above PID controllers and combines the data into a single acceleration message used by our thruster controller.

* Input Topics: /command/accel\_x, /command/accel\_y, /command/accel\_z, /command/accel\_depth, /command/accel\_angular
* Output Topics: /command/accel

**thruster\_controller**

This nodes uses Google's non-linear solver [ceres](http://ceres-solver.org) to simultaneously solve our 6DOF equations of motion for the required thruster forces. If "debug" is enabled, then it will also solve for the approximate location of the center of buoyancy \(CoB\) relative to the center of mass \(CoM\).

* Input Topics: /state/imu, /state/depth, /command/accel
* Output Topics: /command/thrust, /status/controls/thruster, \(/debug/pos\_buoyancy\)

**pwm\_controller**

This node reads in data from the thruster controller and uses our thruster calibration file to determine what pwm value to send to the coprocessor for the correct force outputs.

* Input Topics: /command/thrust, /state/switches, /controls/reset
* Output Topics: /command/pwm

gha_language: C


text:
---
# Display name
name: André Sbrocco Figueiredo

# Username (this should match the folder name)
authors:
- admin

# Is this the primary user of the site?
superuser: true

# Role/position
role:  Mechanical Engineer

# Organizations/Affiliations
organizations:
- name: University of Campinas
  url: "https://www.unicamp.br/"

# Short bio (displayed in user profile at end of posts)
bio: My research interests range from Music and Art to Engineering and Artificial Intelligence.

interests:
- Music Information Retreival and Visualization
- Multimodal Interfaces for Art Performances
- Vehicle Dynamics
- Apply Machine Learning Techniques to all above

education:
  courses:
  - course: BSc in Mechanical Engineering
    institution: University of Campinas
    year: 2018
  - course: FdEng in Mechatronics
    institution: Technical College of Campinas
    year: 2012

# Social/Academic Networking
# For available icons, see: https://sourcethemes.com/academic/docs/widgets/#icons
#   For an email link, use "fas" icon pack, "envelope" icon, and a link in the
#   form<EMAIL_ADDRESS>or "#contact" for contact widget.
social:
- icon: envelope
  icon_pack: fas
  link: '#contact'  # For a direct email link, use<EMAIL_ADDRESS>- icon: lattes
  icon_pack: ai
  link: http://lattes.cnpq.br/6738334453514349
- icon: linkedin
  icon_pack: fab
  link: https://www.linkedin.com/in/andresbrocco/
- icon: github
  icon_pack: fab
  link: https://github.com/andresbrocco
# Link to a PDF of your resume/CV from the About widget.
# To enable, copy your resume/CV to `static/files/cv.pdf` and uncomment the lines below.
- icon: cv
  icon_pack: ai
  link: files/cv.pdf

# Enter email to display Gravatar (if Gravatar enabled in Config)
email: ""

# Organizational groups that you belong to (for People widget)
#   Set this to `[]` or comment out if you are not using People widget.
#user_groups:
#- Researchers
#- Visitors
---

André Sbrocco Figueiredo is a recently graduated Mechanical Engineer, looking for research oportunities to embrace. His interests range from Music Information Retreival and Visualization to the development of new Multimodal Interfaces using Machine Learning Techniques. He currently contributes voluntarily at the Interdisciplinary Nucleus of Sound Studies NICS at the University of Campinas, developing tools that enable research on multimodal interfaces.


text:
# Injecting code

Sphinx makes it fairly straightforward to add custom JS/CSS/HTML code to your pages. Furo supports the mechanisms provided by Sphinx for this.

## CSS or JS

ReadTheDocs has an excellent explanation on [how to add custom CSS or JS files][sphinx-custom-css] to Sphinx-based documentation. No point repeating information in two places. 😄

[sphinx-custom-css]: https://docs.readthedocs.io/en/stable/guides/adding-custom-css.html

## HTML

This is entirely powered by Sphinx's templating mechanism, which is built upon {pypi}`Jinja2`.

The primary way to do this is to override the content of the Furo's default templates with your own templates, using [`templates_path`][sphinx-templates_path]. For more information on how to do so, [Sphinx's templating documentation][templating].

```{admonition} Info
:class: tip

The expectation is that users who override Furo's templates would also carefully consider how their documentation looks across various platforms (i.e. not take a "looks OK on my machine" approach) and would also be willing to extend Furo's CSS to make their HTML changes work well.
```

[sphinx-templates_path]: https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-templates_path
[templating]: https://www.sphinx-doc.org/en/master/development/theming.html#templating


text:
# Execution Parameters

## Passing Execution Arguments

You can optionally pass arguments to the listener object being executed. In which case, all the listener functions are passed that argument upon execution.

```Lua
do
    local listener = Listener.new()

    listener:register(
        function (...)
            print("Name: " .. select(3, ...))
        end
    )
    listener:register(
        function (...)
            print("Pseudonym: " .. select(4, ...))
        end
    )
    listener:register(
        function (...)
            print("Status: " .. select(5, ...))
        end
    )

    listener:execute("Victor Hugo Soliz Kunkar", "Vexorian", "Retired")
end
```

Output:
> Name: Victor Hugo Soliz Kuncar
>
> Pseudonym: Vexorian
>
> Status: Retired

## Listener Parameters

You might wonder based on the above example, why the passed arguments are accessed from the listener functions starting at index 3 and not 1. Well that is because the system also passes what are called the 'default arguments' into the function. That means, even if you do not pass any argument during the execution, the listeners still receive arguments.

There are 2 default arguments being passed to the listeners. The first one is the listener object itself, i.e., the current executing function.


text:
![Homebaked Logo](https://cfe-static.s3.amazonaws.com/media/homebaked-raspberry-pi-django/images/homebaked_iot.png)

[CFE Video Series](https://www.codingforentrepreneurs.com/projects/homebaked-raspberry-pi-django/)

# Homebaked Parts List

Raspberry Pi 3 Model B [Affiliate](http://kirr.co/a1arxf) | [Non Affiliate](https://www.raspberrypi.org/products/raspberry-pi-3-model-b/)

Micro SD Card [Affiliate](http://www.kirr.co/jn8i7o/) | [Non Affiliate](https://www.amazon.com/SanDisk-microSDHC-Standard-Packaging-SDSQUNC-032G-GN6MA/dp/B010Q57T02/ref=sr_1_1?s=pc&ie=UTF8&qid=1478130262&sr=1-1&keywords=micro+sd)

Ethernet Cord [Affilate](http://www.kirr.co/7nems3/) | [Non Affiliate](https://www.amazon.com/AmazonBasics-RJ45-Cat-6-Ethernet-Patch-Cable-10-Feet-3-Meters/dp/B00N2VILDM/ref=sr_1_2?s=pc&ie=UTF8&qid=1478130339&sr=1-2&keywords=ethernet&th=1)

USB Keyboard & Mouse [Affilate](http://www.kirr.co/2dxqm5/) | [Non Affiliate](https://www.amazon.com/AmazonBasics-Wired-Keyboard-Mouse-Bundle/dp/B00B7GV802/ref=sr_1_1?s=pc&ie=UTF8&qid=1478130404&sr=1-1&keywords=usb+keyboard+and+mouse)

repository: TejasBhitle/Guides

repo_name: TejasBhitle/Guides


text:
---
hrs_structure:
  division: '2'
  volume: '10'
  title: '25'
  chapter: '448'
  section: 448-9
type: hrs_section
tags:
  - Business
menu:
  hrs:
    identifier: HRS_0448-0009
    parent: HRS0448
    name: 448-9 Application for licensure
weight: 39055
title: Application for licensure
full_title: 448-9 Application for licensure
---
**§448-9 Application for licensure.** Any person of eighteen years or more shall be eligible for licensure upon submission of:

(1) An application to the executive officer of the board not later than forty-five days prior to the date of the scheduled examination;

(2) Application and examination fees; and

(3) Documentation and credentials that shall include but are not limited to the following:

(A) A diploma or certificate of graduation from a dental college accredited by the American Dental Association Commission on Dental Accreditation, recognized and approved by the board; and

(B) A certificate or other evidence satisfactory to the board of having passed parts I and II of the National Board Dental Examination. [L 1949, c 177, pt of §1; am L 1955, c 170, §3(a), (b); RL 1955, §61-9; am L Sp 1959 2d, c 1, §§14, 15; am L 1961, c 142, §3(b) and c 184, §8(b); am L 1963, c 114, §§1, 3; [HRS §448-9](/title-25/chapter-448/section-448-9/); am L 1972, c 2, §19 and c 55, §1; am L 1980, c 251, §2; am L 1982, c 64, §3; am L 1983, c 220, §4; am L 1984, c 7, §26; am L 1992, c 202, §74; am L 1994, c 124, §4; am L 2004, c 69, §2 and c 166, §§4, 7; am L 2005, c 121, §1; am L 2006, c 31, §2]

Case Notes

Cited: 29 H. 422, 423 (1926).

repository: SamMade/BlueAndKrabby

repo_name: SamMade/BlueAndKrabby


text:
This project was bootstrapped with [Create React App](https://github.com/facebookincubator/create-react-app).

Setting Up an Auth0 Application
To represent your React application in your Auth0 account, you will need to create an [Auth0 Application](https://auth0.com/docs/applications). So, head to [the Applications section on your Auth0 dashboard](https://manage.auth0.com/#/applications) and proceed as follows:

    1. click on the [Create Application button](https://manage.auth0.com/#/applications/create);
    2. then define a 'Name' to your new application (e.g., "React Demo");
    3. then select 'Single Page Web Applications' as its type.
    4. and hit the 'Create' button to end the process.

After creating your application, Auth0 will redirect you to its' Quick Start' tab. From there, you will have to click on the 'Settings' tab to whitelist some URLs that Auth0 can call after the authentication process. This is a security measure implemented by Auth0 to avoid the leaking of sensitive data (like [ID Tokens](https://auth0.com/docs/tokens/id-token)).

So, when you arrive at the 'Settings' tab, search for the 'Allowed Callback ' URLs field and add http://localhost:3000/callback into it. For this tutorial, this single URL will suffice.

That's it! From the Auth0 perspective, you are good to go and can start securing your React application.

If you take your app for a spin now (npm start), you will be able to authenticate yourself with the help of Auth0, and you will be able to see your React app show your name (that is, if your identity provider does provide a name).

Note: As you want the best security available, you are going to rely on the [Auth0 login page](https://auth0.com/docs/hosted-pages/login). This method consists of redirecting users to a login page hosted by Auth0 that is easily customizable right from [your Auth0 dashboard](https://auth0.auth0.com/login?state=jOgJlYBoPnUUXdPS6jl-ojATBoTSOtIf&client=zEYfpoFzUMEzilhkHilcWoNkrFfJ3hAI&protocol=oauth2&response_type=code&redirect_uri=https%3A%2F%2Fmanage.auth0.com%2Fcallback&scope=openid%20profile%20name%20email%20nickname%20created_at). If you want to learn why this is the best approach, check [the Universal vs. Embedded Login article](https://auth0.com/docs/guides/login/universal-vs-embedded) .

Note: the following three lines MUST be updated in 'src/Auth/Auth.js':

          domain: '<AUTH0_DOMAIN>',
          audience: 'https://<AUTH0_DOMAIN>/userinfo',
          clientID: '<AUTH0_CLIENT_ID>'

Source: [Securing React Apps with Auth0](https://auth0.com/blog/how-to-configure-create-react-app)


text:
[![GitHub license](https://img.shields.io/github/license/dcendents/android-maven-gradle-plugin.svg)](http://www.apache.org/licenses/LICENSE-2.0.html)
[![Maven Central](https://img.shields.io/maven-central/v/com.github.dcendents/android-maven-gradle-plugin.svg)](http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22android-maven-gradle-plugin%22)
[![](https://jitpack.io/v/BrotherV/ToolsLibrary.svg)](https://jitpack.io/#BrotherV/ToolsLibrary)
# Tools Library
**An extended library from different widgets such as Layouts, Spinner and TextView which have more features than original version**

#### ExtendSpinner
You can add what ever you want only in xml file without writing any JAVA code.

#### ExtendTextView
You can easily add rtl/ltr font in xml file just same as fontFamily attribute in android oreo, but it works for all version of android.

#### ExtendConstraintLayout, ExtendCoordinatorLayout, ExtendFrameLayout, ExtendLinearLayout
You can insert objects in these layouts where yo want to move up and down when snackbar comes up and down. Also you can get the exaxt point of x and y when you use these layouts as parent.

#### FloatFrameLayout, FloatLinearLayout
if you want to hide/show a few widgets just like FloatActionButton when moving RecyclerView/ScrolView/ListView you can use these widgets.

## Usage

Step 1. Add it in your root build.gradle at the end of repositories:
```Groovy
allprojects{
	repositories{
		...
		maven { url 'https://jitpack.io' }
	}
}
```
Step 2. Add the dependency
```Groovy
dependencies{
	     implementation 'com.github.BrotherV:ToolsLibrary:0.90.3'
}
```

## License
```
Copyright 2018 BrotherV

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```

repository: BrotherV/ToolsLibrary

repo_name: BrotherV/ToolsLibrary


text:
# Laravel API Skeleton

> Awesome Laravel boilerplate to create APIs using many cool features and technologies

I like to change the default architecture of Laravel when I work wit it, and some weeks ago I saw
some videos in [CodeCasts](https://codecasts.com.br/) of a serie about **Advanced Laravel** using version 5.3
and I loved the architecture that they built. So this project is inspired by [codecasts/laravel](https://github.com/codecasts/laravel)
and all the credits must go to [Diego Hernandes](https://github.com/hernandev), [Vinicius Reis](https://github.com/vinicius73) and
[Fábio Vedovelli](https://github.com/vedovelli). I only made some personal changes to their architecture and I'm sharing it because I think
that this repo can help when you need to start a new project.

## Tecnhologies

- [Ambientum](https://github.com/codecasts/ambientum)
  - Docker
  - PHP 7
  - Caddy
  - Redis
  - MySQL 5.7
- JWT Authentication
  - Uses [tymondesigns/jwt-auth](https://github.com/tymondesigns/jwt-auth)
  - Authentication with e-mail and password ready to use
  - Method to get authenticated user
- [Migrator](https://github.com/artesaos/migrator)
- Repositories using [prettus/l5-repository](https://github.com/andersao/l5-repository)
- Validator using [prettus/laravel-validator](https://github.com/andersao/laravel-validator)
- Presenters/Transformers using [Fractal](http://fractal.thephpleague.com/)

## How to use it

#### Checking your envirorment

To use this repository make sure you have **Docker** and **Docker Compose** installed. If you don't, you can
use the links below to help you install them:

- [Install Docker](https://www.docker.com/products/overview)
- [Install Docker Composer](https://docs.docker.com/compose/install/)

#### Using the boilerplate

- Clone this repo
- Install the dependencies
```shell
composer install
```
- You can check the default routes with:
```shell
php artisan route:list
```
- Rename the file `.env.example` to `.env`
- You can customize the variables in `.env` and `docker-compose.yml` if you want to.
- Run the migrations and seeders:
```shell
docker-compose run api bash
php artisan migrator --seed
exit
```
- Run the application:
```shell
docker-compose up
```
- Now you can use [Postman](https://www.getpostman.com/) or other app you like to test your API.

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/WendellAdriel/laravel-api-skeleton/.
This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to
the [Contributor Covenant](http://contributor-covenant.org) code of conduct.

## License

The project is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).

repository: WendellAdriel/laravel-api-skeleton

gha_language: PHP

repo_name: WendellAdriel/laravel-api-skeleton


text:
Arduino_LS7366R
===============

Synchronous use of two LS7366R decoders on Arduino environnement.

The goal is to provide an interface for reading two LS7366R at the same time without missing ticks for a robot having two wheels.
The solution is to send the order LOAD for register CNTR into OTR via SPI with the two chips on slave mode, afterwards we can read each chip via OTR.

By [Werdroid.fr](http://werdroid.fr)

Usage
=========

- Wire your components with SPI to Arduino like the photo below
- Wire the two slave lines
- Copy LS7366R.h and LS7366R.cpp in your project from LS7366R_example

```cpp
#include <SPI.h>
#include "LS7366R.h"

int slave_pin_left = 10;
int slave_pin_right = 11;

LS7366R encoders(slave_pin_left, slave_pin_right, MDR0_CONF, MDR1_CONF);

void setup() {
  Serial.begin(9600);
  encoders.reset();
}

void loop() {
  encoders.sync();
  Serial.print(encoders.left());
  Serial.print(" ");
  Serial.print(encoders.right());
  Serial.println();
  delay(100);
}
```

Example
=========

This example was done with an 1x Arduino Micro, 2x LS7366R, 1x oscillator 32Mhz, 1x encoder OME-A NEMICON

![Arduino LS7366R](https://raw.githubusercontent.com/werdroid/Arduino_LS7366R/master/LS7366R_example/breadboard_pic_mini.jpg)
![Arduino LS7366R](https://raw.githubusercontent.com/werdroid/Arduino_LS7366R/master/LS7366R_example_fritzing/LS7366R_double_mini.jpg)

LS7366R provided by LCI CSI and Anaheim Automation.
Encoder provided by Vicatronic.


text:
## [0.0.1] - 09-25-17

* Support for full screen web view
* Supports nav bar with actions
* Supports listening for redirect events
* Control javascript and media playback support
* Supports loading new pages ( post initialization )
* iOS & Android

## [0.0.2] - 11-07-17

* Android back button support - https://github.com/apptreesoftware/flutter_webview/pull/5

## [0.0.4] - 11-12-18

* Fix build errors after gradle update

## [0.0.5] - 11-12-18

* Fix crash after upgrading to Flutter 0.11.3

## [0.0.6] - 03-04-19

* Upgrade kotlin plugin version for compatibility with latest gradle


text:
Samba analytics-ios
=================
This is a modified version of the segment.io analytics-ios SDK. The dependence on the segment.io dashboard has been removed. A segment.io API secret is not required to use this SDK and the segment.io Provider has been removed.
Settings for each Provider is passed in the at initialization as an NSDictionary. The values needed to initialize each Provider can be found by digging into the Provider classes and examples can bee seen in the settings.json file included in Project.

Example initializing a Mixpanel Provider below.

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    ...
    NSDictionary *settings = @{@"Mixpanel" : @{@"token" : @"89f86c4aa2ce5b74cb47eb5ec95ad1f9"}};
    [Analytics debug:YES];
    [Analytics initializeWithSettings:settings];
    ...
    }

Shout out to [Segment.io](https://segment.io)

## Documentation

Documentation is available at [https://segment.io/libraries/ios](https://segment.io/libraries/ios).

## Development

libAnalytics itself strives to have as few dependencies as possible to create the most compatible and
lightweight Analytics SDK for ObjC developers. However, there is no such restriction during testing time,
and in order to contribute to the SDK, you will need cocoapods, as well as an additional pod specs repo.
This can be accomplished as follow

    [sudo] gem install cocoapods
    pod repo add Segmentio-Podspecs git@github.com:segmentio/Podspecs.git
    pod repo add Collections-Podspecs git@github.com:collections/Podspecs.git
    pod install

## License

```
WWWWWW||WWWWWW
 W W W||W W W
      ||
    ( OO )__________
     /  |           \
    /o o|    MIT     \
    \___/||_||__||_|| *
         || ||  || ||
        _||_|| _||_||
       (__|__|(__|__|
```

(The MIT License)

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

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

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

repository: SambaTVMobile/analytics-ios

repo_name: SambaTVMobile/analytics-ios


text:
# NFC (Door) access control system
This project is an access control system, that allows you to grant access via NFC and / or Google Authenticator codes.

The idea was born as my growing kids had problems to fully turn the key to open the latch. That easy :)

*This project just handles the authentication and calls an URL after authentication succeeds*

Thus on one side you can use this as a generic hardware authentication system, but on the other side you will need an infrastructure (any electronic device) that will actually open the door / disarm an alarm-system for you.

I use standard (vulnerable but silly cheap) Mifare Classic chips, a NFC522 reader, ESP32, WS2812 LED's and a keypad.

The reason I chose Mifare Classic chips was to attempt to use logic and a threat model to secure the insecure nature of these chips as much as possible. Still, there are flaws but for homes it gives me a good feeling, sure you don't want this to secure a high level target like a rocket start base :)

# Authentication features
Currently I have implemented the following authentication features:
   * NFC Authentication only (tap and go)
   * GAuth Authentication with PIN
   * NFC + Google Authenticator with PIN
   * NFC + Google Authenticator without PIN
   * NFC + PIN

You can configure each user seperatly and mix together the authentication options.

For example:
   * User1 can use NFC-only authentication
   * User2 can use NFC + GAuth with PIN
   * User3 can use GAuth only
   * User3 can use NFC + PIN

Everything is configureable in a text based json config file.

If you just want NFC authentication you can let the keypad unconnected.

# Security
The most energy to secure the thing has been put to the most vulnerable part of this system: the Mifare Classic Tags. As we cannot change the design issues with Mifare Classic in general, the only attempt to get better security is to put a logical security layer in-between.

This logical layer of additional security is based off of a threat model I created for this application:
   * UID of tags can be cloned
   * Sector R/W encryption on those tags can be cracked in less than 10 minutes
   * Simulators and emulators exist and are used a lot (e.g. proxmark)
   * Hardware can be ripped away, thus the code and stored keys can be extracted
      * As a result of the above your WiFi can be hacked as the password is stored on the device

**This results to the implemtation of these following defenses:**
  * UID of tags can be cloned
     * _Chinese Changeable UID detection via NFC commands with customizable action at server side (e.g. notify via telegram or mail) and rejection_
  * Sector R/W encryption on those tags can be cracked in less than 10 minutes
     * _new random key generation with every usage of the tag, key is encrypted and saved on the tag, verified with each new tapping attempt_
     * _each tag get randomly generated read/write keys that are distinct for that tag_
     * _for each new tag the position of the key within the tag memory is randomly chosen_
     * _each block of each sector is filled with randomly generated data. This obfuscates the location of the real key and if one don't compare the same tag multiple times, you cannot distingush the position of the key_
  * Simulators and emulators exist and are used a lot (e.g. proxmark)
     * _old key is read, new key generated and written to the card, then read again_ (most simulators don't store the new values directly)
     *_proxmark is **NOT** defeated as it is an advanced emulator which stores the changed values in memory - but simple simulators will struggle on that_
  * Hardware can be ripped away, thus the code and stored keys can be extracted
     * _the whole key generation and verification is done at the server, not the reader. The hardware "outside" is only for interacting with the tag based on the responses from the server_
     * _however I have an extra firewalled "IoT" DMZ WiFi that can only communicate with the Webserver - this helps if someone gets knowledge of the WiFi SSID and Password_

**However, there is still some flaws so these mitigations are not enough to meet my sense of security:**
   * There are (rare) one-time UID changeable tags which don't react to the "magic" commands after written one-time, so our reader would accept them
   * Proxmark in Mifare emulation mode is still working
   * There is a race-condition: if someone cracked all sectors and wrote them to a one-time writeable tag, if he would immediantly go to the reader he would be able to gain access.
      * but you would notice it as your tag won't work anymore
      * if you would be faster his tag won't work anymore (because the key changed in the meantime)
   * If two people with modified android phones and cellular connection would stand in front of the tag and in front of your reader, they would be able to forward the communication between the tag and your reader (same technique as tesla's got hacked)

This is why 2FA (NFC+GAuth) and 3FA (NFC+PIN+GAuth) has been implemented additionally.

Thx to ramm83 for the GAuth idea.

In "maximum" security mode you have is 3 factors (configurable per user in any combination):
   * one thing you have (the Tag)
   * one thing you know (the PIN)
   * one thing that is not static (GAuth)

# Installation
## Wiring
![Circuit](documentation/NFC_Door_Circuit.png)
![Connection Diagram](documentation/NFC_Door_Steckplatine.png)

# Configuration
## Setup ESP32 Files
   * boot.py
      * Change the Hostname it should get from DHCP:
        > wlan.config(dhcp_hostname="NFC_DoorControl")
      * Change the values for your WiFi accordingly / to connect to a specific accesspoint:
        > wlan.connect('WiFi_Name', 'WiFi Password')

        > wlan.connect('WiFi_Name', 'WiFi Password', bssid=b'\xab\xcd\xef\xab\xcd\xef')
   * main.py
     * Config is in the upper part of the file
     * authurl: define the URL where your PHP Files are located:
       > authurl = 'http://your-server/rfid-auth/auth.php'
     * device_id: identifies your device within the server configuration
       > device_id = 'frontdoor'
     * nfc_writemessage: message that is written to every tap in sector 0 and readable by everyone (17 chars! be creative )
       > nfc_writemessage = b"Fsck off         "

## Setup PHP Files
   * configuration.php
      * You should at least change the hmac key for generating the hash for the random number and the following functions to control the door:
        > function door_open($device_id,$uid)

        > function door_close($device_id,$uid)

        > function door_toggle($device_id,$uid)

        > function china_uid_detected($device_id,$uid,$name)

        > function unknown_uid_detected($device_id,$uid)

### RFID Userdatabase (rfid.txt)
| option | required | possible values | description |
| ------ | -------- | --------------- | ----------- |
| key_name | yes | string | defines a readable name to the tag, just for reference |
| device_ids | no | json_array | if undefined, all device_id access is allowed, if defined it allows only specific doors. If "all" is set in the array, same as not defined: allow access on all devices |
| reset | no  | 1 | if set for a user the RFID tag keys will be reset, the content will be cleared. Tag is now "prestine" again. |
| gauth_secret | no | string | if set, user is requested for a Google Authenticator code after NFC verified successfully |
| gauth_pin | no | 4-char string | if set, user is requested for a Google Authenticator code + PIN after NFC verified successfully, **depends on a configured gauth_secret** |
| nfc_pin | no | 4-char string | if set, user is requested for a PIN after NFC verified successfully, **mutually exclusive to gauth_*** (use this **or** gauth_*) |

### RFID Userdatabase examples:
Minimum tag configuration:
```
    "0a0b0c0d": {
      "key_name": "Yellow Tag User 1"
    },
```
Specific access allowed on defined device_ids:
```
    "0a0b0c0d": {
      "key_name": "Yellow Tag User 1",
      "device_ids": [
         "frontdoor",
         "backdoor"
      ],
    },
```

Delete a tag and reset all content:
```
    "0a0b0c0d": {
        "key_name": "Yellow Tag User 1",
        "reset":1
    },
```

NFC + Google Authenticator with PIN setup:
```
    "0a0b0c0d": {
        "key_name": "Yellow Tag User 1",
        "gauth_secret": "TXKCLJRXB4OIFCHZ",
        "gauth_pin": "6666",
    },
```

NFC + PIN Setup:
```
    "0a0b0c0d": {
        "key_name": "Yellow Tag User 1",
        "nfc_pin": "6666",
    },
```
### GAuth only Userdatabase (googleauth.txt)
For this, you have only the option to define the PIN (must be 4 chars!) and the Secret that is used to generate the Google Authenticator codes.

### GAuth only examples:
Static PIN of 1234 with GAuth secret:
```
    "1234": {
        "key_name": "GAuth User 1",
        "GAuthSecret": "TXKCLJRXB4OIFCHZ"
    },
```
### Generating a Google Auth Code
I didn't implement QR Code generation, but you can use http://your-server/rfid-auth/auth.php?QR=1 to generate a Code that can be put in the rfid.txt configuration file and manually put in your phone.

## Software installation
   * Installing micropython on ESP32
      * See [Installing Micropython on ESP32](https://docs.micropython.org/en/latest/esp32/tutorial/intro.html)

   * Copy the files to ESP32
      ```
      > rshell --buffer-size 32 -p COM7
         Using buffer-size of 32
         Connecting to COM7 (buffer-size 32)...
         Trying to connect to REPL .... connected
         Testing if ubinascii.unhexlify exists ... Y
      > cp boot.py /pyboard/boot.py
      > cp main.py /pyboard/main.py
      > cp keypad_timer.py /pyboard/keypad_timer.py
      > cp mfrc522.py /pyboard/mfrc522.py
      ```
   * Copy and adjust the PHP files from the "PHP" folder to your webserver
   * Test :)

# Get Involved!
If you want, you're welcome to change, modify, use and adjust this project as you need to.

Please try to manipulate, hack and circumvent this system, fix the problems you found and send me a pull request, I would really appreciate it!

**The only way we can get better is together.**

Fell free to DM or @mention me on twitter!

[![@devBioS Twitter](https://img.shields.io/twitter/url?label=%40devBioS%20on%20Twitter&style=social&url=https%3A%2F%2Ftwitter.com%2FdevBioS)](https://twitter.com/devBioS)

# ShoutOut
Greetings to my family who badly needed such a system, to the whole DEFCON community, my colleagues, the people at DCZIA especially @syntax976 and @LunaSylumDancer for postponing my release date because they thought they should do a badge challenge (that was great! thx!) :)


text:
# HID_buttonbox
Button box primarily for flight simulation

## Before you look at the code..
  The one named "button_box_hardware_test": THIS IS THE AD-HOC HARDWARE-TEST VERSION 0.0.1!
  This is problably one of the ugliest pice of code you have ever seen (at least from me).
  Don't judge me...

# The finished button box
![schematic](https://github.com/christoferjh/HID_buttonbox/blob/master/images/img_box.PNG)
## How the display and leds work
![schematic](https://github.com/christoferjh/HID_buttonbox/blob/master/images/box.gif)
![schematic](https://github.com/christoferjh/HID_buttonbox/blob/master/images/buttons.gif)

## And the hidden mess under the lid...
![schematic](https://github.com/christoferjh/HID_buttonbox/blob/master/images/img_box_inside.PNG)
![schematic](https://github.com/christoferjh/HID_buttonbox/blob/master/images/img_box_messy.PNG)

# Code
The code is just the hardware test verison.
Using the following libs:
[ArduinoJoystickLibrary](https://github.com/MHeironimus/ArduinoJoystickLibrary)
[DigitalTube](https://github.com/ioxhop/DigitalTube)

# Really messy schematic, probably correctly wired
![schematic](https://github.com/christoferjh/HID_buttonbox/blob/master/images/schem.png)

## BOM
This is almost correct:

| Label | Part Type                | Properties                                                                 |
| ----- | ------------------------ | -------------------------------------------------------------------------- |
| LED1  | Red (633nm) LED          | leg yes; color Red (633nm); package 3 mm \[THT\]                           |
| LED2  | Red (633nm) LED          | leg yes; color Red (633nm); package 3 mm \[THT\]                           |
| LED3  | Red (633nm) LED          | leg yes; color Red (633nm); package 3 mm \[THT\]                           |
| LED4  | Red (633nm) LED          | leg yes; color Red (633nm); package 3 mm \[THT\]                           |
| LED5  | Red (633nm) LED          | leg yes; color Red (633nm); package 3 mm \[THT\]                           |
| LED6  | Red (633nm) LED          | leg yes; color Red (633nm); package 3 mm \[THT\]                           |
| Part1 | Arduino Leonardo (Rev3b) | type Arduino Leonardo (Rev3)                                               |
| R1    | 220Ω Resistor            | pin spacing 400 mil; bands 4; resistance 220Ω; tolerance ±5%; package THT  |
| R3    | 1kΩ Resistor             | pin spacing 400 mil; bands 4; resistance 1kΩ; tolerance ±5%; package THT   |
| R4    | 220Ω Resistor            | pin spacing 400 mil; bands 4; resistance 220Ω; tolerance ±5%; package THT  |
| R5    | 220Ω Resistor            | pin spacing 400 mil; bands 4; resistance 220Ω; tolerance ±5%; package THT  |
| R6    | 220Ω Resistor            | pin spacing 400 mil; bands 4; resistance 220Ω; tolerance ±5%; package THT  |
| R7    | 220Ω Resistor            | pin spacing 400 mil; bands 4; resistance 220Ω; tolerance ±5%; package THT  |
| R8    | 220Ω Resistor            | pin spacing 400 mil; bands 4; resistance 220Ω; tolerance ±5%; package THT  |
| R9    | 1kΩ Resistor             | pin spacing 400 mil; bands 4; resistance 1kΩ; tolerance ±5%; package THT   |
| R10   | 2.2kΩ Resistor           | pin spacing 400 mil; bands 4; resistance 2.2kΩ; tolerance ±5%; package THT |
| R12   | 1kΩ Resistor             | pin spacing 400 mil; bands 4; resistance 1kΩ; tolerance ±5%; package THT   |
| R13   | 1kΩ Resistor             | pin spacing 400 mil; bands 4; resistance 1kΩ; tolerance ±5%; package THT   |
| R14   | 2.2kΩ Resistor           | pin spacing 400 mil; bands 4; resistance 2.2kΩ; tolerance ±5%; package THT |
| R15   | 4.3kΩ Resistor           | pin spacing 400 mil; bands 4; resistance 4.3kΩ; tolerance ±5%; package THT |
| R16   | 220Ω Resistor            | pin spacing 400 mil; bands 4; resistance 220Ω; tolerance ±5%; package THT  |
| RE1   | Rotary Encoder           | type ALPS STEC12E07; package THT                                           |
| S1    | Square Pushbutton        | default state Normally Open; switching circuit SPST                        |
| S2    | Square Pushbutton        | default state Normally Open; switching circuit SPST                        |
| S3    | Square Pushbutton        | default state Normally Open; switching circuit SPST                        |
| S4    | Square Pushbutton        | default state Normally Open; switching circuit SPST                        |
| S5    | Square Pushbutton        | default state Normally Open; switching circuit SPST                        |
| U1    | SWITCH\_SPDT             | package kps-1290                                                           |
| U2    | 74HC595                  | type 74HC595; package DIP16 \[THT\]                                        |
| U3    | POT                      | variant mam; package pot\_mammoth                                          |
| U4    | POT                      | variant mam; package pot\_mammoth                                          |
| U5    | POT                      | variant mam; package pot\_mammoth                                          |
| U6    | SWITCH\_SPDT             | package kps-1290                                                           |
| U7    | SWITCH\_SPDT             | package kps-1290                                                           |
| U8    | SWITCH\_SPDT             | package kps-1290                                                           |
| U9    | SWITCH\_SPDT             | package kps-1290                                                           |
| U10   | SWITCH\_SPDT             | package kps-1290                                                           |
| U11   | 7-SEGMENT-4DIGIT         | segments 7; digits 4; variant variant 1; package 7-segment-4digit-youngsun |

## Shopping list

| Amount | Part Type                | Properties                                                                 |
| ------ | ------------------------ | -------------------------------------------------------------------------- |
| 6      | Red (633nm) LED          | leg yes; color Red (633nm); package 3 mm \[THT\]                           |
| 1      | Arduino Leonardo (Rev3b) | type Arduino Leonardo (Rev3)                                               |
| 7      | 220Ω Resistor            | pin spacing 400 mil; bands 4; resistance 220Ω; tolerance ±5%; package THT  |
| 4      | 1kΩ Resistor             | pin spacing 400 mil; bands 4; resistance 1kΩ; tolerance ±5%; package THT   |
| 2      | 2.2kΩ Resistor           | pin spacing 400 mil; bands 4; resistance 2.2kΩ; tolerance ±5%; package THT |
| 1      | 4.3kΩ Resistor           | pin spacing 400 mil; bands 4; resistance 4.3kΩ; tolerance ±5%; package THT |
| 1      | Rotary Encoder           | type ALPS STEC12E07; package THT                                           |
| 5      | Square Pushbutton        | default state Normally Open; switching circuit SPST                        |
| 6      | SWITCH\_SPDT             | package kps-1290                                                           |
| 1      | 74HC595                  | type 74HC595; package DIP16 \[THT\]                                        |
| 3      | POT                      | variant mam; package pot\_mammoth                                          |
| 1      | 7-SEGMENT-4DIGIT         | segments 7; digits 4; variant variant 1; package 7-segment-4digit-youngsun |

[BOM](https://github.com/christoferjh/HID_buttonbox/blob/master/bom.html)

# Bonus content, easy DIY flight yoke
![schematic](https://github.com/christoferjh/HID_buttonbox/blob/master/images/yoke.PNG)
[On hackaday](https://hackaday.com/2020/10/17/turning-a-desk-drawer-into-a-flight-yoke/)


text:
# DeSciL-mturk

API to connect to the Mturk service provided by the ETH Decision Science Laboratory (DeSciL).

## Setup

Create a `conf` directory at the top of the root tree and add a file called `descil.conf.js` containing the following lines:

```javascript
  module.exports.key = "zyx";
  module.exports.project = "xyx";
  module.exports.uri = "http://xxx.xxx";
```

## Usage

The DeSciL Mturk service is still in beta. If you are interested in testing the `descil-mturk` API, contact the lab manager to receive valid credentials.

## Resources

 * http://www.descil.ethz.ch/
 * http://github.com/nodeGame/

## License

Copyright (C) 2012 Stefano Balietti

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

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

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

repository: stwehrli/descil-mturk

repo_name: stwehrli/descil-mturk


text:
# Getting started with Lagom

Once you have [[installed|Installation]] a JDK and a build tool to run Lagom, you can start creating your first Lagom project.

How you get started depends on which build tool you are using.

* [[Getting started with Maven|GettingStartedMaven]]
* [[Getting started with sbt|GettingStartedSbt]]

repository: githubBangladesh/lagom

repo_name: githubBangladesh/lagom


text:
# T2-Compiladores

## Executing With Makefile:
- Choose a example file from the `examples` folder and pass it as `FILE="example/file.ccc"`

```
make FILE="examples/ex1.ccc"
```

## With Python3:

```
pip3 install --user ply
pip3 install --user pprint

python3 semantic_syntatic_analyzer.py examples/ex1.ccc
```

## With Python < 3:

```
pip install --user ply
pip install --user pprint

python semantic_syntatic_analyzer.py examples/ex1.ccc
```


text:
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
[![CircleCI](https://circleci.com/gh/tuist/tuist.svg?style=svg)](https://circleci.com/gh/tuist/tuist)
[![codecov](https://codecov.io/gh/tuist/tuist/branch/master/graph/badge.svg)](https://codecov.io/gh/tuist/tuist)
[![Slack](http://slack.tuist.io/badge.svg)](http://slack.tuist.io)

## What's Tuist 🕺

Tuist is a command line tool that helps you **generate**, **maintain** and **interact** with Xcode projects.

It's open source and written in Swift.

### Defining your projects 💼

With Tuist, projects are defined in a `Project.swift`, also known as manifest. The manifest format abstracts you from the implementation details of Xcode projects. In your manifest you can define which targets your project has, which sources and resources belong to them, as well as the dependencies with targets in the same and other projects. The advantages of defining the projects in a manifest are:

- It can catch **misconfigurations and fail early.** For example, if a target has an invalid dependency, it’ll let you know before you start compiling the app.
- Since the manifest doesn’t include Xcode implementation details, the **likelihood of having git conflicts** is significantly lower.
- **It makes the configuration easier.** The decision on how the project looks is on you. Tuist processes it and manages the complexity for you. One example of that complexity is setting up dependencies between targets.

The example below shows how projects are defined with Tuist:

```swift
import ProjectDescription

let project = Project(name: "App",
                      targets: [
                        Target(name: "App",
                               platform: .iOS,
                               product: .app,
                               bundleId: "io.tuist.App",
                               infoPlist: "Info.plist",
                               sources: ["Sources/**", "OtherSources/**"],
                               dependencies: [
                                    /* Target dependencies can be defined here */
                                    /* .framework(path: "framework") */
                                ]),
                        Target(name: "AppTests",
                               platform: .iOS,
                               product: .unitTests,
                               bundleId: "io.tuist.AppTests",
                               infoPlist: "Tests.plist",
                               sources: "Tests/**",
                               dependencies: [
                                    .target(name: "App")
                               ])
                      ])
```

### Interacting with your projects 🙇♀

Tuist leverages project generation to provide a **simple and convenient set of commands, standard across all the projects**. The commands infer most of the necessary information from your projects, requiring you to pass only the arguments that are strictly necessary.

Having a standard command line interface makes it easier to jump between projects since there’s an interaction language everyone in the team is familiar with.

- **👩💻 Init:** Bootstraps a new project. You can specify the platform and the type of project and it’ll generate all the necessary artifacts _(Info.plist, AppDelegate, Project.swift, Playgrounds…)_.
- **💫 Generate:** Generates the Xcode workspace and projects to work on a particular project.
- **📦 Build:** _(Not available yet)_ Builds the project in the current directory. It supports all the arguments that xcodebuild supports.
- **✅ Test:** _(Not available yet)_ Test the project in the current directory. It supports all the arguments that xcodebuild supports.
- **📱 Run:** _(Not available yet)_ Runs the project. If the project needs a device to run on, it’ll prompt you to select one.
- **🚀 Release:** _(Not available yet)_ Builds and publishes your project on iTunes Connect.

The list of actions will likely grow as we get feedback from you.

## Install ⬇

### Running script (Recommended)

```bash
bash <(curl -Ls https://tuist.io/install)

```

## Bootstrap your first project 🌀

```bash
tuist init --platform ios --product application
tuist generate # Generates Xcode project & workspace
```

[Check out](https://tuist.io/docs) the project "Getting Started" guide to learn more about Tuist and all its features.

## Documentation 📝

Do you want to know more about what Tuist can offer you? Or perhaps want to contribute to the project and you need a starting point? You can check out the [project documentation](https://tuist.io/docs).

## Setup for development 👩💻

1.  Git clone: `git clone git@github.com:tuist/tuist.git`
2.  Generate Xcode project with `swift package generate-xcodeproj`.
3.  Open `tuist.xcodeproj`.
4.  Have fun 🤖

## Testing

### Unit tests

Tuist has a suite of unit tests for its various target that can be run via Swift Packager Manager by invoking:

`swift test`

### Acceptance tests

Additionally, Tuist has a few high level acceptance tests written in cucumber and ruby which can be run by invoking:

`rake features`

## Shield

If your project uses Tuist, you can add the following badge to your project README:

[![Tuist Badge](https://img.shields.io/badge/powered%20by-Tuist-green.svg?longCache=true)](https://github.com/tuist)

```md
[![Tuist Badge](https://img.shields.io/badge/powered%20by-Tuist-green.svg?longCache=true)](https://github.com/tuist)
```

## Open source

Tuist is a proud supporter of the [Software Freedom Conservacy](https://sfconservancy.org/)

## License

[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Ftuist%2Ftuist.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Ftuist%2Ftuist?ref=badge_large)


text:
#### Improve detection of separator between interfaces ([#7305](https://github.com/prettier/prettier/pull/7305) by [@fisker](https://github.com/fisker))

Even though using a comma to separate multiple implemented interfaces is deprecated syntax, in order to support legacy use cases, Prettier keeps the original separator and doesn't wilfully replace commas with ampersands. Previously, however, this logic contained a bug, so the wrong separator could end up in the output. This is fixed now.

<!-- prettier-ignore -->
```graphql
# Input
type Type1 implements A, B
# { &  <-- Removing this comment changes the separator in stable
{a: a}

type Type2 implements A, B & C{a: a}

# Prettier stable
type Type1 implements A & B {
  # { &  <-- Removing this comment changes the separator in stable
  a: a
}

type Type2 implements A & B & C {
  a: a
}

# Prettier master
type Type1 implements A, B {
  # { &  <-- Removing this comment changes the separator in stable
  a: a
}

type Type2 implements A, B & C {
  a: a
}
```

repository: barrymcgee/prettier

gha_language: JavaScript

repo_name: barrymcgee/prettier


text:
# USPro
Ultrasound video processing with Docker and python
### Reference:
See: Haimovich et. al, 2018 for usage instructions.
### Authors:
Adrian Haimovich

Zachary Lehmann

Andrew Taylor

Department of Emergency Medicine, Yale University

repository: adhaimovich/USPro

repo_name: adhaimovich/USPro


text:
# Objective

The purpose of this lab is to implement a basic dense matrix multiplication routine.

# Prerequisites

Before starting this lab, make sure that:
- You have completed the “Vector Addition” MP
- You have completed all week 2 lecture videos

# Instruction

Edit the code in the ‘Code’ tab to perform the following:
- allocate device memory
- copy host memory to device
- initialize thread block and kernel grid dimensions
- invoke CUDA kernel
- copy results from device to host
- deallocate device memory

Instructions about where to place each part of the code is demarcated by the //@@ comment lines.

path: /mp2 basic matrix-matrix multiply/README.md


text:
---
childof: web-team-bios
title: Lane Olson
abbrev: lolson
position: Technical Lead
date: 2017-11-23T01:56:53.000Z
image: /images/bios/lolson_full.jpg
thumb: /images/bios/lolson_thumb.jpg
weight: 44
---
Lane Olson holds a Bachelor of Science in computing science, with distinction, from the University of Alberta. With nearly two decades of web design and development experience, Lane has created interactive experiences for art galleries, universities, and highly acclaimed online courses. Through his previous work creating data visualizations and maps for online courses, like Mountains 101 and Indigenous Canada, Lane has developed a keen interest in creating interactive tools that are effective and easy to use. As the Technical Lead at Eviction Lab, Lane is working with the team to create the software architecture and implementation of the mapping and data tools for the project. When Lane’s not writing documentation or code, he’s helping out with a friend’s music project or working on one of his own.


text:
# WhereIsLibgen

Fetches the URLs currently [listed on WikiData as working for Libgen](https://www.wikidata.org/wiki/Q22017206),
and hosts a webpage listing those URLs (and a service to automatically redirect the visitor to those URLs at `/go`),
and that is always up-to-date with whatever Libgen URLs are currently valid.
Try it out at https://whereislibgen.now.sh/.

## Running Locally

Make sure you have [Node](http://nodejs.org/) installed.

```sh
$ git clone git@github.com:rvnproject/whereislibgen.git # or clone your own fork
$ cd whereislibgen
$ npm install
$ npm start
```

Your app should now be running on [localhost:5000](http://localhost:5000/).

## Deploying to Now.sh

You can deploy it to [Now.sh](https://zeit.co/now) using the following command.
Note that you need your own account there (you will be asked to create one when
running the command), and that it will be deployed to a separate subdomain.

```
$ npx now
```

(`npx` [is provided by the Node package manager](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b).)

## Navigating the source code

The app is written in Javascript and is really quite simple. It consists of a
single file, [index.html](/index.html). The meat of the application is the
function `getUrls` at the bottom of the file, which fetches the current Libgen
URLs from WikiData (using [SPARQL](https://www.wikidata.org/wiki/Wikidata:SPARQL_tutorial)).

It also starts a small web server using [Express](https://expressjs.com/), to
serve the following endpoints:

- `/favicon.ico` - the [Favicon](https://en.wikipedia.org/wiki/Favicon)
- `/api` - providing the list of URLs as [JSON](https://en.wikipedia.org/wiki/JSON)
- `/go` - directly redirect the user to the URL currently listed on WikiData as preferred
- `/go/*` - directly redirect the user to the preferred URL, passing on anything beind `/go/` to that URL. This allows users to e.g. directly append a DOI or a link to an article to find it on Libgen.
- `/` - a simple HTML page listing the URLs for human consumption, and providing links to e.g. this source code :)

repository: rvnproject/whereislibgen

repo_name: rvnproject/whereislibgen


text:
# Code for "Bayesian Inference for Randomized Benchmarking Protocols"

- Ian Hincks
- Joel J. Wallman
- Chris Ferrie
- Chris Granade
- David G. Cory

## Introduction

This repository contains all source code necessary to reproduce the results found in the paper _Bayesian Inference for Randomized Benchmarking Protocols_. Plase submit questions about using this repository as GitHub issues.

## Requirements

Both Mathematica and Python are used. Mathematica is used for sequence re-use derivations and plots, generating survival distributions, and deriving beta reparameterizations. Python is used for all fitting, including the CDPBM model, beta-model, and bootstrapping.

#### Mathematica

File extensions `.nb` are to be run with _Wolfram Mathematica 11_ (though earlier and later versions will likely work too). As this is paid software, we have also made the notebooks available in the `.cdf` format where they can be viewed, but not modified, using the free [Wolfram CDF Player](https://www.wolfram.com/cdf-player/).

The following third party _Mathematica_ packages are required to run these notebooks:

 - [QuantumUtils for Mathematica](https://github.com/QuantumUtils/quantum-utils-mathematica)
 - [MaTeX](https://github.com/szhorvat/MaTeX)

#### Python

All code is run from [Jupyter notebooks](http://jupyter.org/). These notebooks can be viewed online by browsing the GitHub tree structure above, opening files with the `.ipynb` extension. See the manifests below to figure out which file does what.

To run or modify these notebooks on your own computer, we recommend using a conda virtual environment to install dependencies:

```bash
$ conda env create -f environment.yml
```

Alternatively with pip:

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

Or with pip and virtualenv:

```
$ virtualenv env/
$ env/scripts/activate.sh # Use ".ps1" instead of ".sh" on Windows.
$ pip install -r requirements.txt
```
## Index

#### By Figure Number

- [Figure 1](https://github.com/ihincks/birb/blob/master/fig/betabin-crb.pdf):
`src/sequence-reuse-calculations.*`, subsection _"Weighted Cramer-Rao Bound Plots"_
- [Figure 2](https://github.com/ihincks/birb/blob/master/fig/unitarity-optimal-switching-cost.pdf):
`src/sequence-reuse-calculations.*`, subsection _"Generalization to Finite Switching Cost"_
- [Figure 3](https://github.com/ihincks/birb/blob/master/fig/different-noise-models-summary.pdf):
[`src/rb-dp-different_noise_models.ipynb`](https://github.com/ihincks/birb/blob/master/src/rb-dp-different_noise_models.ipynb),
subsection _"Dirichlet Process based Stan Model"_
- [Figure 4](https://github.com/ihincks/birb/blob/master/fig/different-noise-models-comparison.pdf):
[`src/rb-dp-different_noise_models.ipynb`](https://github.com/ihincks/birb/blob/master/src/rb-dp-different_noise_models.ipynb),
subsection _"Comparison Plots"_
- [Figure 5](https://github.com/ihincks/birb/blob/master/fig/different-noise-models-survival-dists.pdf):
[`src/rb-dp-different_noise_models.ipynb`](https://github.com/ihincks/birb/blob/master/src/rb-dp-different_noise_models.ipynb),
subsection _"Comparison Plots"_
- [Figure 6](https://github.com/ihincks/birb/blob/master/fig/low-data.pdf):
[`src/rb-dp-different_noise_models.ipynb`](https://github.com/ihincks/birb/blob/master/src/rb-low_data.ipynb),
subsection _"Plots"_
- [Figure 7](https://github.com/ihincks/birb/blob/master/fig/pathological-survival-distributions.pdf):
[`src/rb-dp-pathological_model.ipynb`](https://github.com/ihincks/birb/blob/master/src/rb-dp-pathological_model.ipynb)
- [Figure 8](https://github.com/ihincks/birb/blob/master/fig/lrb-posterior.pdf):
[`src/lrb.ipynb`](https://github.com/ihincks/birb/blob/master/src/lrb.ipynb)

#### By Table Number

- Table 2: `src/beta-reparameterizations.*`

#### By Equation Number

repository: ihincks/birb

repo_name: ihincks/birb


text:
# Change Password | General

### Always offer a dedicated form for changing a user's account password.

TODO: add description.

### Consider explaining upfront what the password requirements are.

TODO: add description.

### Always request the current password before replacing it with a new password.

In an application context, even when a user has already been authenticated, when a user wants to change their password, the current password should always be requested.

TODO: add description.

### Consider allowing only strong passwords.

A password should satisfy the following requirements:
- Have a lenght greater than 7 characters
- Contain both upper and lowercase alphabetic character (e.g. A-Z, a-z)
- Have at least one digit (e.g. 0-9)
- Have at least one symbol character

TODO: add description.

### Consider not allowing passwords containing a word or series of words that can be found in a standard dictionary.

TODO: add description.

### Consider not allowing passwords composed of a word with one or more numbers appended or prepended to it.

TODO: add description.

### Do not allow passwords composed of any personal information such as user id, email, family name, birthday, etc.

TODO: add description.

### Consider comparing a user's credentials against known compromised accounts that have been part of major breaches.

TODO: add description.

Additional Tags: Security

### Consider sending an email to the user to notify them of the password change.

TODO: add description.


text:
# Quickstart: Mutiny tutorial

Blog post here:
* http://blog.talosintelligence.com/2018/01/tutorial-mutiny-fuzzing-framework-and.html

Links to this YouTube video demo:
* https://www.youtube.com/watch?v=FZyR6MgJCUs

For more features geared towards fuzzing campaigns/feedback/harnesses:
* https://github.com/Cisco-Talos/mutiny-fuzzer/tree/experiment

# Mutiny Fuzzing Framework

The Mutiny Fuzzing Framework is a network fuzzer that operates by replaying
PCAPs through a mutational fuzzer.  The goal is to begin network fuzzing as
quickly as possible, at the expense of being thorough.

The general workflow for Mutiny is to take a sample of legitimate traffic, such
as a browser request, and feed it into a prep script to generate a .fuzzer file.
Then, Mutiny can be run with this .fuzzer file to generate traffic against a
target host, mutating whichever packets the user would like.

There are extensions that allow changing how Mutiny behaves, including changing
messages based on input/output, changing how Mutiny responds to network errors,
and monitoring the target in a separate thread.

Mutiny uses [Radamsa](https://github.com/aoh/radamsa) to perform mutations.

The [Decept Proxy](https://github.com/Cisco-Talos/Decept) is a multi-purpose
network proxy that can forward traffic from a plaintext or TLS TCP/UDP/domain
socket connection to a plaintext or TLS TCP/UDP/domain socket connection, among
other features.  It makes a good companion for Mutiny, as it can both generate
.fuzzer files directly, particularly helpful when fuzzing TLS connections, and
allow Mutiny to communicate with TLS hosts.

sample_apps give a basic idea of some things that can be done with the fuzzer,
with a few different applications/clients to test with.

Written by James Spadaro<EMAIL_ADDRESS>and Lilith Wyatt
<EMAIL_ADDRESS>
## Setup

Ensure python and scapy are installed.

Untar Radamsa and `make`  (You do not have to make install, unless you want it
in /usr/bin - it will use the local Radamsa) Update `mutiny.py` with path to
Radamsa if you changed it.

## Basic Usage

Save pcap into a folder.  Run `mutiny_prep.py` on `<XYZ>.pcap` (also optionally
pass the directory of a custom processor if any, more below).  Answer the
questions, end up with a `<XYZ>.fuzzer` file in same folder as pcap.

Run `mutiny.py <XYZ>.fuzzer <targetIP>` This will start fuzzing. Logs will be
saved in same folder, under directory
`<XYZ>_logs/<time_of_session>/<seed_number>`

## More Detailed Usage

### .fuzzer Files

The .fuzzer files are human-readable and commented.  They allow changing various
options on a per-fuzzer-file basis, including which message or message parts are
fuzzed.

### Message Formatting

Within a .fuzzer file is the message contents.  These are simply lines that
begin with either 'inbound' or 'outbound', signifying which direction the
message goes.  They are in Python string format, with '\xYY' being used for
non-printable characters.  These are autogenerated by 'mutiny_prep.py' and
Decept, but sometimes need to be manually modified.

### Message Formatting - Manual Editing

If a message has the 'fuzz' keyword after 'outbound', this indicates it is to be
fuzzed through Radamsa.  A given message can have line continuations, by simply
putting more message data in quotes on a new line.  In this case, this second
line will be merged with the first.

Alternatively, the 'sub' keyword can be used to indicate a subcomponent.  This
allows specifying a separate component of the message, in order to fuzz only
certain parts and for convenience within a Message Processor.

Here is an example arbitrary set of message data:
```
outbound 'say'
    ' hi'
sub fuzz ' and fuzz'
    ' this'
sub ' but not this\xde\xad\xbe\xef'
inbound 'this is the server's'
    ' expected response'
```

This will cause Mutiny to transmit `say hi and fuzz this but not
this(0xdeadbeef)`.  `0xdeadbeef` will be transmitted as 4 hex bytes.  `and fuzz
this` will be passed through Radamsa for fuzzing, but `say hi` and ` but not
this(0xdeadbeef)` will be left alone.

Mutiny will wait for a response from the server after transmitting the single
above message, due to the 'inbound' line.  The server's expected response is
`this is the server's expected response`.  Mutiny won't do a whole lot with this
data, aside from seeing if what the server actually sent matches this string.
If a crash occurs, Mutiny will log both the expected output from the server and
what the server actually replied with.

### Customization

mutiny_classes/ contains base classes for the Message Processor, Monitor, and
Exception Processor.  Any of these files can be copied into the same folder as
the .fuzzer (by default) or into a separate subfolder specified as the
'processor_dir' within the .fuzzer file.

These three classes allow for storing server responses and changing outgoing
messages, monitoring the target on a separate thread, and changing how Mutiny
handles exceptions.

### Customization - Message Processor

The Message Processor defines various callbacks that are called during a fuzzing
run.  Within these callbacks, any Python code can be run.  Anecdotally, these
are primarily used in three ways.

The most common is when the server sends tokens that need to be added to future
outbound messages.  For example, if Mutiny's first message logs in, and the
server responds with a session ID, the `postReceiveProcess()` callback can be used
to store that session ID.  Then, in `preSendProcess()`, the outgoing data can be
fixed up with that session ID.  An example of this is in
`sample_apps/session_server`.

Another common use of a Message Processor is to limit or change a fuzzed
message.  For example, if the server always drops messages greater than 1000
bytes, it may not be worth sending any large messages.  preSendProcess() can be
used to shorten messages after fuzzing but before they are sent or to raise an
exception.

Raising an exception brings up the final way Message Processors are commonly
used.  Within a callback, any custom exceptions defined in
`mutiny_classes/mutiny_exceptions.py` can be raised.  There are several
exceptions, all commented, that will cause various behaviors from Mutiny.  These
generally involve either logging, retrying, or aborting the current run.

### Customization - Monitor

The Monitor has a `monitorTarget()` function that is run on a separate thread from
the main Mutiny fuzzer.  The purpose is to allow implementing a long-running
process that can monitor a host in some fashion.  This can be anything that can
be done in Python, such as communicating with a monitor daemon running on the
target, reading a long file, or even just pinging the host repeatedly, depending
on the requirements of the fuzzing session.

If the Monitor detects a crash, it can call `signalMain()` at any time.  This will
signal the main Mutiny thread that a crash has occurred, and it will log the
crash.  This function should generally operate in an infinite loop, as returning
will cause the thread to terminate, and it will not be restarted.

### Customization - Exception Processor

The Exception Processor determines what Mutiny should do with a given exception
during a fuzz session.  In the most general sense, the `processException()`
function will translate Python and OS-level exceptions into Mutiny error
handling actions as best as it can.

For example, if Mutiny gets 'Connection Refused', the default response is to
assume that the target server has died unrecoverably, so Mutiny will log the
previous run and halt.  This is true in most cases, but this behavior can be
changed to that of any of the exceptions in
`mutiny_classes/mutiny_exceptions.py` as needed, allowing tailoring of crash
detection and error correction.

repository: Cisco-Talos/mutiny-fuzzer

gha_language: Python

gha_license_id: NOASSERTION

repo_name: Cisco-Talos/mutiny-fuzzer


text:
<!--title={user input: main() part 2}-->

<!--badges={Algorithmns:21}-->

<!--concepts{User Input}-->

# main() Part 2

In the else statement from when we've confirmed that the `grid` is complete, we need to stop our timer and compute the elapsed time. Also, we will print our now complete `grid`:

```python
	else:
		time2 = time.time()
		printGrid(grid)
		if time1 != 0:
			print("Solved in %0.2fs!" % (time2-time1))
		else:
			print("Solved!")
```

Step 1: Assign `time2` to `time.time()`.

This will give us the current time when we have reached inside this else statement.

Step 2: Check that `time1 != 0` to confirm that a time was recorded for `time1`.

Once this is done, we can compute the time spent to complete the Sudoku board with the computation `time2 - time1`.

Step 3: Call `printGrid(grid)` to print our final grid.

Now, we have finally finished our Sudoku Solver! This is how our logic will appear for user input options during the process of solving their valid Sudoku board:

```python
time1 = 0

c = input("Controls:\n\t'Enter': Display the next move\n\t'p': Print the current grid (small)\n\t'c': Complete the grid (or attempt to)\n\t'(r,c)': Prints the possible options for that row, column\n")
while hasMoves(grid) and (len(c) == 0 or c == "p" or c == "c" or c[0] == "("):
	if c == "p":
		printGrid(grid)
	elif c == "c":
		time1 = time.time()
		if not complete(grid):
			print("Failed to complete.  Please improve algorithm. :)")
			#break
	elif len(c) > 0 and c[0] == "(":
		print(findPossible(int(c[1])-1,int(c[3])-1,grid))
	else:
		nextMove(grid)

	if hasMoves(grid):
		c = input("Controls:\n\t'Enter': Display the next move\n\t'p': Print the current grid (small)\n\t'c': Complete the grid (or attempt to)\n\t'(r,c)': Prints the possible options for that row, column\n")
	else:
		time2 = time.time()
		printGrid(grid)
		if time1 != 0:
			print("Solved in %0.2fs!" % (time2-time1))
		else:
			print("Solved!")
```

That's it! We are done! Congratulations on completing the Sudoku Solver Lab!

repository: ShayanRiyaz/curriculum

repo_name: ShayanRiyaz/curriculum


text:
# Ditto
An Easy to Use Programming Language

## What it is
Ditto is a programming language whose syntax is very similar to English, making it easy to learn. It's best used as an introduction to the world of coding, by allowing newbie coders to construct code in an intuitive manner before moving on to learning proper syntax.

## How it works
Ditto accomplishes this by parsing the English text that the user writes and converting it into Javascript code that can run conventionally. By using Javascript, Ditto can also take advantage of its libraries to familiarize the user with their functions in a welcoming environment.

## Contributors

repository: BananiumLabs/Ditto

repo_name: BananiumLabs/Ditto


text:
This is a docker image for the Unix/Linux port of CircuitPython. It can be useful for running unit tests or trying out CircuitPython when you don't have access to a board.

A build for this image is available on Docker Hub at: https://hub.docker.com/r/jphalip/circuitpython-linux

repository: jphalip/docker-circuitpython-linux

repo_name: jphalip/docker-circuitpython-linux