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

Getting Started
================

Check the documentation added in:

https://github.com/CoffeeITWorks/ansible-generic-help#getting-started

Role Name
=========

ansible_burp_reports deploy and maintenance role.

This roles builds burp_reports version specified on defaults/main.yml.
Also configures it to get it working and maintained in a centralized way.

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

Burp-ui working and var defined in your group_vars/group
Recommended: ansible_burpui_server and ansible_burp2_server from CoffeeITWorks: https://github.com/CoffeeITWorks

Variables
---------

Try to not edit the role only for vars, all configurable vars are in defaults/main.yml so all of them can
be set on group_vars/group or host_vars/host files.

First required:

    burpui_apiurl: http://admin:admin@localhost:5000/api/

Not really required but you can customize all the following:

```yaml
    burp_report_days_outdated: 25
    burp_report_conf: /etc/burp/burp-reports.conf

    burp_conf_user: 'root'
    burp_conf_group: 'root'

    # https://github.com/pablodav/burp_server_reports#usage
    burp_report_inventory_input: None
    burp_report_inventory_output: None # could be for example /var/www/html/inventory_central.csv

    # Tests tasks
    burp_report_test: false

    # http://docs.ansible.com/ansible/cron_module.html
    report_outdated_special_time: 'weekly'
    report_inventory_special_time: 'weekly'

    burp_report_emails_notes: 'some useful notes to change'
    burp_report_emails_to: root@localhost
    burp_report_emails_from: burpserver@localhost
    burp_excluded_clients: 'agent,monitor'

    smtp_relay: 'localhost'
    smtp_port: 25
    smtp_mode: 'normal'
    smtp_login: ''
    smtp_password: ''

    ## burp-reports installation packages:
    # doc: https://github.com/pablodav/burp_server_reports

    # This example is the variable that setups the burp_reports version:
    burp_reports_pip_packages:
    - name: burp_reports
        version: 1.2.4
```

Optional vars
-------------

Optional prepare templates and schedule jobs.

```yaml
burp_reports_nagios_servers:
  - SERVERNAME

# Optional cron jobs, example with template generated to send status through nsca
# http://docs.ansible.com/ansible/latest/modules/cron_module.html
burp_reports_cron_jobs:
  - name: 'burp-reports inventory nsca'
    job: '/usr/local/bin/burp-reports-nsca'
    day: "*"
    hour: "*"
    minute: "*/10"
    month: "*"
    weekday: "*"

# Optional generation of nsca scripts
burp_reports_nsca_scripts:
  - script: '/usr/local/bin/burp-reports-nsca'
    command: '/usr/local/bin/burp-reports -c {{ burp_report_conf }} --report inventory -i {{ burp_report_inventory_input }} -o {{ burp_report_inventory_output }}'
    nagios_service: 'burp_reports_status'
```

To use it you will need a nagios config service for burp-reports server name, ex:

```cfg
; https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/4/en/objectdefinitions.html#service
define service {
        service_description            burp_reports_status
        host                           YOURBURP-REPORTS-ORIGINATED
        use                            generic-service
        passive_checks_enabled         1
        max_check_attempts             1
        active_checks_enabled          0
        notification_interval          60
        check_freshness                1
        freshness_threshold            7200       ; 2 hour threshold, without cron execution will execute check_command
        check_command                  no-burp-reports
        # set the contact group
        # contact_groups                 {{ contact_group }}
        flap_detection_enabled         0
}

; https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/4/en/freshness.html

define command {
    command_name    no-burp-reports
    command_line    /usr/local/nagios/libexec/check_dummy 2 "burp-reports was not executed in time"
}
```

Tags
----

config_burp_reports_cron: if you want to change some cron task
test_burp_reports: tests commands, all configuration should be already done.

Playbook example for site.yml
-----------------------------

    - hosts: servers
      environment: "{{ proxy_env }}"
      roles:
      - { role: common, tags: ["role_all", "role"] }

environment is not required!, only is an example in case you are behind a firewall. If that's you case, add the proxy var to you group_vars/all.
Example of that vars is at: https://github.com/CoffeeITWorks/ansible-generic-help/blob/master/example1/group_vars/all/vars

License
-------

MIT

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

This role was main developed by Pablo Estigarribia (pablodav at gmail)

Burp backup and restore
=======================

Main page: http://burp.grke.org/

Burpui
======

Main page: https://git.ziirish.me/ziirish/burp-ui

gha_language: HTML


