text:
# unifi-video-api

[![Build Status](https://travis-ci.org/yuppity/unifi-video-api.svg?branch=master)](https://travis-ci.org/yuppity/unifi-video-api)
[![Documentation Status](https://readthedocs.org/projects/unifi-video-api/badge/?version=latest)](https://unifi-video-api.readthedocs.io/en/latest/?badge=latest)

Python API for interfacing with UniFi Video.

**Supported UniFi Video versions**: v3.9.12 to v3.10.13

**Supported Ubiquiti camera models**: UVC, UVC G3, UVC G3 Dome, UVC Dome, UVC Pro, UVC G3 Pro,
UVC G3 Flex, UVC Micro, UVC G3 Micro, airCam, airCam Dome, and airCam Mini, UVC G4 Bullet, UVC G4 Pro.

## Features
**For a single UniFi Video server**:
* Support both username/password and API key auths
* Provide GET, POST, PUT, and DELETE methods
* Handle session tracking and login when necessary
* Provide iterable collections for cameras and recordings that the UniFi Video server
  is aware of

**Per camera**:
* Set or show picture settings: brightness, contrast, saturation, hue, denoise,
  sharpness, dynamic range
* Set or show IR led state
* Set or show on-display text
* Set or show timestamp state
* Set or show watermark/logo state
* Set recording mode to fulltime, motion, or disabled
* Set recording pre/post padding
* Take and download pictures (snapshots)
* Download camera footage between arbitrary start and end times

**Per recording**:
* Delete
* Download
* Snapshot (thumbnail) download

## Installation

Either grab it from PyPI

```
pip install unifi-video
```

or download a release and manually place [unifi_video](unifi_video) in your project
directory, or any path in `$PYTHONPATH`.

You shouldn't need any external libraries, unless you want to run the tests or
build the docs (see [requirements_dev.txt](requirements_dev.txt)).
*unifi-video-api* does use the [six](https://pypi.org/project/six/) library but
will fallback to using the included *six* should it fail to import *six* from
system level packages.

Both python 2.7+ and python3 are supported.

## Usage

See the [docs](https://unifi-video-api.readthedocs.io/) for an API reference.

```python
from unifi_video import UnifiVideoAPI

# Default kwargs: addr = 'localhost', port = 7080, schema = http
uva = UnifiVideoAPI(username='username', password='password', addr='<IP_ADDRESS>')

# Use API key (can be set per user in Unifi NVR user settings)
uva = UnifiVideoAPI(api_key='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', addr='<IP_ADDRESS>')

# Skip version checking
uva = UnifiVideoAPI(api_key='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', addr='<IP_ADDRESS>',
  check_ufv_version=False)

# Use HTTPS and skip cert verification
uva = UnifiVideoAPI(api_key='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', addr='<IP_ADDRESS>',
  port=7443, schema='https', verify_cert=False)

# Save snapshot from camera whose id, name or onscreen display text
# is "Garage"
uva.get_camera('Garage').snapshot('some/path/snapshot.jpg')

# List all cameras UniFi Video is aware of
for camera in uva.cameras:
  print(camera)

# Save snapshot from every currently online camera managed by the UniFi Video
# instance. Default filepath: # ./snapshot_{camera ID}_{timestamp}.jpg
for camera in uva.active_cameras:
  camera.snapshot()

# List all cameras managed by the UniFi Video instance, online or not
for camera in uva.managed_cameras:
  camera.snapshot()

# Get footage from camera "Garage" for specific timespan.
# (The resulting file will be 0 bytes when no footage is found.)
uva.get_camera('Garage').recording_between('2018-12-01 00:00:00',
  '2018-12-01 00:05:00')

# Specify filename
uva.get_camera('Garage').recording_between('2018-12-01 00:00:00',
  '2018-12-01 00:05:00', 'first_mins_of_dec.mp4')

# Change onscreen display text
uva.get_camera('Garage').set_onscreen_text('Home garage')

# Set IR leds to auto mode
uva.get_camera('Garage').ir_leds('auto')

# Turn off IR leds (manual mode implied)
uva.get_camera('Garage').ir_leds('off')

# Turn on IR leds (manual mode implied)
uva.get_camera('Garage').ir_leds('on')

# Set camera to record at all times and to pre capture 5 secs
uva.get_camera('Garage').set_recording_settings('fulltime',
  pre_padding_secs=5)

# Set camera to record motion events only
uva.get_camera('Garage').set_recording_settings('motion')

# Disable recording altogether
uva.get_camera('Garage').set_recording_settings('disable')

# List recordings whose details were fetched during initialization
for rec in uva.recordings:
  print(rec)

# Download recording, write to local file recording01.mp4
uva.recordings['xxxxxxxxxxxxxxxxxxxx'].download('recording01.mp4')
```

## Warning
This software has been tested against a limited set of API versions and hardware.
While unlikely, should any of the POST payloads result in software or
hardware failure, the maintainer of this package is not liable.

Proceed at your own risk.


text:
fluxible-play
=============

Just a toy fluxible app...

Info about [fluxible](http://fluxible.io/quick-start.html).

## Setup

To get the app up and running on http://localhost:1337/

    npm install
    npm run dev

repository: wogsland/fluxible-play

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: wogsland/fluxible-play


text:
---
id: level1
title: "Level 1: Coding Basics"
---

Here you can find links to programming tutorials which you will use in your Data Science Practice. They will tend focus more on the fundamentals of the programming languages (such as syntax) and help you get comfortable with code.

## Python
Python is a more general programming language which made its way into becoming a powerful Data Science tool because of its readability and simplicity.
- [Learn Python 2](https://www.codecademy.com/learn/learn-python) - Codecademy
- [Python Tutorial](https://www.w3schools.com/python/) - w3schools
- [Introduction to Python](https://www.datacamp.com/courses/intro-to-python-for-data-science) - DataCamp
- [Learn Python - Full Course for Beginners](https://www.youtube.com/watch?v=rfscVS0vtbw) - freeCodeCamp.org (YouTube)

## R
R is a programming language which has its roots in the sciences and research. Its extensive background in statistics and computation makes it another powerful Data Science tool.
- [R Tutorial](https://www.tutorialspoint.com/r/index.htm) - tutorialspoint
- [Introduction to R](https://www.datacamp.com/courses/free-introduction-to-r) - DataCamp
- [R Tutorial For Beginners](https://www.youtube.com/watch?v=eDrhZb2onWY) - edureka! (YouTube)

## Python vs R
This is a question that is frequently asked. Many use both, some have strong preferences, and we don't want to say one is better than the other. These resources should help you which you might want to focus on or learn first!
- [Choosing R or Python for Data Analysis? An Infographic](https://www.datacamp.com/community/tutorials/r-or-python-for-data-analysis) - DataCamp
- [R vs Python](https://www.youtube.com/watch?v=js6C2mLXEDw) - edureka! (YouTube)

## SQL
SQL (or Sequel) is the most widely used database querying structures. If you wanna get data from your company's database, it's likely going to require you to use SQL.
- [Learn SQL](https://www.codecademy.com/learn/learn-sql) - Codecademy
- [SQL in a Nutshell: Part 1 — Basic Real-World Scenarios](https://towardsdatascience.com/sql-in-a-nutshell-part-1-basic-real-world-scenarios-33a25ba8d220) - Towards Data Science

## Unix Commands (to help you with the command line/prompt)
- [Basic UNIX commands](http://mally.stanford.edu/~sr/computing/basic-unix.html) - Stanford

## Disclaimer

This project is definitely a work in progress and we would love to see your contributions in this. Our limited experience will limit the resources shown here, but with your help we can make this the hub for anyone who wants to learn Data Science related skills and tools!

license: MIT

repository: enzoampil/DataRookiesLearningPortal

path: /docs/Level 1: Coding Basics.md

filename: Level 1: Coding Basics.md

repo_name: enzoampil/DataRookiesLearningPortal


text:
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 1.0.0 - 2019-08-06
### Added
- Created the validator factories based on the `ulrack/validator` package.
- Written unit tests.
- Added necessary documentation.

### Changed
- Nothing

### Deprecated
- Nothing

### Removed
- Nothing

### Fixed
- Nothing

### Security
- Nothing

[Unreleased]: https://github.com/ulrack/json-schema/compare/1.0.0...HEAD

repository: jokmontoya/json-schema

gha_license_id: MIT

repo_name: jokmontoya/json-schema


text:
# FBGEMM_GPU

[![FBGEMM_GPU CI](https://github.com/pytorch/FBGEMM/actions/workflows/fbgemm_gpu_ci.yml/badge.svg)](https://github.com/pytorch/FBGEMM/actions/workflows/fbgemm_gpu_ci.yml)
[![FBGEMM_GPU-CPU Nightly Build](https://github.com/pytorch/FBGEMM/actions/workflows/fbgemm_gpu_cpu_nightly.yml/badge.svg)](https://github.com/pytorch/FBGEMM/actions/workflows/fbgemm_gpu_cpu_nightly.yml)
[![FBGEMM_GPU-CUDA Nightly Build](https://github.com/pytorch/FBGEMM/actions/workflows/fbgemm_gpu_cuda_nightly.yml/badge.svg)](https://github.com/pytorch/FBGEMM/actions/workflows/fbgemm_gpu_cuda_nightly.yml)

FBGEMM_GPU (FBGEMM GPU Kernels Library) is a collection of high-performance PyTorch
GPU operator libraries for training and inference.  The library provides efficient
table batched embedding bag, data layout transformation, and quantization supports.

FBGEMM_GPU is currently tested with CUDA 11.7.1 and 11.8 in CI, and with PyTorch
packages that are built against those CUDA versions.

Only Intel/AMD CPUs with AVX2 extensions are currently supported.

## Build Instructions

This section is intended for FBGEMM_GPU developers.  The full build instructions
for the CUDA, ROCm, and CPU-only variants of FBGEMM_GPU can be found
[here](docs/BuildInstructions.md).

## Installation

### Install through PIP

Currently only built with sm70/80 (V100/A100 GPU) wheel supports:

```
# Release GPU
conda install pytorch cuda -c pytorch -c "nvidia/label/cuda-11.7.1"
pip install fbgemm-gpu

# Release CPU-only
conda install pytorch cuda -c pytorch -c "nvidia/label/cuda-11.7.1"
pip install fbgemm-gpu-cpu

# Nightly GPU
conda install pytorch cuda -c pytorch-nightly -c "nvidia/label/cuda-11.7.1"
pip install fbgemm-gpu-nightly

# Nightly CPU-only
pip install --pre torch -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html
pip install fbgemm-gpu-nightly-cpu
```

### Running FBGEMM_GPU

The tests (in test folder) and benchmarks (in bench folder) are some great
examples of using FBGEMM_GPU.  To run the tests or benchmarks after building
FBGEMM_GPU (if tests or benchmarks are built), use the following command:

```
# run the tests and benchmarks of table batched embedding bag op,
# data layout transform op, quantized ops, etc.
cd test
python split_table_batched_embeddings_test.py
python quantize_ops_test.py
python sparse_ops_test.py
python split_embedding_inference_converter_test.py
cd ../bench
python split_table_batched_embeddings_benchmark.py
```

To run the tests and benchmarks on a GPU-capable device in CPU-only mode use CUDA_VISIBLE_DEVICES=-1
```
CUDA_VISIBLE_DEVICES=-1 python split_table_batched_embeddings_test.py
```

### Run the tests on ROCm

Please add `FBGEMM_TEST_WITH_ROCM=1` flag when running tests on ROCm.
```
cd test
FBGEMM_TEST_WITH_ROCM=1 python split_table_batched_embeddings_test.py
```

### Benchmark Example

```bash
cd bench
python split_table_batched_embeddings_benchmark.py uvm
```

## Documentation

### How FBGEMM_GPU works

For a high-level overview, design philosophy and brief descriptions of various
parts of FBGEMM_GPU please see our Wiki (work in progress).

We have extensively used comments in our source files. The best and up-to-date
documentation is available in the source files.

### Building the API Documentation

See [docs/README.md](docs/README.md).

## Join the FBGEMM_GPU Community

For questions or feature requests, please file a ticket over on
[GitHub Issues](https://github.com/pytorch/FBGEMM/issues) or reach out to us on
the `#fbgemm` channel in [PyTorch Slack](https://bit.ly/ptslack).

For contributions, please see the [`CONTRIBUTING`](../CONTRIBUTING.md) file for
ways to help out.

## License

FBGEMM_GPU is BSD licensed, as found in the [`LICENSE`](../LICENSE) file.

repository: WilliamTambellini/FBGEMM

gha_license_id: NOASSERTION

repo_name: WilliamTambellini/FBGEMM


text:
> Decompose templates into small reusable pieces

## Basics
Sometimes you'll get into situation where you find out that your report templates are starting to be too complicated. The html gets bigger and you need to copy paste several parts between templates quite often. You may consider using `Child templates` extension in this situation.

`Child templates` allows you to include report templates into each other even in multiple levels. The realization of this is very easy. You just create a standard template for a part you want to reuse. Let's call it `Some table`. And then in every template  you want to use in just insert special tag `{#child Some table}`.

## How it works
`Child templates` works the way that for every report rendering it searches for special tag `{#child [name]}` and replaces it content with real report output. It basicaly calls whole rendering process for child template and includes result instead of `{#child [name]}` special tag.

**It's important to understand that child templates really do the whole rendering process and you probably want to set `recipe` of child templates to `html` otherwise jsreport will not be able to render root template with `phantom-pdf` recipe.**

> `Child templates` extension can be used to centralize your css styles into one child template and include css to all other templates.

## Set child template parameters

The root request input data cascade through child templates, but you can also pass additional data to the child template through its declaration
```html
{#child myChildTemplate @data.paramA=foo}
```

Or you can override existing child template attributes like its recipe.
```html
{#child myChildTemplate @template.recipe=html @options.language=sp}
```

## Using static content

`Child templates` really excels when you want to break a big template in separate child templates for better organization, this is the best use case for `Child templates` because it supports dynamic content just like normal templates, however if you only have static content (like a group of styles, [html layout](https://jsreport.net/blog/template-layouts), etc) the best option (simple and with more performance) is to use [assets](https://jsreport.net/learn/assets) extension to handle that kind of content.


text:
# DreamBot World Walker

Walker for DreamBot client which adds ability to traverse through dungeouns, caves, ships etc...

#### Usage

It's as simple as just doing the following:

```java
WorldWalking.walk(tile);
```

#### Adding nodes

You can check [WorldNodeFactory.java](https://github.com/0xNeffarion/DreamBot-WorldWalker/blob/master/src/com/neffware/api/walking/pathfinder/factory/WorldNodeFactory.java) for examples on a few places, including ship travelling with item requirements


text:
# unret

**unret** takes a regexp syntax tree generated by **ret** and converts it back to a string.

## Installation

```bash
$ npm install unret
```

## Usage

```js
var ret   = require("ret");
var unret = require("unret");

// Parse an expression with ret
var syntaxTree = ret(/regexp/.source);

// Manipulate the syntax tree
var newTree = doSomething(syntaxTree);

// Convert the syntax tree to a string
var newExpression = unret(newTree);

// Print the new expression
console.log(newExpression);

// Create a new RegExp object
var myExp = RegExp(newExpression);

// etc, etc
```

## Testing

Tests use Chai and Mocha.

```bash
$ npm test
```

## Limitations

Certain aspects of **ret**'s syntax tree mean that parsing an expression and then immediately converting it to a string will not return the original expression.

* Quantifier symbols - ```?, +, and *``` - are expanded to ```{min,max}``` quantifiers
* Character class escapes - ```\w, \d, etc``` - are expanded to the equivalent character class, e.g. ```[_a-zA-Z0-9]```
* Escaped characters - ```\n, \u0065, etc``` - are expanded to the equivalent character.

In these cases, **unret** does not attempt to guess the original notation or take an opinion on which is preferable. So long as **ret** is generating a syntax tree equivalent to the original expression, the string returned by **unret** should represent an equivalent expression.

In all cases, once a **ret** tree has been converted to a string by **unret**, parsing it with **ret** and again converting to a string (however many times) should yield the first string returned, i.e. a fixed point is reached.

repository: aimsc/unret

repo_name: aimsc/unret


text:
Chuusha (pronounced chew-sha) is a Rack adapter that treats your css and
javascript files as erb templates. It also provides a basic facility for
sharing constants between all your templates and the rest of your Rack stack.
It will continually evaluate templates in dev mode, while caching the rendered
template in production. It plays nicely with Rails's asset caching.

Installation and Usage
----------------------

First install the gem:

    $ gem install chuusha

Next, require the gem and tell your rack application to use chuusha. You will
need to point it at the directory containing your public assets.

    # in ./config.ru
    require 'chuusha'

    use Chuusha::Rack, File.dirname(__FILE__) + '/public'
    run Rack::URLMap.new("/" => YOUR_RAILS_APP::Application)

Now place a css erb template somewhere in '/public/stylesheets'

    # in ./public/stylesheets/application.css.erb

    <% highlight_color = "#fc6666" %>

    p.highlight {
      color: <%= highlight_color %>;
    }

    div.highlight {
      border: 1px solid <%= highlight_color %>;
    }

Common Variables
----------------

Occasionally, you'll want to share variables amongst many templates. To do so,
pass a hash of variables to Chuusha like so:

    use Chuusha::Rack,
        File.dirname(__FILE__) + '/public',
        { "variables" => { "highlight_color" => "#fc6666" }}

This would add `highlight_color` as a variable in both your css and js erb
templates.

On Heroku
---------

Since Heroku won't allow you write to the file system, you'll have to tell
Chuusha to write to /tmp. This is done by passing an output directory to
Chuusha like so:

    use Chuusha::Rack,
        File.dirname(__FILE__) + '/public',
        nil,
        File.dirname(__FILE__) + '/tmp'

Bugs
----

Chuusha is still pretty young and probably has bugs. Feel free to email me
(Trotter Cashion) at<EMAIL_ADDRESS>if you find anything. Alternately, you
can tweet me at @cashion, as I often respond more quickly to public humiliation
:-).

Acknowledgements
----------------

Thanks to [Mat Schaffer](http://matschaffer.com) for the name.

Thanks to [Barry O'Gorman](https://github.com/bogorman) for fixing Heroku
support.

repository: trotter/chuusha

repo_name: trotter/chuusha


text:
honest-profiler
===============

An attempt to have a usable and honest profiler for the JVM.

Design
------

The program has two major components. There is a small C++ jvmti agent which
writes out a log file describing a profile of the application it has been
attached to. Then a Java application can render/display a profile based on this
log. Generating a log means that profile can be analysed retrospective/offline.
It should be possible to do online profiling by writing the log file into a
memory mapped file which can then be concurrently read by the Java application.

Honest profiler takes the same approach outlined by Jeremy Manson where calls
are made to the `AsyncGetCallTrace` jvm method which avoids the need for threads
to reach a safe point in order to read their call trace. Consequently it avoids
a number of profiler accuracy issues that other sampling profilers suffer from.

The downside of using this method is that the code in your async callback has
horrific restrictions on it. What honest profiler does is copy the current
stack trace into a non-blocking, allocation free, circular MPSC queue. These
stack traces are then read by another thread which writes out the log file and
looks up information about useful things like methods names.

Based upon code originally open sourced by Jeremy Manson/Google:
http://jeremymanson.blogspot.co.uk/2013/07/lightweight-asynchronous-sampling.html

Compiling
---------

```
export LC_ALL=C
mvn package
```

If you just want to compile the C++ code then the `Makefile` works independently
of maven. You must have `$JAVA_HOME`  pointing to a JDK install in order to
compile the C++ component because it relies on jvmti.h.

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

For Java dependencies look in the `pom.xml` file.

unittest++ - a unit testing library
boost iostreams - used for portable memory mapped files

To install :

 * On debian/ubuntu:

        sudo apt-get install libunittest++-dev libboost-iostreams-dev

 * On Arch Linux:

        yaourt -S base-devel unittestpp boost boost-libs

Running
-------

*This isn't production ready code!*

* To run the jvmti agent: `java -agentpath:/path/to/location/liblagent.so <normal-java-commandline>`
* To run the gui client: `java -cp $JAVA_HOME/lib/tools.jar:target/honest-profiler-1.0-SNAPSHOT-jar-with-dependencies.jar com.insightfullogic.honest_profiler.javafx.JavaFXEntry`

repository: vyazelenko/honest-profiler

repo_name: vyazelenko/honest-profiler


text:
# cmd-vocabulary
Command line word of the day

## Usage
```
chmod +x cmd-vocabulary.sh
./cmd-vocabulary.sh -f your-vocabulary.txt
```

## Vocabulary file
Currently this could be any kind of text file. The command just prints a random line. That``'s all!

repository: johannesjo/cmd-vocabulary

repo_name: johannesjo/cmd-vocabulary


text:
# DiSCo Instrumentation Preprocessing Library

This extension for the DiSCo toolkit provides a CLI which can "preprocess" classes by performing
bytecode manipulation before runtime.

## Development

You may need to install the IntelliJ Lombok plugin for your project in order for the tests to pass.
Instructions can be found on [the plugin's readme](https://github.com/mplushnikov/lombok-intellij-plugin#installation).

repository: willarmiros/disco

repo_name: willarmiros/disco


text:
# CVE-2017-12945
## Exploit for CVE-2017-12945
A (remote) (authenticated) (blind) OS command injection vulnerability exists in Mersive Solstice Pods - a wireless collaboration and presentation platform designed by Mersive Technologies Inc. - running versions of the firmware prior to `2.8.4`, as acknowledged/reported on the vendor website, see the screenshot below. As a result, an authenticated adversary can run arbitrary commands (with root privileges) on vulnerable Mersive Solstice Pods by sending them crafted HTTP requests.

![changelog](images/changelog.png)

This vulnerability exists due to the lack of server-side inputs/parameters validation. Some user-controlled inputs/parameters are directly passed as arguments to a `public static String runShellCommand(String command)` method designed to execute OS commands under the context of the root user. This insecure configuration would allow an adversary to fully compromise vulnerable devices.

## References
Mitre CVE Reference:
* https://cve.mitre.org/cgi-bin/cvename.cgi?name=2017-12945

Vendor Change Log:
* https://documentation.mersive.com/content/pages/release-notes.htm

## Affected versions
Mersive Solstice Pods running versions of the firmware prior to `2.8.4`.

## Affected components
* `com/mersive/solstice/server/EthernetInterface.java`:
```java
static void SetPrefixLength(int prefixLength) {
    int value = -1 << (32 - prefixLength);
    try {
        Log.d("Ethernet", "complete: " + ServerDisplay.runShellCommand("ifconfig eth0 netmask " + InetAddress.getByAddress(new byte[]{(byte) (value >>> 24), (byte) ((value >> 16) & 255), (byte) ((value >> 8) & 255), (byte) (value & 255)}).getHostAddress()));
    } catch (Exception e) {
        e.printStackTrace();
    }
}

static void SetGateway(String gateway) {
    if (!gateway.equals(GetGateway())) {
        Log.d("Ethernet", "complete: " + ServerDisplay.runShellCommand("ip route del default"));
        Log.d("Ethernet", "complete: " + ServerDisplay.runShellCommand("ip route add default via " + gateway + " dev " + ETH0));
    }
}

static void SetStaticIP(String ipAddr) {
    Log.d("Ethernet", "complete: " + ServerDisplay.runShellCommand("ifconfig eth0 " + ipAddr));
}
```
* `com/mersive/solstice/server/ServerDisplay.java`:
 ```java
public static String runShellCommand(String command) {
    return runShellCommand(command, true);
}

public static String runShellCommand(String command, boolean wait) {
    Log.d("Shell Command", command);
    try {
        Process process = Runtime.getRuntime().exec("shell-tunnel --client");
        DataOutputStream stdin = new DataOutputStream(process.getOutputStream());
        InputStream is = process.getInputStream();
        stdin.writeBytes(command + "\n");
        stdin.flush();
        stdin.writeBytes("exit\n");
        stdin.flush();
        if (wait) {
            process.waitFor();
        }
        byte[] buffer = new byte[1024];
        Arrays.fill(buffer, 0);
        return new String(buffer, 0, is.read(buffer));
    } catch (Exception e) {
        e.printStackTrace();
        return "";
    }
}
```

## Attack vectors
To exploit this vulnerability, an authenticated adversary would need to send a specifically crafted request to devices running vulnerable version of the firmware (prior to `2.8.4`). This request could either be sent directly from the device web interface (from the `set static IP address` form) itself, or alternatively, it could be sent using a command line utility such as `cURL`.

In either case, the payload would need to be preceded by a special character instructing `/bin/sh` to run consecutive commands, e.g. the `;` or `&` character, for the payload to get executed after completion of the original/legitimate command.

The `staticIP` parameter which is one of the multiple vulnerable parameters along with the `gateway` parameter is not validated server-side and is instead directly passed as an argument to the `static void SetStaticIP(String ipAddr)` method which in turn passes it as an argument to the `public static String runShellCommand(String command)` method.

This configuration would allows an authenticated adversary to run arbitrary commands on vulnerable devices under the context of the root user.

## License
   Copyright (C) 2019 Alexandre Teyar

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.


text:
<!-- DO NOT EDIT THIS FILE! -->
<!-- Instead edit contrib/rollbar.php -->
<!-- Then run bin/docgen -->

# Rollbar Recipe

```php
require 'contrib/rollbar.php';
```

[Source](/contrib/rollbar.php)

## Configuration

- `rollbar_token` – access token to rollbar api
- `rollbar_comment` – comment about deploy, default to
  ```php
  set('rollbar_comment', '_{{user}}_ deploying `{{branch}}` to *{{target}}*');
  ```
- `rollbar_username` – rollbar user name

## Usage

Since you should only notify Rollbar channel of a successful deployment, the `rollbar:notify` task should be executed right at the end.

```php
after('deploy', 'rollbar:notify');
```

## Configuration
### rollbar_comment
[Source](https://github.com/deployphp/deployer/blob/master/contrib/rollbar.php#L26)

```php title="Default value"
'_{{user}}_ deploying `{{branch}}` to *{{target}}*'
```

## Tasks

### rollbar:notify
[Source](https://github.com/deployphp/deployer/blob/master/contrib/rollbar.php#L29)

Notifies Rollbar of deployment.

repository: littlekign/deployer

gha_language: PHP

repo_name: littlekign/deployer


text:
# leasing-stock-visualizer

A simple tool to visualize your consumed leasing capabilities, so you may see in an clear and concise way,
how much kilometers you can spent in the rest of your leasing time.

## server

The server is a simple rails app, that serves and saves data to a sqlite3 database. The leasing stock visualizer
is not dedicated to run in production now, so sqlite3 does fit our needs.

### install

Install ruby (tested with 2.2.3) e.g. via binary, homebrew or recommended via tools like rvm, rbenv, and similar.
After having a ruby version installed and running (`ruby -v` should deliver a valid version number without errors),
you should install *bundler*, by running `gem install bundler` (depending on your ruby installation it may be necessary,
to prefix your command with `sudo`).

### running

Simply run the server by starting it via `rails server`.

repository: mechanoid/leasing-stock-visualizer

repo_name: mechanoid/leasing-stock-visualizer


text:
# The Humboldt Data Science website, built using Jekyll

# How to update add a new post (new class)

Simply go to the _posts directory and create a new file named YYYY-MM-DD-FILENAME.md

(md means Markdown, with enables to easily create webpages, see e.g. [this](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet))

the file must starts with
```
---
layout: post
title: YOUR TITLE HERE
---

your markdown text here which will be visible in the preview of the class

<!--more-->

more text here only accessible if you clic on the lesson's page...
```
The post will then directly be visible in the "classes" except if you  add `visible: false` in the header of your new post.

**Done**

gha_language: CSS


text:
# internal-ip [![Build Status](https://travis-ci.org/sindresorhus/internal-ip.svg?branch=master)](https://travis-ci.org/sindresorhus/internal-ip)

> Get your internal IP address

## Install

```
$ npm install internal-ip
```

## Usage

```js
const internalIp = require('internal-ip');

(async () => {
	console.log(await internalIp.v6());
	//=> 'fe80::1'

	console.log(await internalIp.v4());
	//=> '<IP_ADDRESS>'
})();

console.log(internalIp.v6.sync())
//=> 'fe80::1'

console.log(internalIp.v4.sync())
//=> '<IP_ADDRESS>'
```

The module returns the address of the internet-facing interface, as determined from the default gateway. When the address cannot be determined for any reason, `null` will be returned.

The module relies on operating systems tools. On Linux and Android, the `ip` command must be available, which depending on distribution might not be installed by default. It is usually provided by the `iproute2` package.

## Related

- [internal-ip-cli](https://github.com/sindresorhus/internal-ip-cli) - CLI for this module
- [public-ip](https://github.com/sindresorhus/public-ip) - Get your public IP address
- [default-gateway](https://github.com/silverwind/default-gateway) - Get your default gateway address

## License

MIT © [Sindre Sorhus](https://sindresorhus.com)

repository: jeffmcfadden/PiThermostat

gha_language: Ruby

repo_name: jeffmcfadden/PiThermostat


text:
# Install Server

This guide provides instructions for developers to build and run cluster manager (supernode) from source code. The recommended deployment for the cluster manager is that at least two machines with at least 8-core 16G and best to provide Gigabit Ethernet.

## Step 1: Requirements
You can either deploy the cluster manager (supernode) on the Docker container or on the physical machine.

### 1. Deployed on the Docker container

Software              | Required Version
----------------------|--------------------------
Git                   | 1.9.1 +
Docker                | 1.12.0 +

### 2. Deployed on the physical machine

Software              | Required Version
----------------------|--------------------------
Git                   | 1.9.1 +
Jdk                   | 1.7 +
Maven                 | 3.0.3 +
Tomcat                | 7.0 +
Nginx                 | 0.8 +

## Step2: Getting the source code
   ```
   $ git clone https://github.com/alibaba/Dragonfly.git
   ```

## Step3：Build and run
### 1. Run on Docker
* Enter the project directory

   ```
   $ cd dragonfly
   ```
* Build Docker image

   - Build image

   ```
   $ docker image build -t "dragonfly:supernode" . -f ./build/supernode/Dockerfile
   ```
   - Show Docker image

   ```
   $ docker image ls
   ```
   - Get cluster manager (supernode) Docker imageId

   ```
   $ docker image ls|grep -E 'dragonfly.*supernode'|awk '{print $3}'
   ```
* Start Docker container

   ```
   $ docker run -d -p 8001:8001 -p 8002:8002 ${superNodeDockerImageId}
   ```

### 2. Run on physical machine
* Enter the project directory

   ```
   $ cd dragonfly/src/supernode
   ```
* Build the source code

   ```
   $ mvn clean -U install -DskipTests=true
   ```
* Deploy service on tomcat

   - Copy package to tomcat deployment directory

   ```
   $ copy target/supernode.war ${CATALINA_HOME}/webapps/supernode.war
   ```
   - Change context config of tomcat

   Add below config to server.xml of tomcat

   ```
   <Context path="/" docBase="${CATALINA_HOME}/webapps/supernode" debug="0" reloadable="true" crossContext="true" />

   ```
   - Start tomcat

   ```
   $ ./${CATALINA_HOME}/bin/catalina.sh run
   ```
* Start nginx

  - Add nginx config

  ```
  server {
        listen              8001;
        location / {
            root /home/admin/supernode/repo;
        }
    }

    server {
        listen              8002;
        location /peer {
            proxy_pass   http://<IP_ADDRESS>:8080;
        }
    }
  ```
  - Example of nginx config

  ```
  $ less dragonfly/build/supernode/docker/nginx/nginx.conf
  ```
  - Start nginx

  ```
  $ sudo nginx
  ```

  ## Step4: Verify installation
  - Check if nginx and tomcat is started and port (8001,8002) is available.

  ```
  $ ps aux|grep nginx
  $ ps aux|grep tomcat
  $ telnet <IP_ADDRESS> 8001
  $ telent <IP_ADDRESS> 8002
  ```
  - Install dragonfly client and use dragonfly client to download resource through dragonfly.

  ```
  $ dfget --url "http://${resourceUrl}" --output ./resource.png --node "<IP_ADDRESS>"
  ```


text:
# Installation and Usage

## In the browser

### As an ES6 module
```html
<script src="https://d3js.org/d3.v6.min.js"></script>
<script type="module" src="myScript.js"></script>
```
`myScript.js`:
```javascript
import { Model, View } from 'uki.esm.js';
```

### As a global variable
```html
<script src="https://d3js.org/d3.v6.min.js"></script>
<script<EMAIL_ADDRESS><script type="module" src="myScript.js"></script>
```
`myScript.js`:
```javascript
/* globals uki */
class Example extends uki.Model {
  ...
}
```

### Optional dependencies
Note that `uki.js` has an **optional** dependency if you happen to load LESS
resources. `uki.js` will auto-load `less.js` on its own from a CDN if it
discovers that it is missing.

If you already know that a page will need to load LESS resources, it's a good
idea for performance reasons to include `less.js` in the page's `<head>`, to
avoid waiting when `uki.js` discovers that it needs to fetch it before rendering
something:

```html
<head>
  <script src="https://d3js.org/d3.v6.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/less.js/4.1.1/less.min.js" data-log-level="1"></script>
  <script type="module" src="myApp.js"></script>
</head>
```

This can also be important if you need control over the specific version of a
library that you want `uki` to use, as well as if you're making something that
needs to work offline, like an Electron app—for the latter, you would point to
a local copy of the library that you need. `uki` will use whatever version of
the library is in the global scope if it exists.

## In Javascript bundle tool hell
One of the pipe dreams of `uki.js` is to enable a simpler coding workflow,
returning to native Javascript in the browser, with *ZERO BUILD STEPS* that
insist on a "right" way to do things.

But if you need to work with a bundler, at one point the following worked with
webpack as well as rollup (provided you have all the ES6/Babel magic properly
configured). However, I'm not actively testing this, so please file an issue if
you need it and it's not working.

```bash
npm install --save d3 uki
```
```javascript
import { Model, View } from 'uki';
```

## In Node.js
It doesn't usually make much sense to use `uki.js` outside of the
browser, but this can still be important for testing purposes, etc. This
*should* also work, but, like bundle tool hell, it's not being actively tested,
so please file an issue if this doesn't work:

```bash
npm install --save d3 uki
```
```javascript
const uki = require('uki');
```

repository: ukijs/uki

branch_name: refs/heads/main

gha_language: JavaScript

repo_name: ukijs/uki


text:
# Layers

There are several layers to the Open PRT structure. The names and ideas of each based on an abstration of the Internet's layered structure.

## Physical Link Layer

These are the physical components that make up the network's infastructure. Links are static connectors between nodes and can be very different from one another. Based on these differences nodes can decide which pods are capabable of using the link.

Features
- Connection Types
- Direction of Traffic Flow
- Capacity of Traffic Flow
- Load size
- Turning Degrees of Difficulty
- Max Speed

## PRT Layer

Made up of the PodCars which travel along the link layer and the nodes which direct them along the links.

### Nodes

Nodes are aware of the links around them and their features.

### PodCars

PodCars communicate with the Nodes to direct them to their destinations. They have assignments which they carry out. They inform the Nodes of their features.

Features
- Connection Types
- Turning Abilities
- Speed Abilities
- Load size
- Protocols Accepted

## Transport Layer

Are made up of the servers which know about the Nodes and PodCars in their zone. They are responsible for communicating tasks and other information to PodCars. There can be several protocols accepted such as a standard point-to-point protocol, freight may have special protocols with special instructions for loading and unloading, maintance protocols would be required to send to maintence PodCars. Because zones overlap, servers can specialize in different protocols and new protocols can be implented incrementally.

### Servers

- PodCars
- Nodes
- Zone
- Protocols Accepted

## Application Layer

APIs will be available for applications to make requests of the Transport Layer.

repository: wcatron/Open-PRT

repo_name: wcatron/Open-PRT


text:
# Heroku - Intro and Heroku Toolbelt Setup

---

- We will be using [Heroku](https://www.heroku.com/) for web hosting.

- Heroku specializes in Web Frameworks like Django, RubyOnRails, Node etc.

- Cool thing is you aren't required to know anything about running web-servers, no DevOPS needed.

- Just push code to Heroku much like git and you are good to go.

- Follow the instructions on this [link](https://devcenter.heroku.com/articles/heroku-cli) to setup heroku CLI on your local development environment.

- After CLI, we create a Procfile, it is sort of a descriptive file that lets Heroku know what kind of app we have flask, django, ruby etc.

- Go to flash >> wsgi.py file and see `flash.settings` that means flash is the name of our app, so we enter that in Procfile.

- Gunicorn is a web-server. Up till now we were using light-weight webserver that comes with Django to run and debug our app.

- For production we need a better web-server. That's why we use gunicorn web server for our needs.

- `pip install gunicorn`
- `pip install django_heroku`
- `pip install dj_database_url`
- `pip install python-decouple`

- We are almost done. Now we need to tinker with our settings.py file to customise it for Heroku and that will be all.

---

## Change settings.py file for Heroku

- Add these to `settings.py`

```python
import django_heroku
import dj_database_url
from decouple import config
```

- Go to MIDDLEWARE list in `**settings.py**` and add the following:
  `'whitenoise.middleware.WhiteNoiseMiddleware',`

- At the bottom of the page add this as well:

```python
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'

django_heroku.settings(locals())
```

- Whitenoise is for static files, that's all I know that we need to know for now. Will update here in future on whitenoise.

- `pip freeze` to see everything that is installed in the virtual env. Copy and paste these into requirements.txt file to tell heroku what are the packages needed by website.

---

# Push Code to Heroku

---

- Sign up for Heroku and Log In

- Type `heroku login` and browser will open with heroku follow the instructions to log in to heroku on your terminal.

- `heroku create` to create an app.

gha_language: Python


text:
# [MarkDown Link Suggestions](https://marketplace.visualstudio.com/items?itemName=TomasHubelbauer.vscode-markdown-link-suggestions)

[![](https://vsmarketplacebadge.apphb.com/installs-short/TomasHubelbauer.vscode-markdown-link-suggestions.svg)](https://marketplace.visualstudio.com/items?itemName=TomasHubelbauer.vscode-markdown-link-suggestions)
[![](https://vsmarketplacebadge.apphb.com/downloads-short/TomasHubelbauer.vscode-markdown-link-suggestions.svg)](https://marketplace.visualstudio.com/items?itemName=TomasHubelbauer.vscode-markdown-link-suggestions)

This extension is made obsolete by the VS Code native feature called
"Markdown path IntelliSense":

https://code.visualstudio.com/updates/v1_64#_markdown-path-intellisense

Please prefer this feature over an extension. Let me know if my extension offers
anything over this native feature and I will consider reducing its scope to that
instead of killing it off completely.

---

Suggests workspace files and MarkDown file headers in MarkDown links.

![Screenshot](screenshot.gif)

## Installing

Either [Click *Install* in the Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=TomasHubelbauer.vscode-markdown-link-suggestions)
or search for *markdown link suggestions* in VS Code Extensions pane.

## Updating

See the [release history](CHANGELOG.md).

Visual Studio Code will update the extension for you automatically by default.
If you wish to change this behavior, set `extensions.autoUpdate` configuration value to `false` in VS Code's `settings.json`.

## Running

- Run `npm run generate` first if you want to work on the link context recognizer spike
Use the VS Code *Extension* debug configuration by pressing F5.

## Testing

- Travis [![](https://travis-ci.org/TomasHubelbauer/vscode-markdown-link-suggestions.svg?branch=master)](https://travis-ci.org/TomasHubelbauer/vscode-markdown-link-suggestions) on Linux & macOS
- Azure CI:
  - [![](https://tomashubelbauer.visualstudio.com/VSCode/_apis/build/status/MarkDown%20Link%20Suggestions%20Windows)](https://tomashubelbauer.visualstudio.com/VSCode/_build/latest?definitionId=4) on Windows
  - [![](https://tomashubelbauer.visualstudio.com/VSCode/_apis/build/status/MarkDown%20Link%20Suggestions%20Linux)](https://tomashubelbauer.visualstudio.com/VSCode/_build/latest?definitionId=3) on Linux
  - [![](https://tomashubelbauer.visualstudio.com/VSCode/_apis/build/status/MarkDown%20Link%20Suggestions%20macOS)](https://tomashubelbauer.visualstudio.com/VSCode/_build/latest?definitionId=2) on macOS

Run tests either using VS Code *Extension Tests* debug configuration or by running a platform appropriate test command:

- `npm run test:posix`
- `npm run test:win32`

It's recommended the extension is tested locally for a few days before rolling it out after bigger changes have been made:

- Disable the installed Marketplace version of the extension
- Execute `vsce package`
- Verify only intended files are being packaged by inspecting the VSIX as a ZIP archive
- Use the *Install from VSIX…* command to install the VSIX package version

## Deploying

Deploying is not currently done on CI, instead it is manual:

## Publishing

- Run tests
- Update version
- Update changelog
- Execute `vsce publish`

## Contributing

- See [the todoes](todo)
- [ ] Fix tests after changing the document symbol provider and the diagnostics provider function

## Monitoring

This extension uses ApplicationInsights from Azure for telemetry and events collected include:

- activation
- suggestion
- deactivation

After initial testing, the event scope will be reduced to just suggestion errors to aid in fixing.

**If you'd prefer telemetry not be collected, pleae disable VS Code telemetry.**

[You can learn how to do so here](https://code.visualstudio.com/docs/supporting/FAQ#_how-to-disable-telemetry-reporting).

The extension respects the VS Code setting and will not send telemetry events against your wishes.

**If you want concerns about the scope of the data collected:**

[MarkDown-Link-Suggestions -<EMAIL_ADDRESS>
Unfortunately, it doesn't appear as though Application Insights can be made public for reading,
but I will be happy to invite any concerned users to the Azure Application Insights resource
so that you can do an informed decision about whether using this extension with telemetry
enabled is acceptable for you or not.


text:
# Initial Access

> Initial Access Files in the context of a Red Team exercise refer to the set of files, scripts, executables, or documents used by the Red Team to initially infiltrate the target system or network. These files often contain malicious payloads or are designed to exploit specific vulnerabilities in order to establish a foothold in the target environment.

## Summary

* [Complex Chains](#complex-chains)
* [Container](#container)
* [Payload](#payload)
    * [Binary Files](#binary-files)
    * [Code Execution Files](#code-execution-files)
    * [Embedded Files](#embedded-files)
* [Code Signing](#code-signing)

## Complex Chains

> DELIVERY(CONTAINER(TRIGGER + PAYLOAD + DECOY))

* **DELIVERY**: means to deliver a pack full of files
    * HTML Smuggling, SVG Smuggling, Attachments
* **CONTAINER**: archive bundling all infection dependencies
    * ISO/IMG, ZIP, WIM
* **TRIGGER**: some way to run the payload
    * LNK, CHM, ClickOnce applications
* **PAYLOAD**: the malware
    * Binary Files
    * Code Execution Files
    * Embedded Files
* **DECOY**: used to continue pretext narration after detonating malware
    * Typically open PDF files

Examples:
* HTML SMUGGLING(PASSWORD PROTECTED ZIP + ISO(LNK + IcedID  + PNG)) used by [TA551/Storm-0303](https://thedfirreport.com/2023/08/28/html-smuggling-leads-to-domain-wide-ransomware/)

## Container

* **ISO/IMG** - can contain hidden files, gets **automounted** giving easy access to contained files (`powershell –c .\malware.exe`)
* **ZIP** - can contain hidden files (locate ZIP + unpack it + change dir + run Malware)
* **WIM** - Windows Image, builtin format used to deploy system features
    ```ps1
    # Mount/Unmount .WIM
    PS> Mount-WindowsImage -ImagePath myarchive.wim -Path "C:\output\path\to\extract" -Index 1
    PS> Dismount-WindowsImage -Path "C:\output\path\to\extract" -Discard
    ```
* **7-zip, RAR, GZ** - should get a native support on Windows 11

## Trigger

* **LNK**
* **CHM**
* **ClickOnce**

## Payload

### Binary Files

These files can be executed directly on the system without any third party.

* **.exe** file, executable file can be run with a click
* **.dll** file, execute with `rundll32 main.dll,DllMain`
    ```c
    #define WIN32_LEAN_AND_MEAN
    #include <windows.h>

    extern "C" __declspec(dllexport)
    DWORD WINAPI MessageBoxThread(LPVOID lpParam) {
    MessageBox(NULL, "Hello world!", "Hello World!", NULL);
    return 0;
    }

    extern "C" __declspec(dllexport)
    BOOL APIENTRY DllMain(HMODULE hModule,
                        DWORD ul_reason_for_call,
                        LPVOID lpReserved) {
    switch (ul_reason_for_call) {
        case DLL_PROCESS_ATTACH:
        CreateThread(NULL, NULL, MessageBoxThread, NULL, NULL, NULL);
        break;
        case DLL_THREAD_ATTACH:
        case DLL_THREAD_DETACH:
        case DLL_PROCESS_DETACH:
        break;
    }
    return TRUE;
    }
    ```
* **.cpl** file, same as a .dll file with Cplapplet export
    ```c
    #include "stdafx.h"
    #include <Windows.h>

    extern "C" __declspec(dllexport) LONG Cplapplet(
        HWND hwndCpl,
        UINT msg,
        LPARAM lParam1,
        LPARAM lParam2
    )
    {
        MessageBoxA(NULL, "Hey there, I am now your control panel item you know.", "Control Panel", 0);
        return 1;
    }

    BOOL APIENTRY DllMain( HMODULE hModule,
                        DWORD  ul_reason_for_call,
                        LPVOID lpReserved
                        )
    {
        switch (ul_reason_for_call)
        {
        case DLL_PROCESS_ATTACH:
        {
            Cplapplet(NULL, NULL, NULL, NULL);
        }
        case DLL_THREAD_ATTACH:
        case DLL_THREAD_DETACH:
        case DLL_PROCESS_DETACH:
            break;
        }
        return TRUE;
    }
    ```

### Code Execution Files

* Word with Macro (.doc, .docm)
* Excel library (.xll)
* Excel macro-enabled add-in file (.xlam)
    ```ps1
    xcopy /Q/R/S/Y/H/G/I evil.ini %APPDATA%\Microsoft\Excel\XLSTART
    ```
* WSF files (.wsf)
* MSI installers (.msi)
    ```ps1
    powershell Unblock-File evil.msi; msiexec /q /i .\evil.msi
    ```
* MSIX/APPX app package (.msix, .appx)
* ClickOnce (.application, .vsto, .appref-ms)
* Powershell scripts (.ps1)
* Windows Script Host scripts (.wsh, .vbs)
    ```ps1
    cscript.exe payload.vbs
    wscript payload.vbs
    wscript /e:VBScript payload.txt
    ```

### Embedded Files

* ICS Calendar Invites with Embedded Files

## Code Signing

Certificate can be **Expired**, **Revoked**, **Valid**.

Many certificates leaked on the Internet and got re-used by Threat Actor.
Some of them can be found on VirusTotal, with the query :  `content:{02 01 03 30}@4 AND NOT tag:peexe`

In 2022, LAPSUS$ claimed responsibility for a cyberattack on NVIDIA, a major graphics card and AI technology manufacturer. As part of this attack, LAPSUS$ allegedly stole proprietary data from NVIDIA and threatened to leak it. The leak contained

* Certificates can be password protected. Use [pfx2john.py](https://gist.github.com/tijme/86edd06c636ad06c306111fcec4125ba)
    ```ps1
    john --wordlist=/opt/wordlists/rockyou.txt --format=pfx pfx.hashes
    ```
* Sign a binary with a certificate.
    ```ps1
    osslsigncode sign -pkcs12 certs/nvidia-2014.pfx -in mimikatz.exe -out generated/signed-mimikatz.exe -pass nv1d1aRules
    ```
* The following files can be signed with a certificate
    * executables: .exe, .dll, .ocx, .xll, .wll
    * scripts: .vbs, .js, .ps1
    * installers: .msi, .msix, .appx, .msixbundle, .appxbundle
    * drivers: .sys
    * cabinets: .cab
    * ClickOnce: .application, .manifest, .vsto

## References

* [Top 10 Payloads: Highlighting Notable and Trending Techniques - delivr.to](https://blog.delivr.to/delivr-tos-top-10-payloads-highlighting-notable-and-trending-techniques-fb5e9fdd9356)
* [Executing Code as a Control Panel Item through an Exported Cplapplet Function - @spotheplanet](https://www.ired.team/offensive-security/code-execution/executing-code-in-control-panel-item-through-an-exported-cplapplet-function)
* [Desperate Infection Chains - Multi-Step Initial Access Strategies by Mariusz Banach - x33fcon Youtube](https://youtu.be/CwNPP_Xfrts)
* [Desperate Infection Chains - Multi-Step Initial Access Strategies by Mariusz Banach - x33fcon PDF](https://binary-offensive.com/files/x33fcon%20-%20Desperate%20Infection%20Chains.pdf)
* [Red Macros Factory - https://binary-offensive.com/](https://binary-offensive.com/initial-access-framework)

repository: dstrozynski/PayloadsAllTheThings

path: /Methodology and Resources/Initial Access.md

filename: Initial Access.md

repo_name: dstrozynski/PayloadsAllTheThings


text:
# NetworkingX

## Introduction

NetworkingX is a clean, lightweight framework for making HTTP requests built over the `URLSession` of `swift` language. The main objective of this framework is to separate the networking protocols in smaller steps, giving us extra flexibility in code management.

## Requirements

- iOS 10.0+ / macOS 10.12+ / tvOS 10.0+ / watchOS 3.0+
- Xcode 11+
- Swift 5.1+

## Installation

### CocoaPods

[CocoaPods](https://cocoapods.org) is a dependency manager for Cocoa projects. To install NetworkingX, simply add the following line to your `Podfile`:

```ruby
pod 'NetworkingX'
```

### Swift Package Manager

The [Swift Package Manager](https://swift.org/package-manager/) is a tool for automating the distribution of Swift code and is integrated into the `swift` compiler. NetworkingX also support its use on supported platforms.

Once you have your Swift package set up, adding NetworkingX as a dependency is as easy as adding it to the `dependencies` value of your `Package.swift`.

```swift
dependencies: [
    .package(url: "https://github.com/prashantLalShrestha/NetworkingX.git", .upToNextMajor(from: "1.3.0"))
]
```

## Usage

NetworkingX is  quite simple to use. However there are some of the protocols and classes to take notes of.

### NetworkConfigurable

It is a protocol implemented to configure the base HTTP network configurations. This includes the base url of the hosted address, common headers and common query parameters.

```swift
public protocol NetworkConfigurable {
    var baseURL: URL { get }
    var headers: [String: String] { get }
    var queryParameters: [String: String] { get }
}
```

We can create an object from it's default implementation `ApiDataNetworkConfig`.
```swift
let config = ApiDataNetworkConfig(baseURL: URL(string: "https://url.to.api/"))
```

### NetworkService

A service protocols used to make HTTP requests. It's default implementation `DefaultNetworkService` wraps the `URLSession().dataTask` function. You can use this protocol to create your own implementation, for example, using `Alamofire`.

```swift
public protocol NetworkService {
    typealias CompletionHandler = (Result<Data?, NetworkError>) -> Void

    func request(endpoint: Requestable, completion: @escaping CompletionHandler) -> NetworkCallable?
}
```

The above made network `config` object is used in NetworkService. We can create a NetworkService object as:
```swift
let networkService = DefaultNetworkService(config: config)
```

### NetworkSessionManager
NetworkSessionManager works as an interceptor in between HTTP requests. We can use this protocol to maintain the access tokens, authentications.
```swift
public protocol NetworkSessionManager {
    var acceptableStatusCodes: [Int] { get }
    typealias CompletionHandler = (Data?, URLResponse?, Error?) -> Void

    func request(_ request: URLRequest,
                 completion: @escaping CompletionHandler) -> NetworkCallable
}
```

Typically, we use `NetworkSessionManager` in our `NetworkService` class.
```swift
let networkService = DefaultNetworkService(config: config, sessionManager: DefaultNetworkSessionManager())
```

### Endpoint
We create an endpoint for each network api calls. `Endpoint` implements the protocol `Requestable`
```swift
public protocol Requestable {
    var path: String { get }
    var isFullPath: Bool { get }
    var method: HTTPMethodType { get }
    var headerParamaters: [String: String] { get }
    var queryParametersEncodable: Encodable? { get }
    var queryParameters: [String: Any] { get }
    var bodyParamatersEncodable: Encodable? { get }
    var bodyParamaters: [String: Any] { get }
    var bodyEncoding: ParameterEncoding { get }

    func urlRequest(with networkConfig: NetworkConfigurable) throws -> URLRequest
}
```

As you can see in the above protocol, we will be defining our api call configurations in here.
```swift
struct Endpoints {
    static func authenticateUser(request: UserAuthenticationRequest) -> Endpoint<UserAuthenticationResponse> {
        return Endpoint(path: "path/of/login",
                        method: .post,
                        bodyParamatersEncodable: request,
                        bodyEncoding: URLEncoding.default
        )
    }
}

```

### ParameterEncoding
A type used to define how a set of parameters are applied to a `URLRequest`. There are some inbuilt ParameterEncoding implementations in the framework.
 - URLEncoding
 - JSONEncoding
 - XMLEncoding
 - MultiPartEncoding

However, you can create your own Encoding implementation using this protocol and use it in your `Endpoint`.

### DataTransferService
DataTransferService is a place where most of the work is done with the help of `Endpoint`, `NetworkService` and `ErrorResolver`.
```swift
public protocol DataTransferService {
    typealias CompletionHandler<T> = (Result<T, DataTransferError>) -> Void

    @discardableResult
    func request<T: Decodable, E: ResponseRequestable>(with endpoint: E,
                                                       completion: @escaping CompletionHandler<T>) -> NetworkCallable? where E.Response == T

    @discardableResult
    func request<E: ResponseRequestable>(with endpoint: E,
                                         completion: @escaping CompletionHandler<Void>) -> NetworkCallable? where E.Response == Void
}
```

For simplicity, you can use the default implementation `DefaultDataTransferService` as:
```swift
let dataTransferService = DefaultDataTransferService(with: networkService)
```

### DataTransferErrorResolver
It is used to resolve the `NetworkError` in the form of `DataTransferError`. We can create an implementation class for this protocol to map our errors.
```swift
public protocol DataTransferErrorResolver {
    func resolve(error: NetworkError) -> Error
}
```

And, use it in `DefaultDataTransferService` as:
```swift
let dataTransferService = DefaultDataTransferService(with: networkService,
                                                             errorResolver: DefaultDataTransferErrorResolver())
```

### Now the sweet part,
After setting up our `NetworkConfig`, `NetworkSessionManager`, `NetworkService`, `Endpoint`, `DataTransferService`, we are now ready to make our network request,
```swift
let request = UserAuthenticationRequest(userName: "username", loginPassword: "password")

let endpoint = Endpoints.authenticateUser(request: request)
let task = dataTransferService.request(with: endpoint) { result in
    switch result {
    case .success(let response):
        // TODO: Update UI
    case .failure(let error):
        // TODO: Handle Errors in UI
    }
}
task?.resume()

```

The main objective of this framework is to separate the networking protocols in smaller steps, giving us extra flexibility in code management expecially in, `Clean Architecture`.

repository: karkipsn/NetworkingX

repo_name: karkipsn/NetworkingX


text:
# Chapter 1 - Introduction

<!-- TOC -->

- [Chapter 1 - Introduction](#chapter-1---introduction)
  - [What Operating Systems Do](#what-operating-systems-do)
    - [User View](#user-view)
    - [System View](#system-view)
    - [Defining Operating Systems](#defining-operating-systems)
  - [Computer-System Organization](#computer-system-organization)
    - [Interrupts](#interrupts)
      - [Overview](#overview)
      - [Implementation](#implementation)
    - [Storage Structure](#storage-structure)
    - [I/O Structure](#io-structure)
  - [Computer-System Architecture](#computer-system-architecture)
    - [Single-Processor Systems](#single-processor-systems)
    - [Multiprocessor Systems](#multiprocessor-systems)
    - [Clustered systems](#clustered-systems)
  - [Operating-Systems Operations](#operating-systems-operations)
    - [Multiprogramming and Multitasking](#multiprogramming-and-multitasking)
    - [Dual-Mode and Multimode Operation](#dual-mode-and-multimode-operation)
    - [Timer](#timer)
  - [Resource Management](#resource-management)
    - [Process Management](#process-management)
    - [Memory Management](#memory-management)
    - [File-System Management](#file-system-management)
    - [Mass-Storage Management](#mass-storage-management)
    - [Cache Management](#cache-management)
    - [I/O System Management](#io-system-management)
  - [Security and Protection](#security-and-protection)
  - [Virtualization](#virtualization)
  - [Distributed Systems](#distributed-systems)
  - [Kernel Data Structures](#kernel-data-structures)
    - [Lists, Stacks, and Queues](#lists-stacks-and-queues)
    - [Trees](#trees)
    - [Hash Functions and Maps](#hash-functions-and-maps)
    - [Bitmaps](#bitmaps)
  - [Computing Environments](#computing-environments)
    - [Traditional Computing](#traditional-computing)
    - [Mobile Computing](#mobile-computing)
    - [Client-Server Computing](#client-server-computing)
    - [Peer-to-Peer Computing](#peer-to-peer-computing)
    - [Cloud Computing](#cloud-computing)
    - [Real-Time Embedded Systems](#real-time-embedded-systems)
  - [Free and Open-Source Operating Systems](#free-and-open-source-operating-systems)
    - [History](#history)
    - [Free Operating Systems](#free-operating-systems)
    - [GNU/Linux](#gnulinux)
    - [BSD Linux](#bsd-linux)
    - [Solaris](#solaris)
    - [Open-Source Systems as Learning Tools](#open-source-systems-as-learning-tools)
  - [Summary](#summary)

<!-- /TOC -->

---

## What Operating Systems Do

- A Computer system can be divided into roughly four components
  - the ***Hardware***
  - the ***Operating System***
  - the ***Application Programs***
  - the ***User***

- **The Hardware**
  - the Central Processing Unit (CPU)
  - the Memory (RAM, Cache, Registers)
  - the input/output (I/O) devices
- **The Application Program**
  - define ways in which the resources are used to solve users' computing problems'
  - Ex: Word processors, spreadsheets. compliers, web browsers
- **The Operating System**
  - Controls hardware
  - Manages Resources

> An operating System is similar to a government. Like a government, it performs no useful function by itself.

### User View

***The User view varies according t the interface being used***

- Laptops and Desktops are optimized for single use(one user at a time). So their OS's are:
  - designed for *ease of use*
  - designed with performance and security focuses
  - no focus on **resource utilization**

Some devices offer little to no user view, i.e ***embedded computers***

### System View

The Operating System is most intimately involved with the hardware as a ***resource allocator***.

Many resources are involved in problem solving:

- CPU Time
- Memory Space
- Storage space
- I/O Devices
- etc.

The OS arbitrates over all the requests and organizes them to operate the system efficiently and fairly.

A Operating system is a **Control Program**. A Control Program manages the execution of ser programs to prevent errors and improper use of the computer.

### Defining Operating Systems

Operating Systems are many and varied because of the multitude of designs and uses for computers.

How can we define what an operating system is?

- Operating systems exist because they offer a reasonable way to solve the problem of creating a useable computing system.
  - Goal: utilize hardware _==>_ execute programs _==>_ _**make problem solving easier**_

> Since bad hardware alone is not particularly useful, application programs are developed.

A _common definition_ is is that the operating system is the one program running at all time on the computer - commonly know as the **kernel**.

Along with the _kernel_ there are two other types of programs:

- **System Programs**
  - associated with operating system but are not necessarily part of the kernel
- **Application Programs**
  - include all programs not associated with the operation of the system
  - require OSs for common operating methods like controlling I/O and allocating system resources.

**Middleware** - a set of software frameworks that provide additional services to application developers.

- packaged with a kernel to support things like:
  - databases
  - multimedia
  - graphics

***Summary***:

- An OS includes
  - a Kernel
    - always running
  - Middleware frameworks
    - to ease application development
  - system programs
    - aid in managing the system at runtime

## Computer-System Organization

Modern general purpose computer contain [1,n) CPUs and a number of other device controllers connected through a common bus

A **Bus** connects multiple hardware pieces and provides access between these components and shared memory.

Device controllers are in charge of specific types of devices (disk drive, graphics displays, memory, etc.), and usually have:

- Local buffer storage
- special purpose registers

The device controller is responsible for moving data between its devices and its local storage buffer.

A **Device Driver** is common in many OSs and is available for each device controller. A _device driver_:

- understands the device controller
- provides the rest of an OS with a uniform interface for that controller

The CPU and device controllers can run in parallel.

### Interrupts

Consider a typical computer operation: I/O

To start I/O:

- the driver loads the controller's registers
- the controller examines register contents to determine an action (i.e "read a character")
- Controller starts a transfer to the local buffer
- On completing, the controller informs the driver
- the driver then gives controller to other parts of the OS

So how does the controller inform the driver that it has completed its task? ***Interrupts***

#### Overview

Hardware may trigger an interrupt at any time, via a system bus. There may be many buses within a system, but the **system bus is the main communications path between major components.**

_Interrupts are a key part of how Operating Systems and Hardware interact._

When the CPU is interrupted, it stops executing and immediately transfers execution to a _fixed location_. The fixed location usually contains address where the service routine for the interrupt is located. The interrupt service routing is executed, then the CPU resumes the interrupted execution.

Interrupts are important to computer architecture and while many have their own interrupt mechanisms they chare several common functions.

Interrupts must be handed quickly, as _they occur very frequently_.

- A array of pointers to interrupt routines is kept for speed
  - The routines are called indirectly through this array
  - This is usually kept in low memory (first hundred locations)

This **interrupt vector** is indexed by a unique number, along with the interrupt request, to provide an address to the interrupt service routines

Interrupt architecture must also save state information, so it can later restore interrupted processes.

#### Implementation

Interrupts work as follow:

- The CPU has an **interrupt-request-line** that senses every after every executing instruction
  - When the CPU detects a signal from a controller it:
    - Reads in the interrupt number and jumps tp the **interrupt-handler-routine**,
    using the interrupt number as an index in the _interrupt vector_
    - It then starts execution at that address
  - The interrupt handler:
    - Saves and state it will be changing during its operation
    - determines the cause of the interrupt
    - performs the necessary processing
    - performs a state restore
    - executes a **return_from_interrupt** to return the CPU to the execution state prior ti the interrupt

A device controller _raises_ an interrupt by asserting a signal on the interrupt-request-line, the CPU _catches_ an interrupt and _dispatches_ it to the interrupt handler, and the handler _clears_ the interrupt by servicing the device.

### Storage Structure

### I/O Structure

## Computer-System Architecture

### Single-Processor Systems

### Multiprocessor Systems

### Clustered systems

## Operating-Systems Operations

### Multiprogramming and Multitasking

### Dual-Mode and Multimode Operation

### Timer

## Resource Management

### Process Management

### Memory Management

### File-System Management

### Mass-Storage Management

### Cache Management

### I/O System Management

## Security and Protection

## Virtualization

## Distributed Systems

## Kernel Data Structures

### Lists, Stacks, and Queues

### Trees

### Hash Functions and Maps

### Bitmaps

## Computing Environments

### Traditional Computing

### Mobile Computing

### Client-Server Computing

### Peer-to-Peer Computing

### Cloud Computing

### Real-Time Embedded Systems

## Free and Open-Source Operating Systems

### History

### Free Operating Systems

### GNU/Linux

### BSD Linux

### Solaris

### Open-Source Systems as Learning Tools

## Summary

repository: Samwisebuze/OperatingSystems-Notes

repo_name: Samwisebuze/OperatingSystems-Notes


text:
# DalSoft.RestClient

[![Help and chat on Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/DalSoft-RestClient)

Inspired by Simple.Data and AngularJS's $http service, DalSoft.RestClient is a very lightweight wrapper around System.Net.HttpClient that uses the dynamic features of .NET 4 to provide a fluent way of accessing RESTFul API's.

Originally created to remove the boilerplate code involved in creating integration tests and SDK's for RESTFul API's. I know there are a couple of dynamic rest clients out there but I wanted the syntax to look a particular way, and I wanted it to be particularly useful for testing.

> DalSoft.RestClient is biased towards RESTFul API's returning JSON - if you don't provide Accept and Content-Type headers then they are set to `application/json`. [See Working with non JSON content](https://github.com/DalSoft/DalSoft.RestClient/wiki/Working-with-non-JSON-content)

## Supported Platforms

DalSoft.RestClient targets .NET Standard 1.4 therefore supports Windows, Linux, Mac and Xamarin (iOS, Android and UWP).

## Getting Started

Install via NuGet

```dos
PM> Install-Package DalSoft.RestClient
```

You start by new'ing up the RestClient and passing in the base uri for your RESTful API. Then simply chain members that would make up the resource you want to access - ending with the HTTP method you want to use. The example below will perform a GET on http://jsonplaceholder.typicode.com/users/:

```cs
dynamic client = new RestClient("http://jsonplaceholder.typicode.com");

await client.Users.Get();
```
> Note all HTTP methods are async

## New in Version 3.0 Pipeline Awesomeness!

See [Configuration, Plugins and Pipeline](https://github.com/DalSoft/DalSoft.RestClient/wiki/Configuration,-Plugins-and-Pipeline)

## Breaking Change Since Version 3.1
Since version 3.1 the DefaultRequestHeaders Dictionary is readonly the only way to add DefaultHeaders is passing a Dictionary to the [constructor](https://github.com/DalSoft/DalSoft.RestClient/wiki/Headers). You can add/override the headers on a per request basis using the [Headers](https://github.com/DalSoft/DalSoft.RestClient/wiki/Headers#per-request-headers) method.

~~client.DefaultRequestHeaders.Add("Accept", "application/json");~~ //Not supported since version 3.1

## Everything You Need To Know

* [Getting Started](https://github.com/DalSoft/DalSoft.RestClient/wiki/Getting-Started)

* [Supported Platforms](https://github.com/DalSoft/DalSoft.RestClient/wiki/Supported-Platforms)

* [How to Access Resources](https://github.com/DalSoft/DalSoft.RestClient/wiki/How-to-Access-Resources)

* [Get, Delete, Head](https://github.com/DalSoft/DalSoft.RestClient/wiki/Get,-Delete,-Head)

* [Query Strings](https://github.com/DalSoft/DalSoft.RestClient/wiki/Query-Strings)

* [Put, Post, Patch](https://github.com/DalSoft/DalSoft.RestClient/wiki/Put,-Post,-Patch)

* [Headers](https://github.com/DalSoft/DalSoft.RestClient/wiki/Headers)
  * [Default Headers](https://github.com/DalSoft/DalSoft.RestClient/wiki/Headers#default-headers)
    * [Breaking Change Since Version 3.1](https://github.com/DalSoft/DalSoft.RestClient/wiki/Headers#breaking-change-since-version-31)
  * [Per Request Headers](https://github.com/DalSoft/DalSoft.RestClient/wiki/Headers#per-request-headers)

* [Dynamic Binding](https://github.com/DalSoft/DalSoft.RestClient/wiki/Dynamic-Binding)
  * [Requests](https://github.com/DalSoft/DalSoft.RestClient/wiki/Dynamic-Binding#requests)
  * [Responses](https://github.com/DalSoft/DalSoft.RestClient/wiki/Dynamic-Binding#responses)
  * [HttpResponseMessage](https://github.com/DalSoft/DalSoft.RestClient/wiki/Dynamic-Binding#httpresponsemessage)
  * [Casting](https://github.com/DalSoft/DalSoft.RestClient/wiki/Dynamic-Binding#casting)
    * [Implicit casting](https://github.com/DalSoft/DalSoft.RestClient/wiki/Dynamic-Binding#implicit-casting)
    * [Collections](https://github.com/DalSoft/DalSoft.RestClient/wiki/Dynamic-Binding#collections)
    * [Mapping your models using Json.NET](https://github.com/DalSoft/DalSoft.RestClient/wiki/Dynamic-Binding#mapping-your-models-using-jsonnet)

**Advanced**
* [Working with non JSON content](https://github.com/DalSoft/DalSoft.RestClient/wiki/Working-with-non-JSON-content)
  * [Posting forms](https://github.com/DalSoft/DalSoft.RestClient/wiki/Available-Plugins#formurlencodedhandler)
  * [Posting files](https://github.com/DalSoft/DalSoft.RestClient/wiki/Available-Plugins#multipartformdatahandler)

* [Configuration, Plugins and Pipeline](https://github.com/DalSoft/DalSoft.RestClient/wiki/Configuration,-Plugins-and-Pipeline)

* [Available plugins](https://github.com/DalSoft/DalSoft.RestClient/wiki/Available-Plugins)
  * [UnitTestHandler](https://github.com/DalSoft/DalSoft.RestClient/wiki/Available-Plugins#unittesthandler)
  * [FormUrlEncodedHandler](https://github.com/DalSoft/DalSoft.RestClient/wiki/Available-Plugins#formurlencodedhandler)
  * [MultipartFormDataHandler](https://github.com/DalSoft/DalSoft.RestClient/wiki/Available-Plugins#multipartformdatahandler)
  * [RetryHandler](https://github.com/DalSoft/DalSoft.RestClient/wiki/Available-Plugins#retryhandler)

* [Unit Testing](https://github.com/DalSoft/DalSoft.RestClient/wiki/Unit-Testing)

* [Guidance](https://github.com/DalSoft/DalSoft.RestClient/wiki/Guidance)
  * [Disposing](https://github.com/DalSoft/DalSoft.RestClient/wiki/Guidance#disposing)
  * [Retrying Transient Errors](https://github.com/DalSoft/DalSoft.RestClient/wiki/Guidance/#retrying-transient-errors)
  * [Synchronous Usage](https://github.com/DalSoft/DalSoft.RestClient/wiki/Guidance#synchronous-usage)

## Standing on the Shoulders of Giants

DalSoft.RestClient is built using the following great open source projects:
* [Json.NET](http://www.newtonsoft.com/json)
* [System.Net.Http](https://github.com/dotnet/corefx/tree/master/src/System.Net.Http)

DalSoft.RestClient is inspired by and gives credit to:
* [Simple.Data](http://simplefx.org/simpledata/docs/index.html)
* [This Stack Overflow question](http://stackoverflow.com/questions/12634250/possible-to-get-chained-value-of-dynamicobject)
* [AngularJS (version 1.x) $http service](https://docs.angularjs.org/api/ng/service/$http)


text:
---
title: Examples
visible_title: "Quartz Examples"
active_sub_menu_id: site_mnu_docs_examples
---

          Contents |
	  ‹ Prev |
          Next ›

## Example 4 - Job Parameters and Job State

This example is designed to demonstrate how you can pass run-time parameters into quartz jobs and how you can maintain state in a job.

The program will perform the following actions:

+ Start up the Quartz Scheduler
+ Schedule two jobs, each job will execute the every ten seconds for a total of times
+ The scheduler will pass a run-time job parameter of "Green" to the first job instance
+ The scheduler will pass a run-time job parameter of "Red" to the second job instance
+ The program will wait 60 seconds so that the two jobs have plenty of time to run
+ Shut down the Scheduler

## [Running the Example](#Example4-RunningtheExample)
This example can be executed from the **examples/example4** directory.   There are two out-of-the-box methods for running this example

+ **example4.sh** - A UNIX/Linux shell script
+ **example4.bat** - A Windows Batch file

## [The Code](#Example4-TheCode)

The code for this example resides in the package **org.quartz.examples.example4**.

The code in this example is made up of the following classes:

 Class Name
 Description

 JobStateExample
 The main program

 ColorJob
 A simple job that prints a favorite color (passed in as a run-time parameter) and displays its execution count.

### [ColorJob](#Example4-ColorJob)

ColorJob is a simple class that implement the Job interface, and is annotated as such:

@PersistJobDataAfterExecution
@DisallowConcurrentExecution
public class ColorJob implements Job {

The annotations cause behavior just as their names describe - multiple instances of the job will not be allowed to
run concurrently (consider a case where a job has code in its execute() method that takes 34 seconds to run, but it is
scheduled with a trigger that repeats every 30 seconds), and will have its JobDataMap contents re-persisted in the
scheduler's JobStore after each execution.  For the purposes of this example, only *@PersistJobDataAfterExecution*
annotation is truly relevant, but it's always wise to use the *@DisallowConcurrentExecution* annotation with
it, to prevent race-conditions on saved data.

ColorJob logs the following information when the job is executed:

+ The job's identification key (name and group) and time/date of execution
+ The job's favorite color (which is passed in as a run-time parameter)
+ The job's execution count calculated from a member variable
+ The job's execution count maintained as a job map parameter

_log.info("ColorJob: " + jobKey + " executing at " + new Date() + "\n" +
    "  favorite color is " + favoriteColor + "\n" +
    "  execution count (from job map) is " + count + "\n" +
    "  execution count (from job member variable) is " + _counter);

The variable *favoriteColor* is passed in as a job parameter.  It is retrieved as follows from the *JobDataMap*:

JobDataMap data = context.getJobDetail().getJobDataMap();
String favoriteColor = data.getString(FAVORITE_COLOR);

The variable *count* is stored in the job data map as well:

JobDataMap data = context.getJobDetail().getJobDataMap();
int count = data.getInt(EXECUTION_COUNT);

The variable is later incremented and stored back into the job data map so that job state can be preserved:

count++;
data.put(EXECUTION_COUNT, count);

There is also a member variable named *counter*.   This variable is defined as a member variable to the class:

private int _counter = 1;

This variable is also incremented and displayed.  However, its count will always be displayed as "1" because Quartz will always instantiate a new instance of the class during each execution - which prevents member variables from being used to maintain state.

### [JobStateExample ](#Example4-JobStateExample)
The program starts by getting an instance of the Scheduler.  This is done by creating a *StdSchedulerFactory* and then using it to create a scheduler.   This will create a simple, RAM-based scheduler.

SchedulerFactory sf = new StdSchedulerFactory();
Scheduler sched = sf.getScheduler();

Job #1 is scheduled to run every 10 seconds, for a total of five times:

JobDetail job1 = newJob(ColorJob.class)
    .withIdentity("job1", "group1")
    .build();

SimpleTrigger trigger1 = newTrigger()
    .withIdentity("trigger1", "group1")
    .startAt(startTime)
    .withSchedule(simpleSchedule()
            .withIntervalInSeconds(10)
            .withRepeatCount(4))
    .build();

Job #1 is passed in two job parameters.   One is a favorite color, with a value of "Green".  The other is an execution count, which is initialized with a value of 1.

job1.getJobDataMap().put(ColorJob.FAVORITE_COLOR, "Green");
job1.getJobDataMap().put(ColorJob.EXECUTION_COUNT, 1);

Job #2 is also scheduled to run every 10 seconds, for a total of five times:

JobDetail job2 = newJob(ColorJob.class)
    .withIdentity("job2", "group1")
    .build();

SimpleTrigger trigger2 = newTrigger()
    .withIdentity("trigger2", "group1")
    .startAt(startTime)
    .withSchedule(simpleSchedule()
            .withIntervalInSeconds(10)
            .withRepeatCount(4))
    .build();

Job #2 is also passed in two job parameters.   One is a favorite color, with a value of "Red".  The other is an execution count, which is initialized with a value of 1.

job2.getJobDataMap().put(ColorJob.FAVORITE_COLOR, "Red");
job2.getJobDataMap().put(ColorJob.EXECUTION_COUNT, 1);

The scheduler is then started.

sched.start();

To let the program have an opportunity to run the job, we then sleep for one minute (60 seconds)

Thread.sleep(60L * 1000L);

Finally, we will gracefully shutdown the scheduler:

sched.shutdown(true);

Note:  passing *true* into the *shutdown* message tells the Quartz Scheduler to wait until all jobs have completed running before returning from the method call.

repository: flochaz/quartz

gha_language: Java

repo_name: flochaz/quartz


text:
# [Kingdom Hearts II](../../index.md) - 00objentry.bin

Contains a definition of every object and it's parameters.

## Structure

| Offset | Type | Description |
|--------|------|-------------|
| 0x00   | uint32 | ID
| 0x04   | uint8 | [Object Type](#object-types)
| 0x05   | uint8 | Subtype
| 0x06   | uint8 | Draw priority
| 0x07   | uint8 | Weapon Joint - Points to [Sklt](03system.md#sklt)
| 0x08   | char[32] | Model Name
| 0x28   | char[32] | Animation Name
| 0x48   | uint16 | [Flags](#flags)
| 0x4A   | uint8 | [Target Type](#target-type)
| 0x4B   | uint8 | Padding
| 0x4C   | uint16 | Neo Status
| 0x4E   | uint16 | Neo Moveset
| 0x50   | float | Weight
| 0x54   | uint8 | Spawn Limiter
| 0x55   | uint8 | Page (unknown)
| 0x56   | uint8 | [Shadow Size](#shadow-size)
| 0x57   | uint8 | [Form](#form-fm)
| 0x58   | uint16 | Spawn additional object 1 - [OBJ LIST](../../dictionary/obj.md)
| 0x5A   | uint16 | Spawn additional object 2 - [OBJ LIST](../../dictionary/obj.md)
| 0x5C   | uint16 | Spawn additional object 3 - [OBJ LIST](../../dictionary/obj.md)
| 0x5E   | uint16 | Spawn additional object 4 - [OBJ LIST](../../dictionary/obj.md)

### Object Types

| Id   | Name (ELF) | Description |
|------|------------|-------------|
| 0x00 | PLAYER   | Player
| 0x01 | FRIEND   | Party Member
| 0x02 | NPC      | NPC
| 0x03 | BOSS     | Boss (makes a finsher required to kill)
| 0x04 | ZAKO     | Normal Enemy
| 0x05 | WEAPON   | Weapon
| 0x06 | E_WEAPON | Placeholders for ARD files
| 0x07 | SP       | World/Save Point
| 0x08 | F_OBJ    | Neutral (can be damaged by both allies and enemies)
| 0x09 | BTLNPC   | Partner (out of party allies)
| 0x0A | TREASURE | Chest
| 0x0B | SUBMENU  | Moogle
| 0x0C | L_BOSS   | Large Boss
| 0x0D | G_OBJ    | Unknown
| 0x0E | MEMO     | Pause Menu Dummy (walking models in Pause Menu)
| 0x0F | RTN      | Unknown
| 0x10 | MINIGAME | Unknown
| 0x11 | WORLDMAP | Objects on the World Map
| 0x12 | PRIZEBOX | Drop Item Container
| 0x13 | SUMMON   | Summon Partner
| 0x14 | SHOP     | Shop Point
| 0x15 | L_ZAKO   | Normal Enemy
| 0x16 | MASSEFFECT | Crowd Spawner
| 0x17 | E_OBJ    | Unknown
| 0x18 | JIGSAW   | Puzzle Piece

### Flags

| Position | Size | Description |
|----------|------|-------------|
| 0 | 1 | No APDX
| 1 | 1 | Before
| 2 | 1 | Fix Color
| 3 | 1 | Fly
| 4 | 1 | Scissoring
| 5 | 1 | Pirate
| 6 | 1 | OCC Wall
| 7 | 1 | Hift

### Target Type

Ally damage cap (01 for normal damage, 02 for chip damage...)

| Id   | Description |
|------|-------------|
| 0x0 | Target Type M
| 0x1 | Target Type S
| 0x2 | Target Type L

### Shadow Size

| Id  | Description |
|-----|-------------|
| 0x0 | No shadow
| 0x1 | Small shadow
| 0x2 | Middle shadow
| 0x3 | Large shadow
| 0x4 | Small moving shadow
| 0x5 | Middle moving shadow
| 0x6 | Large moving shadow

### Form (FM)

Controls which actions are possible in the command menu.

| Id   | Description |
|------|-------------|
| 0x00 | Sora / Roxas
| 0x01 | Valor Form
| 0x02 | Wisdom Form
| 0x03 | Limit Form
| 0x04 | Master Form
| 0x05 | Final Form
| 0x06 | Anti Form
| 0x07 | Lion King Sora
| 0x08 | Atlantica Sora (Magic, Drive, Party and Limit commands are greyed out)
| 0x09 | Sora on Carpet (Drive, Party and Limit commands are greyed out)
| 0x0A | Roxas Dual-Wield
| 0x0B | Default (used on Enemies)
| 0x0C | Sora in Cube / Card Form

repository: OpenKH/OpenKh

gha_language: C#

repo_name: OpenKH/OpenKh


text:
# Contributing to the Lithophane Workbench

At first, thank you for trying the Workbench and for taking the time to contribute :)

## Found a bug?
- **Make sure that the bug was not already reported** by checking the issues or searching in the FreeCAD Forum https://forum.freecadweb.org/viewtopic.php?f=9&t=30496
- If you could not find any open issues, you should create one (https://github.com/furti/FreeCAD-Lithophane/issues/new?template=bug_report.md).
  - Enter as much information as possible into the issue template. **The FreeCAD Version Info is very important**

## Want to write some code?
 - First and foremost **don't rely on the development branch**. This branch might contain experimental stuff and the history is likely to be rewritten over time. So best to not base your work on top of it.

More to come... :)


text:
# Crazy Taxi Dreamcast Restoration 2.0

This plugin for Crazy Taxi restores the original licensed brands from the Arcade and Dreamcast versions.
The original version of the mod was made by [Alexvgz](https://www.youtube.com/channel/UCqDbjGuaY4awoKs8J-6DBUA)
and involved replacing textures; after some investigation I found a way to restore brands by editing the code instead.
This has also allowed for complete restorations of FILA and Pizza Hut logos, and for a restoration of FILA
as a possible customer destination - unlike other licensed brands, FILA was not only made unmarked,
but also made unreachable by customers.

## Features
* Restored original licensed destinations:
  * Pizza Hut (Pizza Parlor)
  * Kentucky Fried Chicken (Fried Chicken Shack)
  * FILA
  * Tower Records (Record Store)
  * The Original Levi's store (Clothing Store)
* Restored FILA (Shoe Rack) as a possible destination for customers, previously cut completely
* Restored original voice lines for licensed destinations

**This modification does not (and will not) restore the original soundtrack from the Dreamcast version.**

## Credits
* [Alexvgz](https://www.youtube.com/channel/UCqDbjGuaY4awoKs8J-6DBUA) - the original Dreamcast Restoration mod

[![Preview](https://i.imgur.com/D8oQHkcl.jpg)](https://i.imgur.com/D8oQHkc.jpg "Preview")

[![Preview](https://i.imgur.com/1j3BgjCl.jpg)](https://i.imgur.com/1j3BgjC.jpg "Preview")

[![Preview](https://i.imgur.com/YPt9wLwl.jpg)](https://i.imgur.com/YPt9wLw.jpg "Preview")

repository: CookiePLMonster/CT-DC

repo_name: CookiePLMonster/CT-DC


text:
## Payment Refund

Represents a refund of a payment made using Square. Contains information on
the original payment and the amount of money refunded.

### Structure

`PaymentRefund`

### Fields

| Name | Type | Tags | Description | Getter | Setter |
|  --- | --- | --- | --- | --- | --- |
| `id` | `string` |  | Unique ID for this refund, generated by Square. | getId(): string | setId(string id): void |
| `status` | `?string` | Optional | The refund's status:

- `PENDING` - awaiting approval
- `COMPLETED` - successfully completed
- `REJECTED` - the refund was rejected
- `FAILED` - an error occurred | getStatus(): ?string | setStatus(?string status): void |
| `locationId` | `?string` | Optional | Location ID associated with the payment this refund is attached to. | getLocationId(): ?string | setLocationId(?string locationId): void |
| `amountMoney` | [`Money`](/doc/models/money.md) |  | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getAmountMoney(): Money | setAmountMoney(Money amountMoney): void |
| `appFeeMoney` | [`?Money`](/doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getAppFeeMoney(): ?Money | setAppFeeMoney(?Money appFeeMoney): void |
| `processingFee` | [`?(ProcessingFee[])`](/doc/models/processing-fee.md) | Optional | Processing fees and fee adjustments assessed by Square on this refund. | getProcessingFee(): ?array | setProcessingFee(?array processingFee): void |
| `paymentId` | `?string` | Optional | The ID of the payment assocated with this refund. | getPaymentId(): ?string | setPaymentId(?string paymentId): void |
| `orderId` | `?string` | Optional | The ID of the order associated with the refund. | getOrderId(): ?string | setOrderId(?string orderId): void |
| `reason` | `?string` | Optional | The reason for the refund. | getReason(): ?string | setReason(?string reason): void |
| `createdAt` | `?string` | Optional | Timestamp of when the refund was created, in RFC 3339 format. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void |
| `updatedAt` | `?string` | Optional | Timestamp of when the refund was last updated, in RFC 3339 format. | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void |

### Example (as JSON)

```json
{
  "id": "id0",
  "status": "status8",
  "location_id": "location_id4",
  "amount_money": {
    "amount": 186,
    "currency": "NGN"
  },
  "app_fee_money": {
    "amount": 106,
    "currency": "GBP"
  },
  "processing_fee": [
    {
      "effective_at": "effective_at6",
      "type": "type8",
      "amount_money": {
        "amount": 214,
        "currency": "BWP"
      }
    },
    {
      "effective_at": "effective_at7",
      "type": "type7",
      "amount_money": {
        "amount": 215,
        "currency": "BYR"
      }
    },
    {
      "effective_at": "effective_at8",
      "type": "type6",
      "amount_money": {
        "amount": 216,
        "currency": "BZD"
      }
    }
  ],
  "payment_id": "payment_id0"
}
```