text:
# AgeCalculator 📅

  ![Maintenance](https://img.shields.io/badge/Maintained%3F-No-red.svg)  ![Build Status](https://travis-ci.org/joemccann/dillinger.svg?branch=master)
 ![GitHub last commit](https://img.shields.io/github/last-commit/rawkush/AgeCalculator?style=plastic)
 ![GitHub Release Date](https://img.shields.io/github/release-date/rawkush/AgeCalculator?style=plastic) ![Lines of code](https://img.shields.io/tokei/lines/github/rawkush/AgeCalculator?style=plastic)
   ![GitHub issues](https://img.shields.io/github/issues/rawkush/AgeCalculator?style=plastic) ![GitHub closed issues](https://img.shields.io/github/issues-closed/rawkush/AgeCalculator?style=plastic)    ![GitHub forks](https://img.shields.io/github/forks/rawkush/AgeCalculator?style=social)
   ![GitHub Repo stars](https://img.shields.io/github/stars/rawkush/AgeCalculator?style=social)
   ![GitHub watchers](https://img.shields.io/github/watchers/rawkush/AgeCalculator?style=social)
 ![GitHub all releases](https://img.shields.io/github/downloads/rawkush/AgeCalculator/total?style=plastic)

   ![GitHub](https://img.shields.io/github/license/rawkush/AgeCalculator?style=plastic)
![ViewCount](https://views.whatilearened.today/views/github/rawkush/agecalcalculator.svg)

>This app takes the user Date of Birth (D.O.B)📆 and calculate his/her age, the app automatically takes the current date from the mobile and also allows user to manually add it too. The app also tell the users upcoming birth dates 🎉 🎉 too and the number of remaining days.

##  Contributions and Suggestions  are welcome🙏

license: MIT

repository: Rawkush/AgeCalculator

branch_name: refs/heads/master

extension: md

gha_language: Java

gha_license_id: MIT

license_type: permissive

repo_name: Rawkush/AgeCalculator


text:
---
layout: default
title: Tristan Swedish
---

![Tristan]({{site.url}}/assets/images/portrait.jpg){:style="float: right;margin-right: 7px;margin-top: 7px; border-radius: 50%; width: 300px"}

# Tristan Swedish

I’m a [PhD Student](https://web.media.mit.edu/~tswedish/) at the [MIT Media Lab](https://www.media.mit.edu/){:target="_blank"} in the [Camera Culture Group](http://cameraculture.media.mit.edu/){:target="_blank"}. I received a degree in Electrical Engineering and Physics at Northeastern University, where I created computational models of light propagation in tissue. I recently finished my Masters at the MIT Media Lab, where I built a new class of user-centric retinal imaging cameras inspired by computational photography and displays.

I've got a keen interest in refactoring hardware, imaging systems, and the algorithms that turn unstructured measurements into useful information. I've put cameras on flying robots, built a user-aligned retinal imaging device, and have made my cactus mobile.

I was born in Salt Lake, Utah, spent a good amount of time growing up in Durham, NC, and have been living in Boston the last few years. I'm currently a graduate Research Assistant in the Camera Culture group at the MIT Media Lab.

When I can, I also like to make music and go skiing.

gha_language: JavaScript


text:
# Todo-Backend

Sample application for the [Todo-Backend](http://www.todobackend.com) project which implements
[TodoMVC](http://todomvc.com) backends. You can check the code
[here](https://github.com/hexagonkt/todo_backend).

# Real World

Hexagon RealWorld demo backend implementation. The source code is available
[here](https://github.com/hexagonkt/real_world).

# Contact Application

Sample contact application that showcases the structure of a Hexagon service. Source code can be
checked [here](https://github.com/hexagonkt/contact_application).

# Benchmark

This is an application for checking the [TechEmpower Web Framework Benchmarks][benchmark]. It is an
internal Hexagon module. You can find the code [here][benchmark_example].

# Flyhopper

Example REST service using Ryanair's APIs. You can find the repository [here][flyhopper_example].

# Gradle Starter

Hexagon starter project using Gradle as the build tool. The source code is inside this
[GitHub repository][gradle_starter_example].

# Maven Starter

Hexagon example service built with Maven. The sources are located [here][maven_starter_example].

[benchmark]: https://www.techempower.com/benchmarks
[benchmark_example]: https://github.com/hexagonkt/tfb/tree/master/frameworks/Kotlin/hexagon
[flyhopper_example]: https://github.com/hexagonkt/flyhopper
[gradle_starter_example]: https://github.com/hexagonkt/gradle_starter
[maven_starter_example]: https://github.com/hexagonkt/maven_starter

repository: dragneelfps/hexagon

repo_name: dragneelfps/hexagon


text:
---
description: Follow the steps below to install Mailchain...
---

# Installation

## Quick Install \(Mac\)

To install Mailchain for the first time, we recommend using [Homebrew](https://brew.sh/) to download, install and manage the application on your local machine.

First we need to tap mailchain repository to the list of formulae that brew tracks using

```bash
brew tap mailchain/tap
```

Once you have done this, you can install mailchain using
```bash
brew install mailchain
```

## Quick Install \(Linux and Windows\)

To install Mailchain for the first time, run the following command to download and install the application on your local machine.

```bash
curl -sL https://run.mailchain.xyz/install.sh | sh
```

## Manual Install

To choose where to store the application, you can install mailchain manually.

### 1. Download the application

Download the application directly via the [Mailchain releases](https://github.com/mailchain/mailchain/releases/latest) page. We recommend you save it in your home directory: `~/.mailchain/bin`

### 2. Export the application path

Next, add mailchain to your environmental variable path with:

```bash
export PATH=$PATH:$HOME/.mailchain/bin
```

{% hint style="info" %}
Note: if you changed the location of the mailchain executable, you should update the path as appropriate:

```bash
export PATH=$PATH:$HOME/{mailchain_executable_location}
```
{% endhint %}

Verify the application is installed and running correctly with: `mailchain version`. For example:\`

```bash
$ mailchain version
Version: v0.0.11
```

Next, if the application is working as expected, you’ll want to add the path to `~/.profile`, `.zshrc`, or `~/.bash_profile`, depending on which shell you use.

To determine the shell you use, run `echo $SHELL`. For example, if using zsh, as shown below:

```bash
$ echo $SHELL
```

| Shell output | Command to export the path to the shell profile |
| :--- | :--- |
| /bin/zsh | `echo 'export PATH=$PATH:$HOME/.mailchain/bin' >> ~/.zshrc` |
| /bin/bash | `echo 'export PATH=$PATH:$HOME/.mailchain/bin' >> ~/.bashrc` |
| /bin/ksh | `echo 'export PATH=$PATH:$HOME/.mailchain/bin' >> ~/.kshrc` |

You are now ready to [initialize](setting-up.md) the application.


text:
# php-psr2-vim

Sets PSR-2 settings when editing PHP files.

# Installation

Your favorite plugin manager.

# Usage

It just does its thing, calling `setlocal` when PHP filetype is set.

There are four configuration options:

- `g:php_psr2_textwidth`: Integer, default 80.  Value to set the local
  `textwidth` to.
- `g:php_psr2_soft_margin`: Boolean. If set to 0, suppresses `colorcolumn+=80`
- `g:php_psr2_hard_margin`: Boolean. If set to 0, suppresses
  `colorcolumn+=120`
- `g:php_psr2_use_tabs`: Boolean. If set to 1, uses tabs instead of spaces for
  indentation, setting `shiftwidth` to `tabstop` (which is left unchanged.)
  This is technically a violation of PSR-2, but tabs are the one true way to
  indent.

The auto-activation can be disabled with `:PhpPsr2Off` and re-enabled with
`:PhpPsr2On`.  Because I'm like that.

If the plugin has auto-activated in a buffer, its buffer-local settings can be
reset to the global value using `:PhpPsr2Revert`.

# Settings Affected

    autoindent
    smartindent
    nocindent
    [no]expandtab
    shiftwidth
    softtabstop
    tabstop
    textwidth [configurable value]
    colorcolumn [configurable]

Notably, `formatoptions` is **not** affected.  Code will continue to wrap, or
not, according to your preference.

# Requirements

Minimum vim 6.0 with `+autocmd` feature.  Vim 7.0 is required for the margin
highlights (`colorcolumn` option), but the plugin will degrade gracefully.

# License

MIT.


text:
# Contributing

When contributing to this repository, please first discuss the change you wish to make via issue,
email, or any other method with the owners of this repository before making a change.

Please note we have a [code of conduct](./CODE_OF_CONDUCT.md), please follow it in all your interactions with the project.

## Pull Request Process

1. Ensure all formatings are correct.
2. Update README.md with details of changes (Add/Update Translations to the Translations Table in Readme.md).
3. The Pull Request will be merged in once you have the sign-off of the Core Dev Team.

## Translations Table Example

| Code  | Language | Status           | Description                                          |
| ----- | -------- | ---------------- | ---------------------------------------------------- |
| en-US | English  | Finished         | Translation completly Finished                       |
| en-US | English  | Needs Update     | Translation needs Update (mostly after version bump) |
| en-US | English  | Work in progress | Translation is still being worked on                 |

branch_name: refs/heads/main


text:
This project represents the WEB front end for the eeboo application

The front end application is based on the React v16.0 JavaScript library and relays on the eeboo REST API backend service.

Below you will find some information on how to install the software and perform common tasks

## Table of Contents
- [Requirements](#requirements)
- [Installation](#installation)
- [Run](#run)
- [Available Scripts](#available-scripts)
  - [yarn start](#yarn-start)
  - [yarn test](#yarn-test)
  - [yarn build](#yarn-build)
  - [yarn lint](#yarn-lint)
  - [yarn lint-fix](#yarn-lint-fix)
  - [yarn test -- --coverage](#yarn-test------coverage)
- [Files and Directories](#files-and-directories)

## Requirements
To build this software you need at least following packages installed globally on your system:
* node version >= v9.2.1
* yarn version >= 1.3.2

The admin pages are protected using [AUTH0](https://auth0.com/) Authentication service. To get full access to the eeboo admin interface, ask imathu for permission or disable the authentication feature in the code (disabling will be configurable in Release 2.0)

## Installation
Install all required software packages and libraries
```
 #> yarn install
```

## Run
Run the API service on localhost listening on port 3001. This is mainly used for development purpose
```
 #> yarn start
```

## Available Scripts

### `yarn start`
Runs a dev server listening on localhost and port 3000. The server will automatically re-compile and re-run on every file update.

### `yarn test`
Runs [JEST](https://facebook.github.io/jest/) unit tests

### `yarn build`
Runs a build process that creates a production ready and minified bundle.js file

### `yarn lint`
Runs [ESLint](http://eslint.org/) command against every .js and .jsx file. The linter is configured using [esling-airbnb-config](https://www.npmjs.com/package/eslint-config-airbnb)

### `yarn lint-fix`
Inline fixes linter issues that can be autonomously fixed by the linter

### `yarn test -- --coverage`
Runs tests with coverage reporting on the command line

## Files and Directories
Static HTML content and production ready build files
```
 #> build/
```
Important React application files
```
 #> src/
 #> src/Callback/        <- AUTH0 callback Component
 #> src/components/      <- React component files (JSX)
 #> src/containers/      <- Redux container files (JS)
 #> src/services/        <- AUTH0 supporting services
 #> src/state/actions/   <- Redux actions
 #> src/state/reducers/  <- Redux reducers
 #> src/state/selectors/ <- Redux state selectors
 #> src/utlis/           <- useful utils
 #> src/App.js           <- main application .js
 #> src/index.js         <- main index .js

```

repository: jbandi/eeboo

repo_name: jbandi/eeboo


text:
Swift Explorer:

========

User-friendly tool to manage files in an OpenStack Storage system (SWIFT). Please, visit [www.swiftexplorer.org](http://www.swiftexplorer.org) for further details.

Changes:
=======
The following new changes has been made since forking
1) Accomodate/Support 'Preferred Region' for KeyStone Login Dialog box
2) Save/Restore the new property in 'Saved Credentials'

Build Instructions:
==================
A Pre-Build binary can be downloaded from here

Clone the repo https://github.com/balaji-katika/swift-explorer

Build the project using 'mvn clean install'

Invoke the executable jar file 'java -jar target/SwiftExplorer-1.0.10-SNAPSHOT-jar-with-dependencies.jar'

Acknowledgement:
===============
This repository is originaly forked from roikku/swift-explorer
https://github.com/roikku/swift-explorer

repository: balaji-katika/swift-explorer

repo_name: balaji-katika/swift-explorer


text:
# Curriculum-Tracker
Curriculum tracker, organizing development efforts, *internal-only* for now.

---

### toc:
- [Android](#android)
- [Assembly](#assembly)
- [Shell/CommandLine](#shell-curriculums)
- [Hardware/3D-Printing](#hardware3d-printing)
- [Editors/IDE's](#editorsides)

---

## Shell Curriculums

**Has Material + Module Development**
* [Command-Line-Interface-101](https://github.com/Tech-Curriculums/Command-Line-Interface-101)

**Early stages**
* [Shell Reading Links](https://github.com/Tech-Curriculums/101-Shell-Scripting)
* [Advanced Shell](https://github.com/Tech-Curriculums/200-Advanced-Shell)
* [shell admin module startings...](https://github.com/Tech-Curriculums/200-Shell-Commands-for-SysAdm)

## Assembly
**Has Material**
* [101-Arm-Assembly](https://github.com/Tech-Curriculums/101-Arm-Assembly)

**Early Stages/Merge-possibility**
* [201-x64 Assembly](https://github.com/Tech-Curriculums/201-x64-Assembly)
* [30-x64-Architecture](https://github.com/Tech-Curriculums/300-Assembly-x86-Architecture)

## Android

* [Architecture-Page, Module Draft, 201-Introduction-to-Android] (https://github.com/Tech-Curriculums/201-Introduction-to-Android/blob/master/01Architecture.md)
* [Services, Example](https://github.com/Tech-Curriculums/a09_Simple_Service/blob/master/app/src/main/java/com/example/gkielian/a09_simple_service/MyIntentService.java)
* [Toast, Example](https://github.com/Tech-Curriculums/a10_A_Toast/blob/master/app/src/main/java/com/example/gkielian/a10_a_toast/MyActivity.java)
* [Camera, Example](https://github.com/Tech-Curriculums/a2_Smile_For_The/blob/master/src/com/example/a2_smile_for_the/MainActivity.java)
* [Text-To-Speech, Example](https://github.com/Tech-Curriculums/a3_Spoken_Word/blob/master/app/src/main/java/com/texttospeech/app/MainActivity.java)
* [Erase-this, Intents, example, toArchive](https://github.com/Tech-Curriculums/a1_Awesome_Intents/blob/master/src/com/example/a1_awesome_intents/MainActivity.java)
* [material-design, early stages](https://github.com/Tech-Curriculums/200-Android-Material-Design)

**Forked Examples**
* [from tdicola, BTLE](https://github.com/Tech-Curriculums/BTLETest/blob/master/app/src/main/java/com/tonydicola/bletest/app/MainActivity.java)

## Hardware/3D Printing

* [3D-Printing-Electronics, openscad basics + electronics templates](https://github.com/Tech-Curriculums/3D-Printing-Electronics/blob/master/HW-Interfaces.md)
* [Op-Amps-101, what to look for when shopping, and core-topologies](https://github.com/Tech-Curriculums/Op-Amps-101/tree/master/Diagrams)

## Editors/IDEs

* [Emacs, starting resources and setup (mac, linux, windows)](https://github.com/Tech-Curriculums/Elective-Emacs-to-the-Max)
* [Vim-101, early stages, starting resources, pathogen, and setup](https://github.com/Tech-Curriculums/101-Vim)
* [Vim, basics](https://github.com/Tech-Curriculums/Command-Line-Interface-101/tree/master/CLI-101/VIM-Tutorials)
* [Nano, basics](https://github.com/Tech-Curriculums/Command-Line-Interface-101/tree/master/CLI-101/Nano-Tutorial)
* [Android Studio, TBD](https://github.com/Tech-Curriculums/)

repository: Tech-Curriculums/Curriculum-Tracker

repo_name: Tech-Curriculums/Curriculum-Tracker


text:
# Simple Server

All this is a simple server that renders and index page

## Setup
Make sure you download a copy of node.js.  Open up a terminal/shell and run the following commands.
```bash
$ npm install
$ npm start
```

## Notable Dependencies
+  Express.js

repository: eric-fleming/simpleServer

repo_name: eric-fleming/simpleServer


text:
# Tiny Tetris

## About

A Tetris implementation that "fits on a business card"

Dimensions: 20 lines x 80 characters

<img src="https://i.imgur.com/TY4szDq.gif" alt="Game in progress" width="40%">

## Rules and Limitations

- No encoding
- Only standard library and curses allowed

## Play It!

```bash
git clone https://github.com/nickmpaz/tiny-tetris && cd tiny-tetris && python3 tiny-tetris.py
```
## Controls

- up: rotate
- left: move left
- right: move right
- down: move down
- ctrl+c: quit

## Acknowledgements

Inspired by TinySki https://github.com/KilledByAPixel/TinySki


text:
# Form Close Behavior
If you have a child form and you want clicking the "X" to hide it rather than closing the form (requiring it to be recreated from a new form object to show it again later), override the OnFormClosing method:
```cs
protected override void OnFormClosing(FormClosingEventArgs e)
{
    base.OnFormClosing(e);
    e.Cancel = true; // cancel the close event
    this.Visible = false;
}
```

repository: swharden/code-notes

repo_name: swharden/code-notes


text:
---
title: Why I reject clients
published: false
categories:
date:
---

Lately, I've had to completely drop clients, refuse to do any sort of work on the side for others, and do a lot of screening before agreeing to even look at a project in more detail.

Why?

Mostly because I'm extremely busy and I have a day job - people that I know, know that I work in IT, so naturally, they ask me for help.  I have to have a way to filter people out so that the people who I do end up working for on the side, end up making it much more worthwhile to exchange my bits of free time for working on a project.

Almost too often do I receive requests to work on a project for sweat equity, with the promise that their project will be "the next big thing."  The easiest way for me to figure out whether they're great to work with or will end up as relying too much on my talents with nothing in return, is to look at their prior work and see where they're best at.  Do they mesh with what I do?  Do they have any experience in what I would be doing for them?  It's a totally different story if you're hiring someone because you'd rather concentrate on something else, vs. hiring someone because you don't have any skills in that particular skill area.  Not necessarily saying that it's bad if you don't have skills in programming/sysadmin'ing, but it must be more than made up in skills in other areas in order to convince me to work on a project for you.

repository: cparedes/redbluemagenta-new

extension: markdown

repo_name: cparedes/redbluemagenta-new


text:
Examples
===========

MNIST
----------
To run MNIST
you need to download the [dataset](http://yann.lecun.com/exdb/mnist/) and unzip it into `Examples/Data`.
To run AlexNet you need to download the CIFAR10 [binary dataset](https://www.cs.toronto.edu/~kriz/cifar.html) and unzip it into the same `Examples/Data` folder.

repository: interesaaat/TorchSharp

gha_language: C#

repo_name: interesaaat/TorchSharp


text:
# Changelog

All Notable changes to `emoji` will be documented in this file

## 1.0.5 - 2016-09-27

- fixed flag emojis

## 1.0.4 - 2016-02-11

- fixed (yeah fixed so no breaking changes 😎) some weird characters in the flag names

## 1.0.3 - 2016-02-11

- add docblocks for autocompleting magic methods

## 1.0.2 - 2016-02-11

- fix character flag for st barthelemy

## 1.0.1 - 2016-02-07

- added all characters currently found at http://unicode.org/emoji/charts/full-emoji-list.html

## 1.0.0 - 2016-02-07

- initial release

repository: ian-patel/emoji

repo_name: ian-patel/emoji


text:
# Camposporium aquaticum Dudka, 1966 SPECIES

#### Status
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Ukr. bot. Zh. 23: 91 (1966)

#### Original name
Camposporium aquaticum Dudka, 1966

### Remarks
null

repository: mdoering/backbone

path: /life/Fungi/Ascomycota/Dothideomycetes/Jahnulales/Aliquandostipitaceae/Xylomyces/Xylomyces aquaticus/ Syn. Camposporium aquaticum/README.md

repo_name: mdoering/backbone


text:
# @xutl/crypto

One [eXtremely Useful Tool Library](https://xutl.es) to Simplfy working with crypto in node.

## Install

```bash
npm install --save-dev @xutl/crypto
```

## Usage

```typescript
import { hash, random, SecretKey, PrivateKey } from '@xutl/crypto';

// data can be string | Uint8Array | Iterable<Uint8Array> | AsyncIterable<Uint8Array>
const sha1 = await hash(data, 'sha1');
const sha256 = await hash(data, 'sha256');
const sha512 = await hash(data, 'sha512');

const secret = SecretKey.createRandom(2048);
for await (const chunk of await secret.encrypt('aes256', data, await random(16) /* needs to be a iv */, 'cbc')) {
	write_encrypted(chunk);
}
for await (const chunk of await secret.decrypt('aes256', data, await random(16) /* needs to be the iv */, 'cbc')) {
	write_decrypted(chunk);
}

const pkey = await PrivateKey.createRSA(2048);
const sig = await pkey.sign('hallo');
if (pkey.public.verify(sig, 'hallo')) console.log('verified');

for await (const chunk of await pkey.encipher(data)) {
	write_encrypted(chunk);
}

for await (const chunk of await pkey.private.decipher(data)) {
	write_decrypted(chunk);
}

const bytes = await secret.export();
await pkey.der();
await pkey.pem();
await pkey.public.der();
await pkey.public.pem();

const pubkey = await PublicKey.fromPEM(pemstring);
const pubkey = await PublicKey.fromDER(derbuffer);
```

- plus there's Diffie-Hellman exchanges (both regular & EC)
- plus there's DSA, EC, ...
- use typescript to get full signatures

## License

Copyright 2019,2020 xutl.es

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

 IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

license: ISC

repository: xutl-es/crypto

repo_name: xutl-es/crypto


text:
# The cping Library
A library provide simple ping functionality in C API.

This library requires root privilege to create a raw socket.

# Table Of Content

# Feature
Provide C level interface for programmer.

# Build
```
make static
# or
make shared
```

# Example
```
#include "cping.h"

struct cping_ctx cp;
struct trnode *trhead;
struct timespec delay;
int icmp_type;

/* Initialize cping instance */
ret = cping_init(&cp);
if (ret != 0){
    fprintf(stderr, "Can't init cping\n");
}

/* Ping host with specific address family. */
icmp_type = cping_once(
    &cp, <host>, <AF_INET|AF_INET6>, <timeout:ms>, &delay
);

/* Or you have certain address. */
icmp_type = cping_addr_once(
    &cp, <addr>, <addrlen>, <timeout:ms>, &delay
);

/* Tracing route to host with maximum hop <maxhop>. */
trhead = cping_tracert(
    &cp, <addr>, <addrlen>, <timeout:ms>, <maxhop>
);

/* Iterate over nodes in linked-list flavor. */
for (struct trnode *cur = trhead; cur != NULL; cur = cur->next){
    /* do something to `cur` node. */
}

freetrnode(trhead);
trhead = NULL;

/* Finally releases resources used by instance. */
cping_fini(&cp);

```

# License
[![License](http://img.shields.io/:license-mit-blue.svg?style=flat-square)](http://badges.mit-license.org)

cping is distributed under MIT license.

repository: KIodine/cping

repo_name: KIodine/cping


text:
# rubberduck

![alt text](http://rubberduckvba.com/Content/Images/ducky-color.png)

## What is Rubberduck

Rubberduck is a lightweight container (Alpine based) which installs a set of utilities which are handy while debugging issues in a container environment.
It also ships with an small `Golang` binary which runs a bare-bones API server.

## ⚡⚡ Quick Deployment

`kubectl run -i --tty --rm debug --image=mrkaran/rubberduck:latest --restart=Never -- sh`

Spawns a pod in your namespace, gives access to all required tools to inspect networking issues and on `exit` it dies. This image is meant to be used for debugging purposes like these only.

### Contents of the image

List of utilities installed in the container:

    - iftop
    - drill
    - strace
    - curl
    - iperf
    - nmap
    - conntrack-tools
    - bash
    - jq
    - vim
    - nano
    - tree
    - ca-certificates
    - bind-tools

## Deployment on K8s cluster

Run `kubectl apply -f k8s/`

### What it does

- Creates a Namespace named `rubberduck`.
- Creates a Deployment resource, which runs `3` replicas of `rubberduck` pod.
- Exposes port `8080` on `rubberduck` container port using the service type `NodePort` inside the cluster.

repository: mr-karan/rubberduck

repo_name: mr-karan/rubberduck


text:
[![Test and Verify](https://github.com/otto-de/marketplace-php-sdk/actions/workflows/php.yml/badge.svg?branch=main)](https://github.com/otto-de/marketplace-php-sdk/actions/workflows/php.yml)

# Notice!
**Only products and shipments are currently supported. Other interfaces will follow!**

# Introduction
The otto market PHP SDK is an easy way for developers to access the otto market api in their php code, and build their programs on top of that.
A detailed documentation about all interfaces can be found at [our documentation][otto-market-api].

Jump to:
* [Requirements](#Requirements)
* [Installation](#Installation)
* [Use of the SDK](#Use-of-the-SDK)
* [Example CLI Client](#Example-CLI-Client)
* [Features](#Features)
* [Resources](#Resources)

## Requirements
1. **Sign up for Otto Market** – You need a working seller account. [Register here][otto-market-signup] and fetch your credentials.
2. **Minimum requirements** – To run the SDK, your system needs **PHP >= 7.4**.

## Installation
To use the SDK we recommend using [Composer]. It is available via [Packagist] under the [`otto/marketplace-php-sdk`][packagist-install].
You can include the SDK in your project using the following in the root directory of your project.:
```
composer require otto/marketplace-php-sdk
```

# Use of the SDK

### Set a new deliveryType and deliveryTime

```php
<?php

use Otto\Market\Client\Configuration;
use Otto\Market\Products\Model\Delivery;
use Otto\Market\Client\PartnerApiClient;

// Configure the client
$configuration = Configuration::forLive('my-api-username', 'my-api-password');
$client = new PartnerApiClient($configuration);

// Update the delivery information for all products
$myProducts = $client->getPartnerProductClient()->getProducts();
foreach ($myProducts as $productVariation) {
    $delivery = new Delivery();
    $delivery->setType('PARCEL');
    $delivery->setDeliveryTime(2);

    $productVariation->setDelivery($delivery);
}

// Save the updated products
$client->getPartnerProductClient()->postProducts($myProducts);
```

## Example CLI Client
For an implemented example go to [samples](samples).

## Features

We offer the following methods for usage:

- [products][products-doc]
  * get brands
  * get categories
  * get category defintion from category
  * get products
  * post products from json
  * get activeStatus
  * post activeStatus
  * get marketplaceStatus
- [shipments][shipments-doc]
  * get shipments
  * post shipments

## Resources

* **License** – see [Apache 2.0 License](./LICENSE)

[otto-market-signup]: https://www.otto.market/
[otto-market-api]: https://api.otto.market/
[composer]: http://getcomposer.org
[packagist]: http://packagist.org
[packagist-install]: https://packagist.org/packages/otto/marketplace-php-sdk
[shipments-doc]: https://api.otto.market/docs/06_Shipments/v1/shipment-interface.html
[products-doc]: https://api.otto.market/docs/03_Products/v2/products-interface.html


text:
# SlackBotRedux

A bot that integrates with Slack via the RTM API.

## Roadmap (WIP)
### Bot Infrastructure
- ~~Connecting to Slack via RTM API~~
- Ping heartbeat
- Rate-limit output queue
- ~~Sending and receiving different Slack messages~~
- Log everything (but censor anything said in private groups/DMs)
- Usable console proxy

### Modules
#### Quotes
- ~~`remember` command (remember stuff people say)~~
- `quotes` command (lists all quotes for a given user)

#### Variables
- ~~Allow circular references~~
- ~~Allow referencing of other variables, including the same variable~~
- ~~Allow protection of variables~~
- Magic/special variables (such as $band, $tla, $item, $who, etc)
- ~~`add variable` command~~
- `remove variable` command
- ~~`add value` command~~
- ~~`remove value` command~~
- `list values` command
- `list vars` command
- Variable types (noun, verb, var)

#### Factoids
- Allow referencing variables
- Allow protection of factoids
- Magic/special factoids (such as "don't know", "band name reply", etc)
- `X <verb> Y` command (including `<action>`)
- `list factoids` command (aka `literal X`)
- Triggering a specific factoid (aka `X ~= /text here/`)
- Substitution editing (aka `X ~= s/text to replace/new text/`)
- `what was that` command
- `undo last` command (only the one who made the last change can do this)
- `alias` command
- `merge` command
- `delete` command
- `delete id` command
- `forget that` command
- `lookup` command

#### Inventory
- various `gives item` command
- `delete item` command
- `list items` command

#### People
- Gender commands/variables
- Keeping track of recently speaking users
- Muting users/commands
- Permissions (op vs non-op)

#### Commands
- `say` command
- `shut up` command

#### TLAs
- Detecting TLAs

#### Config
- `set/get` commands
- Various configuration variables (band_name, band_var, etc)


text:
# Assignment 2 - Collocation

__Contribution__

The code of this assignment was created by me.

## Description of the assignment

__String processing with Python__

Using a text corpus found on the cds-language GitHub repo or a corpus of your own found on a site such as Kaggle, write a Python script which calculates collocates for a specific keyword.

- The script should take a directory of text files, a keyword, and a window size (number of words) as input parameters, and an output file called out/{filename}.csv.
- Find out how often each word collocates with the target across the corpus
- Use this to calculate mutual information between the target word and all collocates across the corpus
- Save result as a single file consisting of three columns: collocate, raw_frequency, MI
- BONUS CHALLENGE: Use argparse to take inputs from the command line as parameters

## Methods

As the task is to create an output file containing every collocate, their raw frequencies as well as MI, I need to calculate the MI. In order to do so, I first have to calculate the observed co-occurrence frequency and the expected co-occurance frequency of each word co-occuring with the keyword. I follow the documentation [here](http://collocations.de/AM/index.html). These observed and expected frequencies are then employed to calculate the MI; the MI is calculated as the log of the observed frequency divided by the expected frequency.

## Evaluation

The command line tool successfully returns a csv-file in the folder 'out' with the information 'collocate', 'raw_frequency', and 'MI'. The rows are sorted after frequency where the words with lowest co-occurrence frequency come first and highest occurrence frequency come last.

__Minor considerations__

The collocates are defined as appearing within a specified 'window' around the keyword measured in characters. Thus, all the words within the window are to the same degree considered as co-occurring with the keyword. In terms of meaning, there is however a difference between words appearing right next to each other and words appearing with several words between them. The window size is arbitrarily defined (the default is 30 characters on each side) and can be specified to be of any size in the command line. This could in turn alter the content of the output file dramatically as well as potential conclusions drawn from it.

The output file contains a lot of stopwords such as 'the', 'a', 'of', etc. from which it is hard to say anything about the keyword. To extract meaningful information from the output, I could have excluded these according to a stopword dictionary.

## Repository structure and files
This repository has the following directory structure:

| Column | Description|
|--------|:-----------|
```data```| A folder containing the data. The folder 'Stevenson' containing three texts of Robert Louis Stevenson has been provided. Any folder other folder could be added under 'data' and specified in the command line.
```out```| A folder containing the output csv-file from executing the script.
```collocation.py```| The script to be executed from the command line.
```create_lang_venv.sh```| A bash script to set up the virtual environment 'collocation_env'.
```README.md```| This file.
```requirements.txt```| All packages required to run the script. They will automatically be installed in the virtual environment when running the bash script.

## Usage (reproducing the results)

### Virtual environment
In order to run the script, one is required to set up the virtual environment with all necessary packages installed. Please clone the repo, navigate to the folder for this assignment, run the bash script to set up the environment, and lastly activate it. The following code should be executed from the terminal:

```bash
git clone https://github.com/askesvane/LanguageAnalytics.git
cd assignment2_Collocation
bash ./create_lang_venv.sh
source ./collocation_env/bin/activate
```

### Execute the script
Now, the script can be executed. From the command line, one is *required* to specify a keyword (--keyword) to which the script should find collocations. Additionally, one can specify the window size (--window_size) in characters (the default is 30) and a folder (--file_path) in 'data' with txt-files on which the script should perform the analysis (the default is 'Stevenson').

```bash
python collocation.py --keyword [write a word here] --window_size 30 --file_path Stevenson
```
After running, the output csv-file can be found in the folder ```out```.

repository: askesvane/LanguageAnalytics

repo_name: askesvane/LanguageAnalytics


text:
ansible-role-service
====================

[![Build Status](https://travis-ci.org/kevincoakley/ansible-role-service.svg?branch=master)](https://travis-ci.org/kevincoakley/ansible-role-service)

Manage services for CentOS 7 and Ubuntu 18.04

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

None

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

See defaults/main.yml

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

None

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

    - name: Start and Enable sshd
      hosts: service
      become: yes
      become_method: sudo

      vars:
        - service:
          - name: sshd

      roles:
        - ansible-role-service

License
-------

BSD

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

Kevin Coakley (https://github.com/kevincoakley)

repository: kevincoakley/ansible-role-service

repo_name: kevincoakley/ansible-role-service


text:
Welcome to Nadoku 👋

> A Sudoku game with relaxing nature sounds.

*A Flatiron School React Redux Portfolio Project: created with react 16.13.1, react-redux 7.2.1, redux-thunk 2.3.0, react-router-dom 5.2.0, sudokutoolcollection 1.1.3, react-bulma-components 3.4.0, Ruby 2.6.1, Rails <IP_ADDRESS>, and PostgreSQL 12.*

### 🏠 [Homepage](https://github.com/jamieberrier/nadoku)

### 💻 [Backend Repo](https://github.com/jamieberrier/nadoku-backend)

### ✨ [Demo](https://github.com/jamieberrier/nadoku)

## Install

```sh
npm install or yarn add
```

## Usage

```sh
npm start or yarn start
```

## Author

👤 **Jamie Berrier**

* Website: https://github.com/jamieberrier/nadoku
* Github: [@jamieberrier](https://github.com/jamieberrier)
* LinkedIn: [@jamieberrier](https://linkedin.com/in/jamieberrier)

## 🤝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check [issues page](https://github.com/jamieberrier/nadoku). You can also take a look at the [contributing guide](https://github.com/jamieberrier/nadoku).

## Show your support

Give a ⭐ if this project helped you!

## 📝 License

Copyright © 2020 [Jamie Berrier](https://github.com/jamieberrier).

This project is [ MIT](https://opensource.org/licenses/MIT) licensed.

***
_This README was generated with ❤ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_

repository: jamieberrier/nadoku

repo_name: jamieberrier/nadoku


text:
# Module swim_broadcasts #
* [Description](#description)
* [Function Index](#index)
* [Function Details](#functions)

This module is responsible for maintaining membership updates and user
provided events along with their state as a part of the
infection-style dissemination component of the SWIM protocol.

Copyright (c) 2015

__Version:__ Feb 18 2016 10:13:03

## Description ##

### Infection-Style Dissemination
As an alternative to IP Multicast
or a point-to-point messaging scheme the SWIM protocol
disseminates membership updates by piggybacking on messages sent
as a part of the failure detection protocol. Thus, implementation
does not generate any extra packets to send membership updates.

Here, `swim_broadcasts` maintains the buffer of recent membership
events along with a count for each event. The local count
specifies the number of times the event has been piggybacked so
far by this member and is used to choose which events to piggyback
next. Each event is piggybacked at most `Retransmit * log(N +
1)` times, where `Retransmit` is a configurable parameter.
If the size of events in the buffer is larger than the maximum number of
events that can be piggybacked on a single PING or ACK, events that have
been gossiped fewer times are preferred. This is needed as the
protocol period is fixed and the rate of membership changes might
temporarily overwhelm the speed of dissemination. Preferring
"younger" events under such circumstances ensures that all
membership changes infect at least a few members - when the
membership change rate quiesces, older events will
propagate through the rest of the gossip group. Membership events are always
preferred over user-provided events.

## Function Index ##

dequeue/2

dequeue/3	Dequeues a set of encoded events ready to be broadcast to other members
in the group.

handle_info/2

max_transmissions/2	Calculates the maximum number of times an event should be broadcast.

membership/2	Queues a membership event to be broadcast to other members in the group.

user/2	Queues a user event to be broadcast to other members in the group.

## Function Details ##

### dequeue/2 ###

dequeue(EventMgrPid::pid(), NumMembers::pos_integer()) -> binary()

### dequeue/3 ###

dequeue(EventMgrPid::pid() | module(), NumMembers::pos_integer(), MaxSize::pos_integer()) -> binary()

Dequeues a set of encoded events ready to be broadcast to other members
in the group

Events to be broadcast are determined by the number of the peers as well as
the size limitation provided by `MaxSize`. Membership events always take
precedence over user events. Events are broadcast up to a max of
determined by [`max_tranmissions/2`](#max_tranmissions-2). If the number of events
exceeds the maximum number of events allowable under `MaxSize`, events that have
been broadcast fewer times are preferred. This is needed as the rate of
incoming events, i.e. membership changes, might temporarily overwhelm
the speed of dissemination.
Preferring younger events ensures that all events
infect at least a few members. Events that have exceeded
their retransmit limit are removed from the broadcasts. Events that are
returned have their number of retransmissions incremented by 1.

### handle_info/2 ###

`handle_info(Info, State) -> any()`

### max_transmissions/2 ###

max_transmissions(NumMembers::pos_integer(), RetransmitFactor::pos_integer()) -> pos_integer()

Calculates the maximum number of times an event should be broadcast.

### membership/2 ###

membership(EventMgrPid::pid(), Event::{member_status(), member(), incarnation()}) -> ok

Queues a membership event to be broadcast to other members in the group

### user/2 ###

user(EventMgrPid::pid(), Event::term()) -> ok

Queues a user event to be broadcast to other members in the group

repository: protostartup/swim

repo_name: protostartup/swim


text:
---
title: The new MODIStsp website (based on pkgdown) is online !
author: Lorenzo Busetto
date: '2017-07-25'
slug: the-new-modistsp-website-based-on-pkgdown-is-online
categories:
  - MODIS
  - MODIStsp
  - pkgdown
  - R
  - website
tags:
  - R
  - pkgdown
header:
  caption: ''
  image: ''
---
The **MODIStsp** website, which lay abandoned since several months on github
pages, recently underwent a major overhaul thanks to **[pkgdown](http://hadley.github.io/pkgdown)**.
The new site is now available at <http://ropensci.github.io/MODIStsp/>

![](/img/MODIStsp_Website.png)

We hope that the revised website will allow to navigate MODIStsp-related material
much more easily than either github or the standard CRAN documentation, and will
therefore help users in better and more easily exploiting MODIStsp functionality.

The restyling was possible thanks to the very nice "**pkgdown**" R package
(<http://hadley.github.io/pkgdown>), which allows to easily create a static documentation website.

Though pkgdown does already quite a good job in creating a bare-bones website
exploiting **just the material available in a standard devtools-based R package file
structure**, I was surprised at **how simply the standard website could be tweaked**
to obtain a very nice (IMO) final result without needing any particular background
on html, css, etc. !

(On that, I plan to soon post a short guide containing a few **tips and tricks**
I learnt in the last days for setting up and configuring a pkgdown website, so stay
tuned !)

repository: lbusett/spartially

repo_name: lbusett/spartially


text:
# Status Bar Speedometer
A simple Android app that displays your current speed as a notification in the status bar.

It is toggleable through shortcuts and supports 4 different units:
- m/s
- km/h
- mi/h
- ft/s

Find the app here: https://play.google.com/store/apps/details?id=ch.rmy.android.statusbar_tacho

repository: ashish-andev/Status-Bar-Tachometer

repo_name: ashish-andev/Status-Bar-Tachometer


text:
# OPS

### Wormhole

- [Documentation](https://wormhole.api.bbci.co.uk/docs/)
- Configuration => https://api.live.bbc.co.uk/cosmos/env/{{env}}/component/{{component}}/configuration
- Secure Configuration => https://cosmos.api.bbci.co.uk/env/{{env}}/component/{{compenent_name}}/configuration/{key}

### Cosmos

- [Doc](https://api.live.bbc.co.uk/cosmos/docs/)

### AWS

- [Cosmos](https://admin.live.bbc.co.uk/cosmos)
- [Cosmos AWS](https://bbc-engineering.signin.aws.amazon.com/console)
- [Cosmos Wormhole](https://wormhole.api.bbci.co.uk/account/240129357028/console)
- [Cosmos Repository](https://repository.api.bbci.co.uk/)
- [Syndication AWS](https://platform-api-syndication-prod.signin.aws.amazon.com/console)
- [Syndication Wormhole](https://wormhole.api.bbci.co.uk/account/111707543740/console)

### Forge

- [Artifactory](https://dev.bbc.co.uk/artifactory/webapp/home.html)
- [CA](https://ca.dev.bbc.co.uk/)
- [EJBCA](https://ca.dev.bbc.co.uk/ejbca/index.jsp)
- [Repo](https://repo.dev.bbc.co.uk/)
- [RPMs](https://yum.dev.bbc.co.uk/live/noarch/)
- [Service App RPM Logs](https://logs.forge.bbc.co.uk/tail/download/live/service-app-live-log/rpmlog)
- [Service DB RPM Logs](https://logs.forge.bbc.co.uk/tail/download/live/service-db-live-log/rpmlog)
- [Service PAL RPM Logs](https://logs.forge.bbc.co.uk/tail/download/live/service-pal-live-log/rpmlog)
- [Service Static RPM Logs](https://logs.forge.bbc.co.uk/tail/download/live/service-static-live-log/rpmlog)

### Dev Setup

- [CIDR Blocks](https://confluence.dev.bbc.co.uk/display/ta/Multiple+account+infrastructure#Multipleaccountinfrastructure-allocation)
- [Forge Vagrant Setup](https://confluence.dev.bbc.co.uk/display/comments/Development+set+up)
- [Generate Cloud Formation](https://confluence.dev.bbc.co.uk/display/IBL/Generate+infrastructure+templates+outside+the+sandbox)
- [Mac Setup](https://confluence.dev.bbc.co.uk/display/modav/Dev+or+Test+setup)
- [Sandbox<EMAIL_ADDRESS>


text:
# Coodesh

## Company blurb

Coodesh was born with the purpose of helping other companies build the best and most diverse technology teams. We believe that in the current
context of startups and digital transformation of large companies, efficient tech recruitment with relevant insights for the evolution of hired people
is one of the biggest differentials for success.

 We were born with 100%
remote teams and we always will be.

## Office locations

Brazil

## Company technologies

 HTML/ CSS / Javascript / Typescript / React.js / React Native / Vue.js / Node.js / PHP / Laravel

## How to apply

[Linkedin Jobs](https://www.linkedin.com/company/coodesh/jobs/)

[Coodesh Vacancies](https://coodesh.com/vagas)

repository: remoteintech/remote-jobs

repo_name: remoteintech/remote-jobs


text:
---
layout: distill
permalink: /portfolio/
title: portfolio
description: Summary of my professional work experience as a software engineer.
nav: true
nav_order: 1

toc:
  - name: Unannounced project (TBA)
    # if a section has subsections, you can add them as follows:
    # subsections:
    #   - name: Example Child Subsection 1
    #   - name: Example Child Subsection 2
  - name: "Dragon Ball Z: Kakarot Remastered (2023)"
  - name: "Demon Slayer: The Hinokami Chronicles (2021)"
  - name: Far Cry 5 (2018)
  - name: Steep (2016)
---

[comment]: <> (Use https://embedresponsively.com/ for embedded videos)

## Unannounced project (TBA)
**Company:** Treyarch\
**Platforms:** TBA\
**Role:** Senior Software Engineer

## Dragon Ball Z: Kakarot Remastered (2023)

>
>  Watch trailer
>

>

**Company:** CyberConnect2\
**Platforms:** PlayStation 5, Xbox Series X, Windows\
**Role:** Software Engineer

- Was in charge of development of the offline version of **Dragon Ball Card Warriors**
- Worked on upgrading the game engine to the latest version
- Provided technical solutions to creative requests from other sections
- Worked on areas such as gameplay, AI, networking, and UI
- Integrated required middleware

## Demon Slayer: The Hinokami Chronicles (2021)

>
>  Watch trailer
>

>

**Company:** CyberConnect2\
**Platforms:** PlayStation 4, PlayStation 5, Xbox One, Xbox Series X, Windows\
**Role:** Software Engineer

- Worked with multiple game engine subsystems including gameplay, input, UI, etc
- Created tools needed for the production

## Far Cry 5 (2018)

>
>  Watch trailer
>

>

**Company:** Ubisoft\
**Platforms:** PlayStation 4, Xbox One, Windows\
**Role:** Gameplay Engineer

- Implemented and polished various gameplay mechanics and weapons for Far Cry 5: **Lost on Mars DLC**, including laser pistol, homing missiles, freezing rifle, and others
- Was in charge of assessing the technical feasibility of new features and the impact they bring on other modules and systems
- Interacted with the multiple job families responsible to create assets for the game (game design, art, VFX, sound)
- Worked with multiple game engine subsystems including gameplay, AI, UI, input, network, and VFX to obtain fully implemented features

## Steep (2016)

>
>  Watch trailer
>

>

**Company:** Ubisoft\
**Platforms:** PlayStation 4, Xbox One, Windows\
**Role:** Input and UI Engineer

- Worked as a part of the Kyiv PC team responsible for the PC version of the winter sports game Steep
- Supported various gamepads and mouse/keyboard input (DirectInput, XInput)
- Worked on localization features like dynamic input guide, adaptive tutorial messages, keyboard layouts
- Implemented and supported in-game UI elements, HUDs, and menus, including Mountain View


text:
---
layout:     post
title:      UWP mobile side loading
date:       2017-04-06
categories: uwp mobile side-loading xamarin
---
Installing universal Windows apps outside of the store is a bit different than iOS or Android. [HockeyApp documentation](https://support.hockeyapp.net/kb/client-integration-windows-and-windows-phone/how-to-sideload-uwp-applications) explains how to do it but they are missing some important (and perhaps frustrating) details that I will explain below.

Actually you don´t need HockeyApp to side-load Windows 10 apps as you can upload your build wherever you want, but obviously with HockeyApp you get many more
features for free, like crash reporting, distribution management, event logging, integration with Visual Studio, etc. [Visual Studio Mobile Center](https://mobile.azure.com) is the next generation of HockeyApp but as of today it doesn´t support Windows Universal apps.

## Compile a release build for mobile

Not much to add to the HockeyApp doc in this step. Check it out [here](https://support.hockeyapp.net/kb/client-integration-windows-and-windows-phone/how-to-sideload-uwp-applications#build-application),
but bear in mind that in the last step (architecture check-boxes), you should only check ARM if your app is not targeting desktop devices. The bundle size will decrease a lot.

## Upload the build to HockeyApp

The result of the previous step is a new folder (i.e: _YourApp_<IP_ADDRESS>_Test_) in the _AppPackages_ directory of your UWP project with the following contents:

You´ve got two options here:

1. Upload the single .appxbundle file
2. Zip the whole directory and upload it to HockeyApp (this is the same thing Visual Studio does for you when right clicking on the project > HockeyApp > Distribute app...)

Whether you choose 1 or 2 will affect how users install the app:

If you choose 1), installing the app is easier, as the user will just click the "Download" button in the HockeyApp web page, and then click the downloaded file to install it.

Going for the option 2 means that a user will download a zip to the mobile device, opening that zip and then tapping on the .appxbundle file to finally install the app. Windows 10 Mobile cannot open zips out of the box, and so a third party app like [Zip Archiver](https://www.microsoft.com/es-es/store/p/zip-archiver/9wzdncrd1l2f) should be installed first.

Why on earth would you want to make things harder with a zip file and why is it the default option in Visual Studio? See below on "Installing dependencies"

## Upload symbols to HockeyApp

To see better crash information and stack traces, right after the previous step, drag the _.appxsym_ file to the HockeyApp page. Then, go to _ProjectFolder/bin/ARM_, zip the file _YourAppName.pdb_ and drag _YourAppName.zip_ to the same page. There is also a button to "Upload build or sym" and another to "Upload zipped .pdb":

## Device setup

To install any app compiled with a test certificate or coming from an untrusted source (like HockeyApp), the user needs to enable Windows developer mode on the device. Go to settings > Update & Security > For developers and select "Developer mode":

## Installing dependencies

When you debug your app through a usb connected device, Visual Studio will install all dependencies for you in the background and everything will just work. However, other users trying to install your app will open the .appxbundle, install the app and it won´t appear anywhere in the device. Windows won´t let them know something wrong happened (the installation failed silently without errors).

This happens when dependencies are not installed on the user´s device because they don´t get installed automatically (BTW, a simple "please, install dependencies" alert would have saved me many wasted hours thinking that I did something wrong with the app bundle package).

Dependencies need to be installed usually once per device, unless you release a new version of your app that targets a newer version of Windows. In that case users will need to install them again. It´s a good idea to inform the users and testers about these details before they try to install for the first time.

Installing dependencies involes having them on the device and then clicking/tapping on each one to confirm installation.
They are located in the "Dependencies" folder inside the zip you created previously:

_Keep in mind that if your release build is composed by the single .appxbundle file, you are assuming the user already installed these dependencies._

## Installing the application

Last but not least, tap on the .appxbundle to install the app. Everything should work now. For the next version release, this is the only step needed.

gha_language: CSS


text:
Things to talk about:
---------------------

- Hack-a-thon
- Mics Reimbursement
- National Membership
- End of year report
- Alumni Meetup

Things talked about:
--------------------

- Hack-a-thon
    - Jp, Jordan, Rebecca will be helping
    - We need a theme for the game
    - Try to target non-coders or little experience
    - Game Maker or Alice are some options for non coders
    - JP and Rebecca will be taking care of Game Maker or Alice
    - Jordan will be making a PyGame Library
    - The name will be discuessed on the forums and decided in 2 weeks
    - Renamed from Hack-a-thon to Game Jam
    - 3 Strike system for making sure things get done or the event is off
    - The people that will be taking on the resposabilities
        - Fundrasing options
            - Jordan
        - Outreach options
            - Rebecca
        - Local Advertising options
            - Jordan
        - Facilites
            - JP
        - Budgeting
            - Jordan
        - Webteam
            - JP

- Mics Reimbursement
    - Rebecca still needs to contact Karin

- National Membership
    - JP and Kyle are in the system

- End of year report
    - Rebecca will figure it out

- Alumni Meetup
    - Wont be happening during the summer
    - Possibly in the fall


text:
---
title: Bounty Hacker (Try Hack Me)
author: Robin Goyal
date: 2021-08-25 10:55 -0400
categories: [Cybersecurity, Writeups]
tags: [thm, ctf, writeup, ftp, ssh, privesc, tar, hydra, brute force]
hidden: true
image:
  src: https://tryhackme-images.s3.amazonaws.com/room-icons/11d59cb34397e986062eb515f4d32421.png
---

I am currently in the process of completing these boxes on Try Hack Me again in an effort to document my experience, reinforce my knowledge of the topics, and improve my ability to concisely communicate the pentest lifecycle.

Note: The target IP address may change throughout the writeup as I complete the room over a period of time.

## Scenario

**Title**: Bounty Hacker

**Link**: https://tryhackme.com/room/cowboyhacker

**Description**: You talked a big game about being the most elite hacker in the solar system. Prove it and claim your right to the status of Elite Bounty Hacker!

**Free/Subsciber**: Free

**Difficulty**: Easy

## Enumeration

First things first as always, start off with an nmap scan to enumerate the services on the target.

![nmap results](/assets/img/posts/thm-bounty-hacker/nmap.jpg)

From the version information for the SSH and Apache services in the nmap scan results, the target is an Ubuntu OS. There are a total of three open ports from our scan of the top 1000 ports:

- 21 (FTP)
- 22 (SSH)
- 80 (HTTP)

### FTP

The ftp-anon NSE script indicates that anonymous FTP login is enabled.. Connecting to the server and listing the files shows there's two files present:
- task.txt
- lock.txt

```plaintext
1.) Protect Vicious.
2.) Plan for Red Eye pickup on the moon.

-lin
```

```plaintext
rEddrAGON
ReDdr4g0nSynd!cat3
Dr@gOn$yn9icat3
R3DDr46ONSYndIC@Te
ReddRA60N
R3dDrag0nSynd1c4te
dRa6oN5YNDiCATE
ReDDR4g0n5ynDIc4te
R3Dr4gOn2044
RedDr4gonSynd1cat3
R3dDRaG0Nsynd1c@T3
Synd1c4teDr@g0n
reddRAg0N
REddRaG0N5yNdIc47e
Dra6oN$yndIC@t3
4L1mi6H71StHeB357
rEDdragOn$ynd1c473
DrAgoN5ynD1cATE
ReDdrag0n$ynd1cate
Dr@gOn$yND1C4Te
RedDr@gonSyn9ic47e
REd$yNdIc47e
dr@goN5YNd1c@73
rEDdrAGOnSyNDiCat3
r3ddr@g0N
ReDSynd1ca7e
```

The first file, task.txt, contains two tasks which may be important but doesn't provide much information other than the fact that it was written by **lin** which could be a potential username for further FTP or SSH access.

The second file, lock.txt, may be a password list which could be used in combination with the username, lin, to brute force those services.

### HTTP

Let's first check out the HTTP site. The initial page contains some various quotes from Cowboy Bebop, an anime.

There's no information leaked in the source code, no robots.txt file, and no results in the directory enumeration scan.

Let's approach the SSH service with the data that we found from the FTP server.

## Initial Foothold

### Hydra

As an initial check, no information was leaked in the banner when trying to connect. With the potential username, lin, and the password file, let's use Hydra to brute force the SSH service.

![hydra results](/assets/img/posts/thm-bounty-hacker/hydra.jpg)

Success! We can conncet to the target machine through the SSH service with the credentials `lin:RedDr4gonSynd1cat3`.

In the users home directory, the user.txt flag is available for us!

![user flag](/assets/img/posts/thm-bounty-hacker/user-flag.jpg)

User Flag: `THM{CR1M3_SyNd1C4T3}`

## Privilege Escalation

Checking for the sudo privileges of lin since we have his password, he is able to run the /bin/tar binary as root.

![sudo privileges](/assets/img/posts/thm-bounty-hacker/sudo-privs.jpg)

Fortunately, gtfobins has an incredibly simple example of abusing this to attain a privileged shell [^gtfobins].

![privilege escalation](/assets/img/posts/thm-bounty-hacker/privesc.jpg)

There we go! We have successfully attained a root shell. The above command is attempting to create a tar archive into /dev/null with content from /dev/null and at every checkpoint (1 file), it executes the /bin/bash binary as root which is how we escalated our privileges.

![root flag](/assets/img/posts/thm-bounty-hacker/root-flag.jpg)

Last step is just find the root flag /root.

Root Flag: `THM{80UN7Y_h4cK3r}`

## Reflection

This room was not as difficult as some of the other Easy rated rooms that I have come across on THM but it was a good opportunity to try other vectors instead of getting stuck on one.

The HTTP server had nothing to do with the killchain for this target but it commonly is in these CTF style rooms.

Lastly, the manipulation of the tar command is an interesting method to escalate your privileges.

### Killchain Summary

1. Authenticate anonymously to the FTP server to find a password list and a potential username.
2. Brute-force the SSH server with the username and password list to obtain an initial foothold.
3. Escalate privileges through the tar binary which lin is allowed to execute as root.

### Misconfigurations

1. Anonymous authentication should not have been enabled for the FTP service.
2. Sensitive information was leaked on the FTP server.
3. To prevent brute-force attempts to the SSH service, password authentication should be disabled and private key authentication should have been enabled.
4. The user, lin, should not have had the privileges to run tar as sudo.

### Summary of exploits

#### Privilege Escalation

IF tar has sudo privileges, obtain a root shell by:

```
sudo tar -cf /dev/null /dev/null --checkpoint=1 --checkpoint-action=exec=/bin/bash
```

This will attempt to compress the contents of /dev/null into /dev/null but executing an action at each checkpoint. The action will load a Bash interpreter with the privileges of the root user.

### Things I Learned

1. Escalating privileges by abusing the SUDO privileges for the tar binary.

## References

[^gtfobins]: <https://gtfobins.github.io/gtfobins/tar/#sudo>


text:
# thumbor-graphicsmagick-dockerfile

This `Dockerfile` describes how to setup thumbor with the graphicsmagick engine on Ubuntu.

## How to run

    git clone git@github.com:mat/thumbor-graphicsmagick-dockerfile.git
    cd thumbor-graphicsmagick-dockerfile
    docker build -t thumbor-gm .
    docker run -p 8080:8080 thumbor-gm
    curl -I http://$(docker-machine ip default):8080

## Thanks

I started researching this during our student exchange between <https://www.xing.com> and <http://www.jimdo.com>. Thanks to both for letting me work on interesting things.

## License

The MIT License (MIT)

Copyright (c) 2015 Matthias Lüdtke, Hamburg - http://github.com/mat

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: mat/thumbor-graphicsmagick-dockerfile

repo_name: mat/thumbor-graphicsmagick-dockerfile


text:
# Advent of code 2020

Here's my 2020 attempt at AOC. I will try to do this daily but I will not sweat it if I cannot do it one day.

I will be doing the solutions in Python 3.8+ because I miss it so much :(

## The AOC Framework

Every solution follows nearly the same structure:

* One solution with two parts
* Nearly always the same file shared between the two
* Nearly always the file is composed by lines of numbers
* Solution of part 1 could be used by part 2

I created a small framework to help with the development of AOC solutions, so I don't have to always code the same boilerplate

### How to run solutions

Execute `python3 run.py` to run all solutions using my runner. Use Python 3.8+.


text:
# Wallpaper publisher

This publisher builds wallpaper from published and polled camera images.
Intended for showing cameras on PC desktop.

## Dependencies

This publisher does not have any external dependencies, other than listed in the go-iotdomain README.md

## Configuration

Edit wallpaper.yaml with the configuration parameters.

See config files in ./test as examples

repository: iotdomain/wallpaper

gha_language: Go

repo_name: iotdomain/wallpaper


text:
# CIoTA - how it works?

## Overview

### Architecture of CIoTA

The CIoTA consists of set of agent programs. Each agent program works in different machine and watches for its protected application. An agent detects anomalies when its protected application starts to behave different then usual. In order to detect such an unusual behavior the agent learns and models constantly the application behavior. Knowing the behavior model the agent can detect anomaly when the application runs out of the learned model. Then, the detected anomaly can be reported and visualised in GUI program. The GUI program runs on GUI server. It registers all the agents and it continuously shows their state.

![The CIoTA networking diagram](images/CIOTA_networking.jpg?raw=true  "The CIoTA networking diagram")

Current implementation of CIoTA requires that agent must be in the same network.

### Learning

The protected application can be any program that runs on the same machine with an agent. The application path and name is given to the agent in its configuration file. The agent learns how the protected application works by tracing the application indirectly using system function calls. The functions called periodically returns to the agent actual addresses of machine memory space used by the protected application routines and subroutines. In time, the agent creates statistics of the addresses usage and then calculates probabilities of transition from the given address to every next address. Thus, the matrix of probabilities is created, and the matrix is the learned model of the application behavior. The model is created independently by every agent. When created, the model is shared with other agents via network. When the agent receives the model from other agent, it can decide what to do with this. Based on consensus criteria the own model can be replaced with new one.

![ The agent communicates with other agents and with GUI same way, by multicasting an UDP datagram to multicast IP address. The multicast IP adress is given to the agent and to the GUI in its configuration file.

![Sharing intelligence](images/sharing_info.png "Sharing intelligence algorithm")

At the same time the agent listening to other agents datagrams. In this manner every agent can and should communicate with every other agent (assuming that the agents "see" - ping each other agents machines).
The UDP datagram contains information about learned application model and actual state of an agent. So, other agent receiving the datagram can use sent model, and GUI server can display actual state of all the agents.

![Receiving intelligence](images/receiving_info.png "Receiving intelligence algorithm")

Networking is implemeted by several classes.

Class | Description
----- | -----------
BroadcastServer | Interface for broadcast server.
MulticastServerDescriptor | Multicast server that implements the BroadcastServer interface. Support both sending and receiving multicast packets.
MessageFragmentationServer | Implementation of BroadcastServer that fragment messages into smaller packets to prevent packet losses possible, because non-reliable UDP protocol is used.
SimpleProtocol | Interface for protocol client utils.
SimpleTcpProtocol | Implementation of SimpleProtocol over TCP sessions.
CompressionLibrary | Defines interface for compression tools. Not used at current stage.

### Blockchain

The agents are participants of CIoTA blockchain and all of them stores chain of blocks. The blocks are sets of a records. The record is a serialized learned model of the protected application behavior. The blocks contain information about learned application model from given point of time. Blocks are stored in order of oldest to newest one and they are hashed accordingly to blockchain protocol. Not all blocks are stored - only a numer of the newest blocks. The number of stored blocks is configured by parameter "capacity", which limits amount of a memory space for the blocks.

## Implementation of key CIoTA ingredients

### Agent

The Agent does as following:
1. Create a new compression and encryption library.
2. Create instance of model utilities.
3. Initiate a new MulticastServerDescriptor instance.
3. Initiate a new ExtendedAnomalyListener instance.
4. Initiate a new CIoTABlockchainApplication.
5. Initiate a new Agent.
6. Execute the agent.

### Learning: creating the behavior model

The task of learning a behavoiur of protected application is implemented by JumpTracer class. JumpTracer is an extended Markov chain over a program control-flow events.
It allows for efficiently computing the probability for a jump sequence during the execution of a program.
JumpTableUtilities are used to as a bridge to connect JumpTracer to CIoTA functionalities.

JumpTracer is parametrized in configuration file. The possible options are:

Option | type  | Description
------ | ----  | -----------
application | string | path to the application executable. In demo case its LogServer application - simple web server.
mask       | Address size (32/64 bit) | mask that used to reduce the model size and ignore noises.
filterFrom | Address size  (32/64 bit) | filter all address lower then the given value.
filterTo   | Address size (32/64 bit) | filter all address bigger then the given value.
windows    | size_t | How many events are considering as sequence to test.
threshold  | size_t | Threshold for the anomaly score, anomaly score under the given threshold will rise an alert.
trainInterval  |  uint | How much time the model should be in training mode.

#### The behavior model

The behavior model in theory is a square matrix of probabilities of state changes. Actual implementation of it is a map of a map (JumpTracer.h):

```
std::map<CodeAddress, std::map<CodeAddress, uint64_t>> _table{};
```

In the implementation the map is accessed by [] operator which makes a map looks like a table. External map key of CodeAdress type (start of a jump) points to a map with destination adresses with counters.
Along with the matrix of jumps goes map of sums.
```
std::map<CodeAddress, uint64_t> _sums{};
```
The sum contains summed number of all jumps from given source CodeAddress.

Size of the model is not known at the beginning. It grows when new jump is registered. To reduce size of the model not all adresses are registered. The addresses are masked and filtered.
```
std::pair<CodeAddress, CodeAddress> _filter;

CodeAddress JumpTracer::prepareAddress(CodeAddress address) {
    if (_filter.first <= address && address <= _filter.second) {
        return address & _mask;
    }
    else{
        return 0;
    }
}
```
All values regarding preparation of addresses (range and mask) are taken from configuration file.

There is another "sum" in JumpTracer class:
```
uint64_t _sum{};
```
The _sum contains sum of last N probabilities of last N jumps ("events"). One probability value is in range of 0-100 (0-impossible, 100-certain). Number N is a size of a circular buffer and is set by "windows" configuation parameter. While jumps occurs the sum is increased by the jump probablility. Sum of N last jumps probabilities compared to pThreshold*windows gives information about current behavior of protected application. If the sum is below pThreshold*windows, it means that the N last jumps are of little probability, so it is an abnormal behavior.

Essential operations on the model are:
 - recording a jump
 - calculating a probability of a jump
 - merging number of models into one (combininig them)
 - comparison of the models (checking if the new model is valid in context of current model).
Below detailed description of the operations.

##### Recording a jump into model

Recording a jump into a model is implemented in JumpTracer.cpp
```
void JumpTracer::consume(CodeAddress data)
```
In training mode the function just fills the model with jumps, which is increasing counters in _table and in given "row" counter of the _table:
```
void JumpTracer::addJump(CodeAddress src, CodeAddress dst) {
    this->_table[src][dst] += 1;
    this->_sums[src] += 1;
}
```
When model is trained, the function checks if current series of last probabilities registered in circular buffer indicates an anomaly. The _sum value contains sum of last N probabilities of last N jumps ("events") registered in _event circular buffer. Sum of N last jumps probabilities is the current "score". The score compared to pThreshold*windows gives information about current behavior of protected application. If the score is below pThreshold*windows, it means that the N last jumps are of little probability, so it is an abnormal behavior and it is time to alert anomaly detection.

##### Calculating probablility of a jump

Probability is a value of type uint8_t (0-255). Jump is identified by a pair of start and end adressess. If such pair does not exists in the model, the probability is a 0.
```
uint8_t JumpTracer::calcProbability(CodeAddress from, CodeAddress to)
```
If the jump exists, probability is calculated like this:

number of recorded jumps from address "from" to address "to" divided by sum of numbers of all jumps from "from" and all is multiplied by 100 (MAX_GRADE) to stretch value to uint8_t type.
So, value of 100 equals mathemathical probability of 1.

#### Merging number of models into one

Merging of models into one is implemented in JumpTracerUtilities.cpp
```
JumpTracer *JumpTracerUtilities::combine(const std::vector<MemBuffer*>* set)
```
As an argument we have set of blocks (models). Combining them into one model is two steps operation. First, two maps are created, one map containing all jumps from all models and their sums of probablilites, second map contains counters of all the jumps from combined models.
Second step is using this data and taking consensus into account. Empty model is created and is populated with jumps under conditions:
- either the jump occurs in consensus number of models
```
count[row.first][column.first] >= _pConsensus)
```
- or this is partial block:
```
set->size() < _consensusSize
```
_pConsensus is configuration parameter ("pConsensus") of number of agents which is enough to make consensus, _consensusSize is size of the block in the ledger ("completeBlockSize").

#### Comparison of two models

Models are compared to validate new model against the local model. Result of the comparison is a percentage distance. If the distance is below setup value ("alpha"), then the new model is verified and can be accepted to replace local model. Comparison is implemented in
```
uint8_t JumpTracer::compare(const JumpTracer * model)
```
The distance is calculated in loop iterating both models in parallel. For every jump which not exists in local model and exists in new model value of MAX_GRADE (100) is added to distance value, and counter of jumps is increased. If jumps are present in both models (start address in the jumps is the same), distance is calculated as absolute value of difference of probabilities of the jumps. When iteration ends, distance is made average value - its value is divided by jumps counter value. Its returned like this:
```
return static_cast<uint8_t>(MAX_GRADE - (distance / counter));
```
So, if difference between models is 2% or less, new model is valid.

#### Retrieving calls (addresses)

JumpTracer is used by an agent indirectly in CIoTA_Agent.cpp:
```
JumpTracerUtilities utilities(pid, pConsensus, completeBlockSize, trainInterval, &emptyModel, recordJump);
```
Here, "recordJump" is a function which periodically retrieves addresses of a protected application calls and put them to model with help of the JumpTracer class functions. The recordJump function retrieves addresses using operating system kernel function perf_event_open:

Tracer.cpp:

```
static int perf_event_open(struct perf_event_attr *hw_event, pid_t pid,
                           int cpu, int group_fd, unsigned long flags) {
    int ret;
    ret = static_cast<int>(syscall(__NR_perf_event_open, hw_event, pid, cpu,
                                   group_fd, flags));
    return ret;
}
```

#### Detection of anomaly

Anomaly is detected, and an alert is raised in the JumpTracer class in JumpTracer::consume(CodeAddress data) function. The alert is raised by calling:

```
_alertListener->anomalyAlert(_sum);
```
Detection of anomaly is based on one condition:

```
 if(_sum < _pThreshold)
```
where:
 - _pThreshold here is "pThreshold" configuration parameter multiplied by "windows" configuration parameter (which defines size of "events" window - size of last recoreded jumps probabilities).
 - _sum value contains sum of last N probabilities of last N jumps ("events") registered in _event circular buffer. Sum of N last jumps probabilities is the current "score". The score compared to pThreshold multiplied by windows gives information about current behavior of protected application. If the score is below pThreshold*windows, it means that the N last jumps are of little probability, so it is an abnormal behavior and it is time to alert anomaly detection.

The score presented in detection anomaly alert is value of a "_sum".

### Networking: the datagram

The datagram data structures are defined in MessageFragmentationServer.h
```
typedef struct MessageFragmentHeader{
public:
    const bool    _isHeader;
    unsigned char _type;
    unsigned int  _id;
    size_t        _len;
    char          _sha[SHA256_OUTPUT_SIZE];
} MessageFragmentHeader;

typedef struct FragmentHeader{
    const bool    _isHeader;
    unsigned char _fragId;
    unsigned int  _id;
} FragmentHeader;

typedef struct FragmentedPacket{
    unsigned char _type;
    size_t        _len;
    char          _from[IP_ADDRESS_STRING_LENGTH]{};
    //unsigned char _nextFragId;
    size_t        _totalSize{0};
    char          _sha[SHA256_OUTPUT_SIZE];
    std::map<unsigned char, MemBuffer> _mapData{};
} FragmentedPacket;
```
### Networking: receiving

Receiving data routine is implemented in MulticastServerDescriptor.cpp. It listens on multicast port defined in configuration parameters:

Option | type  | Description
------ | ----  | -----------
port              | ushort       | Port for the multicast protocol.

int MulticastServerDescriptor::recv(char *buffer, size_t len, char *fromAddress)

### Networking: sending

Sending is multicasting data and its implemetend in MulticastServerDescriptor.cpp. Multicasting needs configuration parameters:

Option | type  | Description
------ | ----  | -----------
multicastGroup    | string (ip)  | The IP used by the multicast protocol.
port              | ushort       | Port for the multicast protocol.

int MulticastServerDescriptor::broadcast(unsigned short port, const char *buffer, size_t len)

### Blockchain implementation

Blockchain implementation depends on the following classes:
* CppUtils/MemBuffer.h
* CppUtils/Exceptions.h
* CppUtils/Cursor.h
* CppUtils/SerializableBoundedQueue.h

It contains the following files and dependencies:

File | Description | Dependency
---- | ----------- | ----------
BlockRecord.h | Define utilities to create, edit and manage blocks's records. | None.
BlockRecord.cpp | Include implementation of the "BlockRecord.h" file. | BlockRecord.h
Block.h | Define utilities to create, edit and manage blocks | BlockRecord.h
BlockchainApplication.h | Define an interface that uses to configure the blockchain behaviors. | Block.h
Blockchain.h | Defines and implements a generic blockchain manager class. | BlockchainApplication.h

#### Blockchain structure
The blockchain implementation is not the simplest, yet it allows for reducing the memory allocated during the execution.
Both records and blocks as serialized buffers of bytes to allows straightforwardly sending them - merely send the buffer, without a need to "duplicate" it.
All blocks' operations change the serialized form of the block to maintain its integrity.
The interface of "BlockchainApplication.h" allows to customize the blockchain's properties and therefore results in a more flexible implementation.
To use this module, you need to implement the BlockchainApplication interface and initialize an object of the Blockchain class (defined in "Blockchain.h").

#### Record
Each record is composed from two fields: <From><Content>
 * Where <From> is the record owner (the one that created it).
 * Where <Content> is the record content (the one that created it).
For example, in bitcoin <From> is the public key of the one performing the transaction and <Content> is the transaction (The receiver and how much money to transfer).

#### Block
Block is a buffer that represents a blockchain block.
Each block is composed from the following fields (in that order):

Field | type | setter | getter | Description
----- | ---- | ------ | ------ | -----------
Block id | size_t | setBlockId | BLOCK_ID | The block position inside the blockchain.
Timestamps | time_t | None | BLOCK_TIMESTAMP | The block's creation time.
Previous Hash | char[H] | setBlockPrevHash | BLOCK_PREV_HASH | The hash of the previous block in tha chain.
Block Seed Size | size_t | None | BLOCK_SEED_SIZE | The size of the seed buffer.
Block Seed | char* | None | BLOCK_SEED | The seed of this block.
Number Of Records | size_t | addRecordContent | BLOCK_NUM_OF_RECORDS | The number of records inside this block.
Block data | char* | None | BLOCK_DATA, getBlockRecord | the list of records.

Underlying the block implementation are buffers related functionalities and classes such as:
* MemBuffer
MemBuffer is a class that was meant to ease the use of using dynamic buffers.
It is a buffer which supports expansion and reduction of size and data dynamically at runtime.

Signature | description
--------- | -----------
void append(const void* ptr, size_t len) | Append data from ptr into this buffer.
 @param ptr to the data.
 @param len to read from ptr.
 @attention  ptr is copied and should be freed by the caller.
void reserveMore(size_t n) | Reserve n more bytes in this buffer.
 @param n - how many byte to reserve.
void appendValue(char value, size_t n) | Append a char value n times.
 @param value to append
 @param n - how many times to write the value.
void padValueTo(char value, size_t desiredLength) | Pad this buffer to the desired length with a given value.
 In a case where the length of the buffer is already equal or greater than the desired length nothing occurs.
 @param value to pad with.
 @param desiredLength of the buffer.
const char *data() const | return the underlying buffer.
size_t size() const;
void clear() | Removes all elements from the buffer (which are destroyed), leaving the container with a size of 0.
 A reallocation is not guaranteed to happen, and the vector capacity is not guaranteed to change due to calling this function. A typical alternative that forces a reallocation is to use swap:
 vector<char>().swap(x);
bool empty() const | Return true if this buffer is empty and false otherwise.
void swap(std::vector<char>& otherVector) | Swap two MemBuffers.
 @param otherVector buffer to swap with.
void swap(MemBuffer& other) | Swap two MemBuffers.
 @param other buffer to swap with.

MemBuffer's underlying implementation is an std vector of chars and therefore it is essential to understand the implications of that implementation.

Extending a buffer is an operation that requires allocating more memory, and therefore it is preferable to reduce the number of extending operations as much as possible.
For example, instead of the following code:
```
    MemBuffer buffer;
    buffer.appendValue('a', 5);
    buffer.appendValue('b', 5);
    buffer.appendValue('c', 5);
```
It is preferable to do the following:
```
    MemBuffer buffer;
    buffer.reserveMore(15);
    buffer.appendValue('a', 5);
    buffer.appendValue('b', 5);
    buffer.appendValue('c', 5);
```

* Cursor
A cursor is used to ease the handling of parsing byte buffers.
It is used to parse and read some bytes from a buffer while parsing them to a desirable type.
Simple usage:
```
    Cursor c(buffer, len);
    size_t mapperSize;
    c.readInto(&mapperSize, sizeof(size_t))
```

### Blockchain: the consensus

The consensus is a criteria for decision if learned model should be combined with another one, which is received via network from another agent. The consesnus algorithm is based on two numbers which are paremeters in configuration file. The parameters are:

Option | type  | Description
------ | ----  | -----------
pConsensus        |  size_t      | The number of records inside a block needed to accept a record.
completeBlockSize |  size_t      | The size needed for a block to consider as a complete block.

The parameters are passed to JumpTracer class utilities and they are used to combine agent model whith model received via network from another agent (JumpTracerUtilities::combine function).
The condition is implemented as follows:

```
if(count[row.first][column.first] >= _pConsensus
  ||
   set->size() < _consensusSize) { ... combine information ... }
```

### Further information

For more information look directly into the source code.


text:
# (osvb) OpenStack Server Volume Backup Description

This document provides a short description on how osvolbackup backups are stored.

# Backup Format
osvb uses the OpenStack cinder volume backup service, it does not use it exclusively, which means you can have both osvb and non-osvb backups in the same backup service.

## Backup Name

osvb_{instance_uuid}

`osvb_` to differentiate it from other backups and `instance_uuid` to associate backups with server, supporting duplicated server names

## Backup Description

The backup description is used as a container for the metadata that can be used to identify/filter the backups that need to be restore, it contains a JSON string with the following fields:

```json
"backup_time" : The backup start time
"vol_index" : Position in the instance attached volumes list
```
An unique (single or multi-volume) backup, is identified by backup name and backup_time keys.

### Volumes Metadata

Before backing up the volume, osvb will add to it the following properties to the first volume of the instance (JSON strings):
```json
"osvb_version": osb scheme version number, for metadata versioning
"osvb_name": instance name,
"osvb_flavor": instance flavor,
"osvb_network": network names and ip addresses,
"osvb_project": the project name
```

repository: CCSGroupInternational/osvolbackup

repo_name: CCSGroupInternational/osvolbackup


text:
tor-info
========

The files needed to extend RPi-Monitor and show a Tor relay's bandwidth information.

## Introduction ##

[RPi-Monitor](http://rpi-experiences.blogspot.com.br/p/rpi-monitor.html) is a nice monitoring tool for your Raspberry Pi. It provides a web view where you can watch things such as memory, CPU and temperature. If your RPi is running a Tor relay then you can easily extend RPi-Monitor to show how much bandwidth the relay is consumig, the observed bandwidth, the relay's address and so on.

![Stats](https://raw.githubusercontent.com/lzkill/tor-bw/master/stats.jpg)

## License ##

These files may be used under the terms of the MIT License, wich a [copy](LICENSE) is included in the download.

## Dependencies ##

- [Python](https://www.python.org) 2.6 or greater
- [Stem](https://stem.torproject.org) 1.2.2 or greater
- [Supervisor](http://supervisord.org)

## Configuration ##

- Copy [tor.conf](tor.conf) to `/etc/rpimonitor/template/`
- Add the following line to `/etc/rpimonitor/data.conf`
```
include=/etc/rpimonitor/template/tor.conf
```
- Copy [tor.png](tor.png) to `/usr/share/rpimonitor/web/img`
- Copy [tor-bw.conf](tor-bw.conf) and [tor-desc.conf](tor-desc.conf) to `/etc/supervisor/conf.d/`
- Run `sudo groupadd supervisor;sudo usermod -a -G supervisor pi`
- Modify `/etc/supervisor/supervisord.conf` with the following:
```
[unix_http_server]
file=/var/run/supervisor.sock
chmod=0770
chown=root:supervisor
```
- Run `sudo mkdir /usr/local/sbin/rpimonitor/`
- Copy [tor-bw.py](tor-bw.py) and [tor-desc.py](tor-desc.py)to `/usr/local/sbin/rpimonitor`
- Set your connection parameters on [tor-bw.py](tor-bw.py) (`TOR_CONTROL_PORT`, `TOR_ADDRESS` and `TOR_CONTROLLER_PASSWD`)
- Set your relay's fingerprint on [tor-desc.py](tor-desc.py) (`FINGERPRINT`)
- Logout/login and run `sudo service supervisor restart;sudo service rpimonitor restart`

The traffic graph shows the values of `RelayBandwidthRate` and `RelayBandwidthBurst` if these parameters are set in `torrc`.

## Your Improvements ##

If you add improvements to these files please send them to me as pull requests on GitHub. I will add them to the next release so that everyone can enjoy your work. You might also benefit from it as others may fix bugs in your files or may continue to enhance them.

## Thanks ##

With regards from

[Luiz<EMAIL_ADDRESS>

repository: XavierBerger/tor-info

repo_name: XavierBerger/tor-info


text:
---
layout: post
title: Scala - Future
author: gassa
comments: true
category: Scala
tags: [programming]
---

_Updated @ May, 8th 2018_

This article was writen in 2013, it briefly documents what I have learned about Scala Future.

By the definition, The `Future[T]` type (future type ) is a ***container*** type that presents a block of asynchronous computations resulting in a value of type T (future value).

### Futures as Containers
Common exampls of operations represented by Future can be
- An remote procedure call to a remote service
- Time-consuming computations
- I/O operations

```scala
traits Future[T]
def apply[T](b: =>T)(implicit ex: ExecutionContext): Future[T]
```

- The `Future[T]` is defined as a scala trait, similar to Java interface.
- The computation is started by calling the `apply` method on the `Future` companion object.

The `apply` method takes a ***by-name*** parameter of the type [T]. Developers can start a computation with an anonymous function, e.g., `val f = Future { "Hello World" }`. While the `apply` mehtod also takes an implicit ExecutionContext parameter, analogous to the Java's `Executor`, It abstracts over where and when threads executed.

### Execution Context

The `scala.concurrent` package defines the `ExecutionContext` as a scala trait with a companion object. The companion object implements an execute(Runnable) method and a reportFailure(Throwable) method:

+ ***executor(Runnable)*** is similar to the execute() function of the Java Executor, which takes a runnable object as a parameter and schedules the runnable with its context.
+ ***reportFailure(Throwable)*** takes a `Throwable` object, it is called whenever some task throws an exception.

In Scala, the `ExecutionContext` companion object contains an default execution context named ***global***, which internally uses a `ForkJoinPool` . In practice, the creation of `ExecutionContext` is normally  transparent to developers since application framework or the management component of the execution environment will supply it. For example, developers can import the default global execution context in the `scala.concurrent` package.

For learning purpose, The following code <sup>[1](#footnote1)</sup> shows how to fork an execution context with two thread worker and create a new execution context by calling the `fromExecutorService` method.

```scala
object ExecutionContextCreate extends App {
  val pool = new forkjoin.ForkJoinPool(2)
  val ctx = ExecutionContext.fromExecutorService(pool)
  etc.execute(new Runnable {
  	def run() = println("Running on the execution context")
  })
  Thread.sleep(5000)
}
/* A more concise version */
def execute(body: =>Unit) = ExecutionContext.global.execute(
  new Runnable { def run() = body }
)
```

### Future Callbacks

Future is non-blocking, it provides a set of callbacks to receive its result in the `Future` companion object. After a callback is installed to a future computation, it gurantee to be invoked eventually, as the following code shows.

```scala
import scala.concurrent.ExecutionContext.Implicits.global

object FutureExample1 extends App {
  override def main(args: Array[String]): Unit = {
    val f = Future {
      TimeUnit.SECONDS.sleep(5)
      println("Hello Future")
    }
    println("Hello World")

    f.onComplete { case _ => println }
    println("Future.onComplete is non-blocking!")
    Thread.sleep(10000)
  }
}
```

[1](http://www.packtpub.com/application-development/learning-concurrent-programming-scala-second-edition)