text:
---
layout: post
title: My MBA journey @ Quantic School of Business
---

On March 4, 2020 I officially obtained my MBA degree from [Quantic School of Business](https://quantic.mba/). I started
the program in February 2019. Earlier known as Smartly, the Quantic School of Business offers
both a full-time as well as an executive **online** MBA program, and I was enrolled in the former.
It is about time that education of all kinds, including MBA is available and legitimized online.
Besides my formal education under brick-and-mortar universities, I have been educating myself through
online platforms such as [Coursera](https://www.coursera.org/), [Udacity](https://www.udacity.com/),
[EdX](https://www.edx.org/), etc. And Quantic is another such platform that I am glad to
have found and used for educating myself.

## About the institution

These MBA programs under Quantic School of Business are offered by an educational technology
company [Pedago](https://pedago.com/) which was setup in 2013. The full-time MBA program is free as of now (March 2020).
I was reached out by their team perhaps because I am an [EPFL](https://www.epfl.ch/en/) alumnus and they are looking to
strengthen their brand by having individuals with such prestigious university degrees as part of their cohorts.

I went on with the proposal. There were 3 rounds of interviews mostly to assess why I want
to do an MBA and am I capable enough to be selected. Of course I cleared all the interviews, and the program
started late March. Fortunately, towards the end of the program, right before I graduated, Quantic
received [accreditation](https://quantic.mba/accreditation) from
[DEAC, USA](https://www.deac.org/UploadedDocuments/Public-Notices/Accreditation-Actions/022420_AC_meeting_report.pdf).

## About the program

The MBA program that was roughly a year long had 10 modules

 ![]({{ site.baseurl }}/data/2020-03-22-My-MBA-journey-at-Quantic/curriculum.png)

 Each module had roughly 7-8 lessons, making a total of 60 lessons. Each lesson in turn was divided
 into chapters which were then split into several web-pages. Below is one such web-page.

  ![]({{ site.baseurl }}/data/2020-03-22-My-MBA-journey-at-Quantic/chapter.png)

 There were 2 exams - the mid-term and the final exam. Both were open book and had bunch of objective type questions covering the
 various modules. There were 4 projects dedicated to some of the modules spread at roughly equal intervals
 during the program. The projects were supposed to be worked in groups (or individually) and the deliverables
 were usually a (video) presentation and/or project reports.

 Students were connected via slack channels which proved effective especially w.r.t communications from
 the institute. Every week, students were required to finish a couple of lessons, although one could also
 postpone and finish pending lessons all at once, later. There were exercises as well each week, where we were
 given a question or topic-for-discussion (that was related to what was taught that week) over slack channel
 and students would then write their opinions or answers on it. These exercises were not marked and hence
 did not have much participation to be honest, although they seemed to be a good tool to test and apply one's
 understanding of learned concepts in real life.

 Lastly, the program which practically was just a web dashboard, came with other helpful resources besides the regular
 coursework, such as free access to [Statista](https://www.statista.com/) and the
 [Quantic library](https://quantic.mba/library) which contained relevant and valuable external resources, all for free.

## About the journey

Doing a full-time MBA in one of those prestigious universities is both expensive and time-consuming. Also,
its damn difficult to get an admit to begin with. I didn't see the opportunity costs on this route being outweighed by
the benefits of getting such degree. However, I still wanted to gain some formal knowledge around running businesses.
This is why I chose to spend a sizeable chunk of my time on this 1-year program. Here are my few thoughts on how it went:

 - Although an online program, it still needs long-term dedication in order to complete coursework in time,
 deliver on those projects and most importantly pass the exams.
 - The content of this program is really great, and the way it is designed, it really helps you to
 retain the concepts or atleast develop a mind-map of where to look for in their resources.
 - Alongside a full-time job it can sometimes get tough to keep going but if you have read the important
 deadlines well, you can plan for the best and the worst.
 - Each MBA cohort is truly international, and hence it gives an opportunity to connect with people from
 all walks of life and all latitudes and longitudes.
 - The program is currently free as they are building the brand, however, I speculate that this offer might not
 last long and hence, interested ones should apply as soon as possible.
 - Now that the program is accredited, it assures the legitimacy and lets you mention the degree professionally.
 I am a data-science / machine-learning guy, hence this doesn't directly give dividends for me, but I was here for the
 knowledge anyways. In the long run, I believe what I have learned here will help in indirect ways.
 - My final advice would be : Don't do this program if you are basing your future on your MBA degree, but totally
 do this program if you are a working professional and still want to learn about business administration for advancement
 in your career.

## Acknowledgements

I am really thankful to [Quantic School of Business](https://quantic.mba/) for the amazing program and the MBA degree.

Thank you for reading this post. Hope it was insightful.

#### P.S. My Degree

![]({{ site.baseurl }}/data/2020-03-22-My-MBA-journey-at-Quantic/degree.jpeg)

gha_language: SCSS


text:
# File Line Reader

Asynchronous line-by-line file reader.

## Install

`npm install file-line-reader`

## Usage

Use the constructor to create a LineReader object. Then use the function `nextLine` to receive the next line. The
library will only load as many content of the file as necessary allowing to read very large files.

    var LineReader = require('file-line-reader');

    var reader = new LineReader('longfile.txt');

    // Reads the file line of the longfile.txt file
    reader.nextLine(function (err, line) {
        if (err) {
            // file not found, no read rights, ..
        }

        console.log(line);
    });

## Advanced Example

In this example we read the license file line by line with a 100ms delay between each log call.

    var LineReader = require('file-line-reader');

    var reader = new LineReader('LICENSE.txt');

    function slowReader() {
        setTimeout(function() {
            reader.nextLine(function (err, line) {
                if (line !== null) {
                    console.log(line);
                    slowReader();
                }
            });
        }, 100);
    }

    slowReader();

## License

MIT License.

license: MIT

repository: thomasdondorf/file-line-reader

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: thomasdondorf/file-line-reader


text:
# ActionExecutor

The action executor is capable of coordinating the execution of multiple
asynchronous actions. In situations where you do latency compensation you have a
high risk of race conditions. To avoid the race conditions you can use locking
to serialize execution of actions that touches shared state a cross actions. You
decide the granularity of the locking, the action executor provides you with a
way to signal that an action can't be started because it can get the proper
locks.

In addition to handling coordination, the action executor also supply retrying
with exponential backoff and action life cycle hooks.

## Installation

### Node

Install it with NPM or add it to your `package.json`:

```
$ npm install action-executor
```

Then:

```js
var ActionExecutor = require('action-executor');
```

### Browser

Include `ActionNotReadyError` and `ActionExecutor.js`.

```html
<script src="ActionNotReadyError.js"></script>
<script src="ActionExecutor.js"></script>
```

this will expose the `ActionExecutor` constructor under the following namespace:

```js
var ActionExecutor = com.one.ActionExecutor;
```

### RequireJS

Include the library with RequireJS the following way:

```js
require.config({
    paths: {
        ActionExecutor: 'path/to/action-executor/lib/ActionExecutor.js'
    }
});

define(['ActionExecutor'], function (ActionExecutor) {
   // Your code
});
```

## Proposed architecture

You are of course free to build the architecture you like on top of the action
executor, but the architecture we use and recommend is unidirectional and
therefore makes the application easier to understand. The following diagram
shows the flow through the application.

        .--------state change triggers view update------.
        |                                               |
        v    ___________              __________        |
    .------. \          \  .--------. \         \   .-------.
    | View |  ) executes ) | Action |  ) Updates )  | State |
    '------' /__________/  '--------' /_________/   '-------'
                                |
                              Calls
                                |
                                v
                           .---------.
                           | Backend |
                           '---------'

## Example

The application of the action executor is best explained by an example.

Let's start by creating a new action executor:

```js
var actionExecutor = new ActionExecutor({
    context: {
       backend: backend,
       state: state
    }
});
```

The given context is supplied to the action when it is being executed. In this
case the actions will be able to talk to the backend and update the application
state that in turn will be reflected back to the views.

Let's say we have an application state that contains a list of persons that we
want to update. We can make a new action for that:

```js
function RefreshPersonListAction() {}
RefreshPersonListAction.prototype.name = 'RefreshPersonListAction';
RefreshPersonListAction.prototype.execute(function (context, cb) {
    var persons = context.state.persons;
    var backend = context.backend;

    backend.loadPersonList(function (err, data) {
        if (!err) {
            persons.all = data.persons;
            persons.emit('updated');
        }
        cb(err);
    });
});
```

This action can be queue for execution by the action executor the following way.

```js
actionExecutor.enqueue(new RefreshPersonListAction());
```

You can supply a callback as the second parameter if you need a callback when
the action in done:

```js
actionExecutor.enqueue(new RefreshPersonListAction(), function (err, data) {
    // The action has been executed and succeed or failed.
});
```

### Locking

If we want to introduce another action that will be able to delete a given
person, but we don't want to wait for the server to respond before updating the
person list, then we have a coordination problem. To solve this problem we
introduce a lock on the persons list. We need to handle locking in all actions
that updates the person list. If the action can't get the lock, should yield an
`ActionNotReadyError`, this will make the action wait in the queue till another
action has finished, then it will be retried. For this to work, one very
important invariant has to be in place - *an action that take a lock must always
release it again when it succeeded or failed* - otherwise actions will get stuck
in the queue.

Let's start with the `RefreshPersonListAction`:

```js
function RefreshPersonListAction() {}
RefreshPersonListAction.prototype.name = 'RefreshPersonListAction';
RefreshPersonListAction.prototype.execute(function (context, cb) {
    var persons = context.state.persons;
    var backend = context.backend;

    if (persons.locked) {
        return cb(new ActionNotReadyError());
    }

    persons.locked = true;
    backend.loadPersonList(function (err, data) {
        persons.locked = false;
        if (!err) {
            persons.all = data.persons;
            persons.emit('updated');
        }
        cb(err);
    });
});
```

Now we introduce the `DeletePersonAction`:

```js
function DeletePersonAction(options) {
    this.person = options.person;
}
DeletePersonAction.prototype.name = 'DeletePersonAction';
DeletePersonAction.prototype.execute(function (context, cb) {
    var state = context.state;
    var backend = context.backend;
    var persons = state.persons;
    var person = this.person;

    if (persons.locked) {
       return cb(new ActionNotReadyError());
    }

    persons.locked = true;

    var index = persons.indexOf(person);
    if (index === -1) {
        return cb();
    }

    persons.all.splice(index, 1);
    persons.emit('updated');
    backend.deletePerson(person.id, function (err, data) {
        state.persons.locked = false;
        cb(err);
    });
});
```

If we enqueue both a `RefreshPersonListAction` and a `DeletePersonAction` at the
same time. The execution will be serialized on the person list. That means the
`DeletePersonAction` will wait for the `RefreshPersonListAction` to finish.

### Retrying

As the `RefreshPersonListAction` just uses HTTP GET it should be idempotent and
can therefore be retried. We can configure the action executor to retry on HTTP
503 errors the following way:

```js
actionExecutor.shouldRetryOnError = function (err) {
   return err.status === 503;
};
```

Then to enable 3 retries for the `RefreshPersonListAction` you do the following:

```js
RefreshPersonListAction.prototype.retries = 3;
```

### Intercepting actions

In some cases you want to intercept execution of actions. It could be for
logging or because you wanted to tag error instances for error routing.

Here is an example where we are tagging the errors yielded by the action with
the action name using [Failboat](https://github.com/One-com/failboat):

```js
actionExecutor.interceptor = function (action, args, next) {
    var err = args[0];
    if (err) {
        Failboat.tag(err, action.name);
    }
    next();
};
```

Notice: that the interceptor runs after the action has been executed and
receives the arguments yielded to the callback by the action.

`interceptor` can also be specified in the constructor.

### Action status change events

Let's say we wanted to log the status of the actions being executed. We can do
that by overriding the `onStatusChange` method on the action executor:

```js
actionExecutor.onStatusChange = function (task, status, err) {
    var errorMessage = err && err.message && ', error: ' + err.message;
    console.log(task.action.name + ' ' + status + errorMessage || ''));
};
```

You will get something like the following log output:

```
DeletePersonAction running
RefreshFoldersAction running
RefreshFoldersAction not ready
DeletePersonAction done
RefreshFoldersAction running
RefreshFoldersAction queued for retrying, error: 503 service unavailable
RefreshFoldersAction retrying
RefreshFoldersAction running
RefreshFoldersAction done
```

`onStatusChange` can also be specified in the constructor.

### Empty action queue event

In some situations it makes sense to do some stuff when the action executor is
idle. If you need that you can listen for the empty queue event the following
way:

```js
actionExecutor.onEmptyQueue = function () {
    // do some stuff
}
```

`onEmptyQueue` can also be specified in the constructor.

## License
Copyright © 2014, One.com

ActionExecutor is licensed under the BSD 3-clause license, as given at http://opensource.org/licenses/BSD-3-Clause

repository: One-com/action-executor

gha_language: JavaScript

repo_name: One-com/action-executor


text:
---
layout: post
title: How to use Spring Data Rest
bigimg: /img/image-header/yourself.jpg
tags: [Java]
---

## Table of contents
- [Introduction to Spring Data Rest](#introduction-to-spring-data-rest)
- [How to use Spring Data Rest](#how-to-use-spring-data-rest)
- [Some problems when using Spring Data Rest](#some-problems-when-using-spring-data-rest)
- [Wrapping up](#wrapping-up)

## Introduction to Spring Data Rest

## How to use Spring Data Rest

## Some problems when using Spring Data Rest

1. Reasons that Spring Webflux does not support Spring Data Rest

    There are no immediate plans to build a Spring Data REST based on Spring WebFlux. Here are a couple of reasons for that:

    - The support would imply a complete rewrite which would bind a significant amount of time we have as a team. We're making very heavy use of Jackson customizations and it's not clear whether all of them can be used in a non-blocking way in the first place.

    - Spring Data REST is used by slightly less than ten percent of all Spring Data users.

    - A crucial aspect of Spring Data REST is that it's supposed to work on all repository modules. However, only the MongoDB, Couchbase, Redis and Cassandra modules currently support true reactive data access. I.e. for everyone using Spring Data JPA (a huge majority of Spring Data users) the effect would be close to zero as JPA is a blocking API.

    - The kinds of APIs (true hypermedia-based REST APIs build on a domain model backed by a datastore) build on top of Spring Data REST are usually not the first candidates to benefit from reactive programming in the first place as the latter is optimizing for resource usage in pass-through scenarios (gateway style applications etc.)

    With all these constraints given, it's currently very unlikely that a WebFlux based Spring Data REST would actually have the effect that people assume it would have. That, combined with the rather huge amount of work such an implementation would imply, we decided to currently not pursue this road.

## Wrapping up

Thanks for your reading.

Refer:

[https://jira.spring.io/browse/DATAREST-933](https://jira.spring.io/browse/DATAREST-933)


text:
---
template: BlogPost
path: /namibia
date: 2020-11-23T07:08:53.137Z
title: Namibia
thumbnail: 'https://lh3.googleusercontent.com/proxy/pNL5ngQDOvvcdwT-xDbSNOtDzl-FUYOr2hgiFOc19kqGnea7loWvfn-X_0trnbvOm7Af4W7n3LuaVn-24vIk-04cY0IhnFpAVKwoeBF0ftLaBr7L90Y'
metaDescription: Country Page Post
---

# General Information about Namibia

- Name: Namibia
- African Abbreviation: NM
- Capital City: Windhoek
- Population: 2,540,905
- African Subregion: Southern Africa

### Country Flag
![Country Flag](https://raw.githubusercontent.com/hjnilsson/country-flags/master/png1000px/na.png)

## Economic Information
 - GDP (thousands): 12,366,527.72
 - GDP Growth (annual %) in 2019: -1.1
 - GDP Per Capita: 4957.5

## A Brief Overview of Namibia

Namibia is a sparsely populated country. German is a widely spoken language today and the culture and cuisine of the country have German influences. There are many different cultures spread throughout the country.

#### References:
- [Capital Image](https://lh3.googleusercontent.com/proxy/pNL5ngQDOvvcdwT-xDbSNOtDzl-FUYOr2hgiFOc19kqGnea7loWvfn-X_0trnbvOm7Af4W7n3LuaVn-24vIk-04cY0IhnFpAVKwoeBF0ftLaBr7L90Y)
- [Flags](https://github.com/hjnilsson/country-flags)
- [Abbreviation](https://planetarynames.wr.usgs.gov/Abbreviations)
- [Capital Cities](https://www.nationsonline.org/oneworld/capitals_africa.htm)
- [Population](https://www.worldometers.info/population/countries-in-africa-by-population/)
- [Economic Information](https://data.worldbank.org/)
- [Writeup Information](https://www.rhinoafrica.com/en/destinations/namibia/facts-and-information/culture/77461)

gha_license_id: MIT


text:
# node-hubspot-api
![Node.js CI](https://github.com/hmschreiner/node-hubspot-api/workflows/Node.js%20CI/badge.svg)

A wrapper for the HubSpot API based on Node - http://developers.hubspot.com/docs/overview

## Installation

  `npm install node-hubspot-api --save`

## Tests

  `npm run test`

## Get Started
```javascript
import NodeHubSpotApi from 'node-hubspot-api'

const api = new NodeHubSpotApi('your_api_key')
```

## Available Resources

### Contacts

#### - Get all contacts
Return all contacts that have been created. A paginated list of contacts will be returned with a maximum of 100 contacts per page.

| Parameter | Description | Required | Default |
| --------- | ----------- | :------: | :-----: |
| **count** | Specify the amount of contacts to return. | No | 20 |
| **vidOffset** | Used to page through the contacts. | No | - |
| **property** | By default, only a few standard properties will be included in the response data. Include the 'property' parameter to get the specified property in the response. | No | - |
| **showListMemberships** | Indicate whether current list memberships should be fetched for the contact. | No | false |

**Usage:**
```javascript
api.contacts.getAll({
  count: 20,
  vidOffset: null,
  property: [
    'fistname', 'lastname', 'email',
  ],
  showListMemberships: false,
})
.then(response => console.log(response.data.contacts))
.catch(error => console.error(error))
```

**Reference:** http://developers.hubspot.com/docs/methods/contacts/get_contacts

#### - Get a contact by ID
Returns information about a single contact by its ID. The contact's unique ID is stored in a field called 'vid' which stands for 'visitor ID'.

| Parameter | Description | Required | Default |
| --------- | ----------- | :------: | :-----: |
| **property** | By default, you will get all properties that the contact has values for. If you include the "property" parameter, then the returned data will only include the property or properties that you request. You can include this parameter multiple times to specify multiple properties. The lastmodifieddate and associatedcompanyid will always be included, even if not specified. Keep in mind that only properties that have a value will be included in the response, even if specified in the URL. | No | - |
| **propertyMode** | One of “value_only” or “value_and_history” to specify if the current value for a property should be fetched, or the value and all the historical values for that property.  | No | value_and_history |
| **formSubmissionMode** | One of “all”, “none”, “newest”, “oldest” to specify which form submissions should be fetched. | No | all |
| **showListMemberships** | Indicate whether current list memberships should be fetched for the contact. | No | false |

**Usage:**
```javascript
api.contacts.getContactById(123456, {
  property: [
    'firstname', 'lastname', 'email',
  ],
  propertyMode: 'value_and_history',
  formSubmissionMode: 'all',
  showListMemberships: false,
})
.then(response => console.log(response.data))
.catch(error => console.error(error))
```

**Reference:** https://developers.hubspot.com/docs/methods/contacts/get_contact

#### - Get a contact by email address
Returns information about a single contact by its email address.

**Usage:**
```javascript
<EMAIL_ADDRESS>{
  property: [
    'firstname', 'lastname', 'email',
  ],
  propertyMode: 'value_and_history',
  formSubmissionMode: 'all',
  showListMemberships: false,
})
.then(response => console.log(response.data))
.catch(error => console.error(error))
```

**Reference:** https://developers.hubspot.com/docs/methods/contacts/get_contact_by_email

#### - Create a new contact
Create a new contact in HubSpot. Returns a 200 response on success. The response will include the details for the created contact.

If there is an existing contact with the email address included in the request, the response body will include the identityProfile details of the contact, which will include the vid of the existing record.

**Usage:**
```javascript
api.contacts.createContact({
  email<EMAIL_ADDRESS>  firstname: 'James',
  lastname: 'Bond',
  website: 'http://www.mycompany.com',
  company: 'My Company',
  ...
})
.then(response => console.log(response.data.properties))
.catch(error => console.error(error))
```

**Reference:**
https://developers.hubspot.com/docs/methods/contacts/create_contact

#### - Update a contact by ID
Update an existing contact in HubSpot. This method lets you update the properties of a contact in HubSpot. You must pass the Contact's ID that you're updating as second parameter.

If the request succeeds, you'll get an HTTP 204 response, which represents that you have successfully updated the contact in the system. There will be no data in the response body.

**Usage:**
```javascript
api.contacts.updateContactById({
  email<EMAIL_ADDRESS>  firstname: 'Jon',
  lastname: 'Doe',
  website: 'http://www.my-new-company.com',
  company: 'My Company 2',
  ...
}, 123456)
.then(response => console.log(response.status))
.catch(error => console.error(error))
```

**Reference:**
https://developers.hubspot.com/docs/methods/contacts/update_contact

#### - Update a contact by email
Update an existing contact in HubSpot, identified by email. This method lets you update the properties of a contact in HubSpot. You must pass the Contact's email that you're updating as second parameter.

If the request succeeds, you'll get an HTTP 204 response, which represents that you have successfully updated the contact in the system. There will be no data in the response body.

**Usage:**
```javascript
api.contacts.updateContactByEmail({
  firstname: 'Jon',
  lastname: 'Doe',
  website: 'http://www.my-new-company.com',
  company: 'My Company 2',
  ...
}<EMAIL_ADDRESS>.then(response => console.log(response.status))
.catch(error => console.error(error))
```

**Reference:**
https://developers.hubspot.com/docs/methods/contacts/update_contact-by-email

#### - Create or update a contact
Create a contact if it doesn't exist already, or update it with the latest property values if it does.

This returns a 200 response on success. The response will contain a vid of the updated or created record, and an isNew field that indicates if a new record was created. If the field is false, an existing record was updated.

This will return a 409 Conflict error response if you are trying to update the email address of a record, and there is an existing record with the new email address.

**Usage:**
```javascript
api.contacts.createOrUpdateContact({
  firstname: 'Jon',
  lastname: 'Doe',
  website: 'http://www.my-new-company.com',
  company: 'My Company 2',
  ...
}<EMAIL_ADDRESS>.then(response => console.log(response.status))
.catch(error => console.error(error))
```

**Reference:**
https://developers.hubspot.com/docs/methods/contacts/create_or_update

### Blog

#### - Get all blogs
List all of the blogs for a portal. Supports paging and filtering.

| Parameter | Description | Required | Default |
| --------- | ----------- | :------: | :-----: |
| **limit** | The number of items to return. | No | 20 |
| **offset** | The offset set to start returning rows from. | No | 0
| **created** | exact, range, gt, gte, lt, lte - When the post was first created, in milliseconds since the epoch. | No | - |
| **deleted_at** | exact, gt, gte - When the post was deleted, in milliseconds since the epoch. Zero if the blog post was never deleted. | No | - |
| **name** | exact, in - The internal name of the blog | No | - |

**Usage:**
```javascript
api.blog.getAllBlogs({
  limit: 20,
  offset: 0,
  created: null,
  deleted_at: null,
  name: null,
})
.then(response => console.log(response.data.objects))
.catch(error => console.error(error))
```

**Reference:** http://developers.hubspot.com/docs/methods/blogv2/get_blogs

#### - List blog posts
Get the posts from your blogs.

| Parameter | Description | Required | Default |
| --------- | ----------- | :------: | :-----: |
| **limit** | The number of items to return. | No | 20 |
| **offset** | The offset set to start returning rows from. | No | 0 |
| **archived** | Returns the posts that match the boolean lookup (e.g. archived=false returns all posts currently not archived). | No | false |
| **blog_author_id** | Returns the posts that match a particular blog author ID value. | No | - |
| **campaign** | Returns the posts that match the campaign guid. | No | - |
| **content_group_id** | Returns the posts that match the blog guid. The blog guid can be found in the blog dashboard URL (e.g. https://app.hubspot.com/blog/:portal_id/dashboard/:blog_guid). | No | - |
| **created** | Returns the posts that match a particular created time value. Supports exact, range, gt, gte, lt, lte lookups. | No | - |
| **deleted_at** | Returns the posts that match a particular deleted time value. Supports exact, gt, gte, lt, lte lookups. | No | - |
| **name** | Returns the posts that match the name value. Supports exact, contains, icontains, ne lookups. | No | - |
| **slug** | Returns the posts that match a particular slug value. | No | -
| **updated** | Returns the posts that match a particular updated time. Supports exact, range, gt, gte, lt, lte lookups. | No | - |
| **state** | DRAFT, PUBLISHED, or SCHEDULED. | No | PUBLISHED |
| **order_by** | Return the posts ordered by a particular field value. Blog posts can currently only be sorted by publish_date. Use a negative value to sort in descending order (e.g. order_by=-publish_date). | No | publish_date |

**Usage:**
```javascript
api.blog.getPosts({
  limit: 20,
  offset: 0,
  archived: false,
  blog_author_id: null,
  campaign: null,
  content_group_id: null,
  created: null,
  deleted_at: null,
  name: null,
  updated: null,
  state: 'PUBLISHED',
  order_by: 'publish_date',
})
.then(response => console.log(response.data.objects))
.catch(error => console.error(error))
```

**Reference:** http://developers.hubspot.com/docs/methods/blogv2/get_blog_posts

#### - Get the blog post by ID
Get a specific blog post by ID.

**Usage:**
```javascript
api.blog.getPostById(3198892953)
.then(response => console.log(response.data))
.catch(error => console.error(error))
```

**Reference:**
http://developers.hubspot.com/docs/methods/blogv2/get_blog_posts_blog_post_id

### Deals

#### - Get all deals
Get all of the deals in a portal.  Returns a paginated set of deals.

In addition to the list of deals, each request will also return two values, *offset* and *hasMore*. If *hasMore* is *true*, you'll need to make another request, using the offset to get the next page of deal records.

| Parameter | Description |
| --------- | ----------- |
| **limit** | The number of records to return. Defaults to 100, has a maximum value of 250. |
| **offset** | Used to page through the results. If there are more records in your portal than the limit= parameter, you will need to use the offset returned in the first request to get the next set of results. |
| **properties** | Used to include specific deal properties in the results.  By default, the results will only include Deal ID and will not include the values for any properties for your Deals.  Including this parameter will include the data for the specified property in the results.  You can include this parameter multiple times to request multiple properties. Note: Deals that do not have a value set for a property will not include that property, even when you specify the property. A deal without a value for the dealname property would not show the dealname property in the results, even with &properties=dealname in the URL. |
| **propertiesWithHistory** | Works similarly to properties=, but this parameter will include the history for the specified property, instead of just including the current value. Use this parameter when you need the full history of changes to a property's value. |
| **includeAssociations** | If it's set to *true*, it will include the IDs of the associated contacts and companies in the results. This will also automatically include the *num_associated_contacts* property. |

**Usage:**
```javascript
api.deals.getAllDeals({
 limit: 100,
 offset: null,
 properties: [
   'hubspot_owner_id',
 ],
 propertiesWithHistory: 'dealname',
 includeAssociations: false,
})
.then(response => console.log(response.data.deals))
.catch(error => console.error(error))
```

**Reference:**
https://developers.hubspot.com/docs/methods/deals/get-all-deals

#### - Get associated deals
Get all of the deals associated to a contact in a portal.  Returns a paginated set of deals.

In addition to the list of deals, each request will also return two values, *offset* and *hasMore*. If *hasMore* is *true*, you'll need to make another request, using the offset to get the next page of deal records.

Returns deals associated with a single contact by its ID. The contact's unique ID is stored in a field called 'vid' which stands for 'visitor ID'.

| Parameter | Description |
| --------- | ----------- |
| **limit** | The number of records to return. Defaults to 100, has a maximum value of 250. |
| **offset** | Used to page through the results. If there are more records in your portal than the limit= parameter, you will need to use the offset returned in the first request to get the next set of results. |
| **properties** | Used to include specific deal properties in the results.  By default, the results will only include Deal ID and will not include the values for any properties for your Deals.  Including this parameter will include the data for the specified property in the results.  You can include this parameter multiple times to request multiple properties. Note: Deals that do not have a value set for a property will not include that property, even when you specify the property. A deal without a value for the dealname property would not show the dealname property in the results, even with &properties=dealname in the URL. |
| **propertiesWithHistory** | Works similarly to properties=, but this parameter will include the history for the specified property, instead of just including the current value. Use this parameter when you need the full history of changes to a property's value. |
| **includeAssociations** | If it's set to *true*, it will include the IDs of the associated contacts and companies in the results. This will also automatically include the *num_associated_contacts* property. |

**Usage:**
```javascript
api.deals.getAssociatedDeals(123456,{
 limit: 100,
 offset: null,
 properties: [
   'hubspot_owner_id',
   'amount',
 ],
 includeAssociations: true,
})
.then(response => console.log(response.data.deals))
.catch(error => console.error(error))
```

**Reference:**
https://developers.hubspot.com/docs/methods/deals/get-associated-deals

#### - Create a deal
This methods creates a deal on HubSpot. You can create associations between Deals and Contacts and Companies but it's not required.

The **dealstage** property is required when creating a deal. If the **pipeline** property is not specified, the default pipeline is assumed. However, it is recommended to always specify the pipeline, especially on portals with multiple pipelines.

Returns a 200 on success with the data for the newly created deal in the response.

You must pass an object to the method with these parameters:

| Parameter | Description |
| --------- | ----------- |
| Associated records | `"associations": {}` - A set of IDs for records that the new deal should be associated with. Deals can be associated with a single company (associatedCompanyIds) and any number of contacts (associatedVids). |
| Deal properties | `"properties": []` - A list of property names, and the value you want to set for the property. |

**Usage:**
```javascript
api.deals.createDeal({
  associations: {
    associatedCompanyIds: [
      123456
    ],
    associatedVids: [
      1234, 12345, 123456, ...
    ],
  },
  properties: {
    dealname: 'This is a brand new deal. Awesome!',
    hubspot_owner_id: 123456,
    amount: '50000',
    dealtype: 'newbusiness',
    dealstage: 'appointmentscheduled',
  },
})
.then(response => console.log(response.data))
.catch(error => console.error(error))
```

**Reference:**
https://developers.hubspot.com/docs/methods/deals/create_deal

## Disclaimer
This tool is under development and don't have all HubSpot API endpoints implemented yet.

repository: hmschreiner/node-hubspot-api

repo_name: hmschreiner/node-hubspot-api


text:
# rtb-wrapper - declarative rsync-time-backup [![Build Status](https://travis-ci.org/thomas-mc-work/rtb-wrapper.svg?branch=master)](https://travis-ci.org/thomas-mc-work/rtb-wrapper)

You know and love the well known __[rsync-time-backup](https://github.com/laurent22/rsync-time-backup)__ from
[Laurent Cozic aka laurent22](https://github.com/laurent22)! Now what could be missing since this is a mature
project? The whole thing based on separate profile files per backup case!

__Example:__

Consider this example __profile__ (named `user1-documents.inc`):

    SOURCE="${HOME}/Documents"
    TARGET="/mnt/backup-disk/Documents"
    EXCLUDE_FILE="/home/user1/opt/backup-documents-excludes.lst"

Now it's as easy as this to __backup__ our data:

    rtb-wrapper.sh backup user1-documents

And here is how to __restore__ from the `latest` backup:

    rtb-wrapper.sh restore user1-documents

## Requirements

- [rsync-time-backup](https://github.com/laurent22/rsync-time-backup)
  - rsync

## Setup

    # prepare the profile folder
    mkdir -p "${HOME}/.rsync_tmbackup/conf.d"
    # download the script
    curl -Lo "/usr/local/bin/rtb-wrapper.sh" "https://raw.githubusercontent.com/thomas-mc-work/rtb-wrapper/master/rtb-wrapper.sh"
    # mark the script executable
    chmod +x "/usr/local/bin/rtb-wrapper.sh"

## Configuration

`rtb-wrapper` is using `$HOME/.rsync_tmbackup` as the base config folder, except it's overridden by the environment variable `RTB_CONFIG_DIR`.

### Profile file

`$HOME/.rsync_tmbackup/conf.d/<profile-name>.inc`: The backup profiles, one per file

    # the source folder
    SOURCE="${HOME}/Documents"
    # the target folder
    TARGET="/media/user1/backup-disk/Documents"
    # optional: the exclude file for rsync
    EXCLUDE_FILE="${HOME}/backup-documents-excludes.lst"
    # optional: wipe the source folder before restoring files? (true/false; default: false)
    WIPE_SOURCE_ON_RESTORE=true

### Exclude file

Alternatively you can define the exlcude file also by placing it next to the profile file. Following the convention:

    ${HOME}/.rsync-tmbackup/conf.d/<profile-name>.inc
    ${HOME}/.rsync-tmbackup/conf.d/<profile-name>.excludes.lst

This exclude file definition will be overriden by the definition within the profile.

## Development

### Testing

There are some tests written with [bats](https://github.com/sstephenson/bats) to verify your changes:

```bash
./run-tests.sh
```

gha_language: Java


text:
This is a modified version of, and should adhere to, the [Contributing Guidelines](../../main/.github/CONTRIBUTING.md).

<!--
Hello, thank you for your contribution, please read through this whole file before submitting your Pull Request.

Title your pull request descriptively:

* edit X company
* add new company - COMPANY
* Copy tweaks

Please read and check the boxes in the list below that apply!

If updating or adding a company, please include details about what you are changing.

If you are adding a new entry to the list, your contributio (Pull Request) should include a company profile AND line entry to the readme file.

Check off this list as appropriate (add an x between the []). It will be used by @dougaitken when reviewing your contribution, like this: [x]

DO NOT DELETE ANYTHING IN THIS COMMENT.
-->

* [ ] This PR contains housekeeping only (URL edits, copy changes etc) - **if this is checked, delete other lines that don't apply**
* [ ] You are an employee of the company mentioned and confirm all included details are correct.
* [ ] You know your alphabet - company is listed in alphabetical order in the README.md file.
* [ ] The company directly hires employees. ** No bootcamps / freelance sites / etc**
* [ ] The company hires remote employees, or positions are available to remote workers and are clearly illustrated as such.
* [ ] A [company profile](/company-profiles/example.md) is included - This is __required__ for new additions.
* [ ] An entry has been added or edited within the [readme.md file](../../main/README.md).
* [ ] __Remote status__ has details regarding how the culture includes remote employees, how the company integrated remote workers, etc
* [ ] __Region__ details the geographic regions in which this company employees can reside. For more details see the instructions in the [example company profile](/company-profiles/example.md#region).
* [ ] __How to apply__ details the best approach for new applications, page on site where open position are listed, and any other help available for job hunters

repository: remoteintech/remote-jobs

branch_name: refs/heads/main

repo_name: remoteintech/remote-jobs


text:
## React Router Confirm Navigation
Displays a custom component to confirm or cancel a react-router navigation. Uses react-router's routerWillLeave hook under the hood.

**Note: This project is in active development. Breaking API changes may happen without warning until v1.0.**

### Installation
`npm i react-router-confirm-navigation -S`

or

`yarn add react-router-confirm-navigation`

### Usage
###### RouteComponent.js
Can be placed anywhere inside a component that is used for a `<Route />`. Uses react router's higher order component `withRouter` to pass router props.
```js
import React from 'react';
import ConfirmNavigation from 'react-router-confirm-navigation';
import YourCustomConfirmation from './YourCustomConfirmation';

export default () => {
  return (
    <div>
      <ConfirmNavigation allowBackButton>
        <YourCustomConfirmation
          onConfirmNavigation={(currentLocation) => {
            console.log('navigation allowed to ', currentLocation.pathname);
          }}
          onCancelNavigation={(nextLocation) => {
            console.log('navigation cancelled to ', nextLocation.pathname);
          }}
          allowNavigation={(nextLocation) => {
            // condition for allowing or blocking a navigation
            return false;
          }}
        />
      </ConfirmNavigation>
    </div>
  );
};
```
###### YourCustomConfirmation.js
Call `this.props.confirmNavigation` and `this.props.cancelNavigation` anywhere you like from inside the component.
```js
class YourCustomConfirmation extends React.Component {
  // optionally, you can use class methods or pass in as props as shown above
  // allowNavigation (nextLocation) { return false; }
  // onConfirmNavigation (currentLocation) {}
  // onCancelNavigation (nextLocation) {}
  render () {
    return (
      <div>
        <h4>Warning</h4>
        <p>Are you sure you wish to leave?</p>
        <button onClick={this.props.confirmNavigation}>Yep</button>
        <button onClick={this.props.cancelNavigation}>Nope</button>
      </div>
    );
  }
}
```
#### TODO
1. Test usage with react router v4.x.x
2. Add more tests for improper component usage


text:
# eCupcake App

	This is a basic cart application built using java and firebase

# Features

 	* Register
 	* Login
 	* Add / View Products

# Getting Started

	* Clone Repo
	* Activate firebase database service and set rules as { "rules": { ".read": true, ".write": true } }
        * Then import the below attached JSON files to get some dummy data backup JSON backup file

# Contact if Any Questions
<EMAIL_ADDRESS>

repository: MishalAreef/Android-Basic-Cart

repo_name: MishalAreef/Android-Basic-Cart


text:
# did-jwt
[![npm](https://img.shields.io/npm/dt/did-jwt.svg)](https://www.npmjs.com/package/did-jwt)
[![npm](https://img.shields.io/npm/v/did-jwt.svg)](https://www.npmjs.com/package/did-jwt)
[![Twitter Follow](https://img.shields.io/twitter/follow/uport_me.svg?style=social&label=Follow)](https://twitter.com/uport_me)

[Algorithms supported](docs/guides/index.md#algorithms-supported) | [DID Public Key Types](docs/guides/index.md#did-publickey-types) | [Claim Specification](docs/guides/index.md#claims)

The did-JWT library allows you to sign and verify [JSON Web Tokens (JWT)](https://tools.ietf.org/html/rfc7519) using ES256K, ES256K-R and Ed25519 algorithms.

Public keys are resolved using the [Decentralized ID (DID)](https://w3c-ccg.github.io/did-spec/#decentralized-identifiers-dids) of the signing identity of the claim, which is passed as the `iss` attribute of the encoded JWT.

## DID methods
We currently support the following DID methods:

- [`ethr`](https://github.com/uport-project/ethr-did-resolver)
- [`uport`](https://github.com/uport-project/uport-did-resolver)
- [`https`](https://github.com/uport-project/https-did-resolver)
- [`nacl`](https://github.com/uport-project/nacl-did)
- [`muport`](https://github.com/3box/muport-did-resolver)

You will need to install each one you need to support. See each method for how to configure it.

Support for other DID methods should be simple. Write a DID resolver supporting the [`did-resolver'](https://github.com/uport-project/did-resolver) interface. Once you've verified that it works, please add a PR adding it to the above list so people can find it.

If your DID method requires a different signing algorithm than what is already supported, please create a PR.

## Installation

```bash
npm install did-jwt
```

or if you use `yarn`

```bash
yarn add did-jwt
```

## Example

### 1. Create a did-JWT

[createJWT](docs/reference/index.md#did-jwtjwtcreatejwtpayload-config--promiseobject-error)

In practice you should secure the key passed to SimpleSigner.  The key provided in code below is for informational purposes; you will need to create an application identity at [My Apps](http://developer.uport.me/myapps) or use our uport-credentials library to [generate an ethereum key pair](https://github.com/uport-project/uport-credentials/blob/develop/docs/guides/index.md#generate-an-ethereum-keypair).

```js
const didJWT = require('did-jwt')
const signer = didJWT.SimpleSigner('278a5de700e29faae8e40e366ec5012b5ec63d36ec77e8a2417154cc1d25383f');

let jwt = await didJWT.createJWT({aud: 'did:ethr:0xf3beac30c498d9e26865f34fcaa57dbb935b0d74', exp:<PHONE_NUMBER>, name: 'uPort Developer'},
                 {alg: 'ES256K', issuer: 'did:ethr:0xf3beac30c498d9e26865f34fcaa57dbb935b0d74', signer})
console.log(jwt);
```

### 2. Decode a did-JWT

Try decoding the JWT.  You can also do this using [jwt.io](jwt.io)

```js
//pass the jwt from step 1
let decoded = didJWT.decodeJWT(jwt)
console.log(decoded)
```

Once decoded a did-JWT will resemble:

```js
{
  header: { typ: 'JWT', alg: 'ES256K' },
  payload: {
    iat:<PHONE_NUMBER>,
    exp:<PHONE_NUMBER>,
    aud: 'did:ethr:0xf3beac30c498d9e26865f34fcaa57dbb935b0d74',
    name: 'uPort Developer',
    iss: 'did:ethr:0xf3beac30c498d9e26865f34fcaa57dbb935b0d74'
  },
  signature: 'kkSmdNE9Xbiql_KCg3IptuJotm08pSEeCOICBCN_4YcgyzFc4wIfBdDQcz76eE-z7xUR3IBb6-r-lRfSJcHMiAA',
  data: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NkstUiJ9.eyJpYXQiOjE1NzE2OTIyMzMsImV4cCI6MTk1NzQ2MzQyMSwiYXVkIjoiZGlkOmV0aHI6MHhmM2JlYWMzMGM0OThkOWUyNjg2NWYzNGZjYWE1N2RiYjkzNWIwZDc0IiwibmFtZSI6InVQb3J0IERldmVsb3BlciIsImlzcyI6ImRpZDpldGhyOjB4ZjNiZWFjMzBjNDk4ZDllMjY4NjVmMzRmY2FhNTdkYmI5MzViMGQ3NCJ9'
}
```

### 3. Verify a did-JWT
[verifyJWT](/docs/reference/index.md#did-jwtjwtverifyjwtjwt-config--promiseobject-error)

You need to provide a did-resolver for the verify function. For this example we will use ethr-did, but there are other methods available above. For more information on configuring the Resolver object please see [did-resolver](https://github.com/decentralized-identity/did-resolver#configure-resolver-object)

``` bash
npm install ethr-did-resolver
```

```js
const Resolver = require('did-resolver')
const ethrDid =  require('ethr-did-resolver').getResolver({rpcUrl: 'https://mainnet.infura.io/v3/...'})

let resolver = new Resolver.Resolver(ethrDid)

// pass the JWT from step 1 & 2
let verifiedResponse = await didJWT.verifyJWT(jwt, {resolver: resolver, audience: 'did:ethr:0xf3beac30c498d9e26865f34fcaa57dbb935b0d74'})
console.log(verifiedResponse);
```

A verified did-JWT returns an object resembling:

```js
{
  payload: {
    iat:<PHONE_NUMBER>,
    exp:<PHONE_NUMBER>,
    aud: 'did:ethr:0xf3beac30c498d9e26865f34fcaa57dbb935b0d74',
    name: 'uPort Developer',
    iss: 'did:ethr:0xf3beac30c498d9e26865f34fcaa57dbb935b0d74'
  },
  doc: {
    '@context': 'https://w3id.org/did/v1',
    id: 'did:ethr:0xf3beac30c498d9e26865f34fcaa57dbb935b0d74',
    publicKey: [ [Object] ],
    authentication: [ [Object] ]
  },
  issuer: 'did:ethr:0xf3beac30c498d9e26865f34fcaa57dbb935b0d74',
  signer: {
    id: 'did:ethr:0xf3beac30c498d9e26865f34fcaa57dbb935b0d74#owner',
    type: 'Secp256k1VerificationKey2018',
    owner: 'did:ethr:0xf3beac30c498d9e26865f34fcaa57dbb935b0d74',
    ethereumAddress: '0xf3beac30c498d9e26865f34fcaa57dbb935b0d74'
  },
  jwt: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NkstUiJ9.eyJpYXQiOjE1NzE2OTI0NDgsImV4cCI6MTk1NzQ2MzQyMSwiYXVkIjoiZGlkOmV0aHI6MHhmM2JlYWMzMGM0OThkOWUyNjg2NWYzNGZjYWE1N2RiYjkzNWIwZDc0IiwibmFtZSI6InVQb3J0IERldmVsb3BlciIsImlzcyI6ImRpZDpldGhyOjB4ZjNiZWFjMzBjNDk4ZDllMjY4NjVmMzRmY2FhNTdkYmI5MzViMGQ3NCJ9.xd_CSWukS6rK8y7GVvyH_c5yRsDXojM6BuKaf1ZMg0fsgpSBioS7jBfyk4ZZvS0iuFu4u4_771_PNWvmsvaZQQE'
}
```

repository: javiesses/did-jwt

repo_name: javiesses/did-jwt


text:
# Wikipedia to ElasticSearch

This is a knowledge resource based on wikipedia.

But also a parsing mechanism that enables parsing of Wikipedia, Wikinews, Wikidata and other Wikimedia .bz2 dumps into an ElasticSearch index.

Project goal - Use 3 different types of Wikipedia pages (Redirect/Disambiguation/Title) in order to extract 6 different
semantic features for tasks such as Identifying Semantic Relations, Entity Linking, Cross Document Co-Reference, Knowledge Graphs, Summarization and other.

Integrated with Intel NLP Framework NLP Architect

For more information and examples check this related blog post.

#### Extracted Relations Types and Features

* Redirect Links - See details at Wikipedia Redirect
* Disambiguation Links - See details at Wikipedia Disambiguation
* Category Links - See details at Wikipedia Category
* Link Title Parenthesis - See details at paper "Extracting Lexical Reference Rules from Wikipedia"
* 'Is A' (extracted from page first paragraph) - See details at paper "Extracting Lexical Reference Rules from Wikipedia"
* Term Frequency (TBD/WIP) - Hold a map of term frequency for computing TFIDF on Wikipadia

***

### Getting the index with Docker
This is the preferred and fastest way to get the elastic index locally.

The index on Docker Hub is updated with wikipedia pages till August 2019.

#### Docker Prerequisites
1) Before starting this one-time process, make sure docker disk image size (*in your Docker Engine Preferences*) is not limited under 150GB.
Once below one-time process done, you can decrease image size
2) If working with a Linux host, you might need to increase host vm.max_map_count,
in order to verify you have the right value (i.e 262144), run:

        $>sudo sysctl vm.max_map_count
        You should see: vm.max_map_count = 262144
        If you see instead: vm.max_map_count = 65530,
        Fix by running:
        $>sudo sysctl -w vm.max_map_count=262144

#### Get Image and Build Container

1) Pull the latest image and run it (pulled image is 11GB)

    `#>docker pull aeirew/elastic-wiki`

    `#>docker run -d -p 9200:9200 -p 9300:9300 aeirew/elastic-wiki`

2) The Elastic container index is still empty, all data is in a compressed file within the image,
in order to create and export the wiki data into the Elastic index (which takes a while) run the following command

    `#>docker exec <REPLACE_WITH_RUNNING_CONTAINER_ID> /tmp/build.sh`

3) Save to new image (after done you can delete the original aeirew/elastic-wiki image, in order to save disk space)

    `#>docker commit <CONTAINER_ID> <IMAGE_NEW_NAME>`

4) after saving stop the running container with

    `#>docker stop <CONTAINER_ID>`

5) That's it! now you can run your created image

    `#>docker run -d -p 9200:9200 -p 9300:9300 <IMAGE_NEW_NAME>`

   To test/query, you can run from terminal:

    `curl -XGET 'http://localhost:9200/enwiki_v3/_search?pretty=true' -H 'Content-Type: application/json' -d '{"size": 5, "query": {"match_phrase": { "title.near_match": "Alan Turing"}}}'`

   This should return a wikipedia page on Alan Turing.

### Building the index From Source

**Disclimer:** Processing Wikipedia latest full dump (15GB .bz2 AND 66GB unpacked as .xml) including the normalization and lemmatization of text,
will take about **5 days** (tested on MacBook pro, using stanford parser to extract relations, normalize and lemmatize the data).

In case of using this data in order to identify semantic relations between phrases at run time, It is recommended to normalize the fields for better results,
in case not needed or for a much faster data export into elastic **(5 hours)**, set normalize to false in `conf.json`, as shown in "Project Configuration Files".

You might want to consider using the Docker Image to save that time

If require to parse other Wiki dumps such as Wikinews, Wikidata, and so on, you can use this process as well, to port the .xml data pages into elastic index for fast queries.

### Requisites
* Java 1.8
* ElasticSearch 6.2 (Installation Guide)
* Wikipedia xml.bz2 dump file (download enwiki latest dump xml)

### Project Configuration Files
* `src/main/resources/conf.json` - basic process configuration
```
    "indexName" : "enwiki_v3" #Set your desired Elastic Search index name
    "docType" : "wikipage" #Set your desired Elastic Search documnent type
    "normalizeFields" : "true" #Weather to run normalization of fields while processing the data
    "insertBulkSize": 100 #Number of pages to bulk insert to elastic search every iteration (found this number to give best preformence)
    "mapping" : "mapping.json" #Elastic Mapping file (should point to src/main/resources/mapping.json)
    "setting" : "es_map_settings.json" #Elastic Setting file (should point to src/main/resources/es_map_settings.json)
    "host" : "localhost" #Elastic host (were Elastic instance is installed and running)
    "port" : 9200 #Elastic port (host port were Elastic is installed and running, elastic defualt is 9200)
    "wikiDump" : "dumps/enwiki-latest-pages-articles.xml.bz2" #WikiMedia .bz2 downloaded dump file location
    "scheme" : "http" #Elastic host schema (should probebly stay unchanged)
    "shards" : 1 #Number of Elastic shards to use
    "replicas" : 0 #Number of Elastic replicas to use
```
* `src/main/resources/mapping.json` - Elastic wiki index mapping (Should probably stay unchanged)
* `src/main/resources/es_map_settings.json` - Elastic index settings (Should probably stay unchanged)

* Make sure Elastic process is running and active on your host (if running Elastic locally your IP is http://localhost:9200/)
* Checkout/Clone the repository
* Put wiki xml.bz2 dump file (no need to extract the bz2 file!) in: `dumps` folder under root checkout repository.

Recommendation: Start with a small wiki dump, make sure you like what you get (or modify configurations to meet your needs) before moving to a full blown 15GB dump export..
* Make sure `conf.json` configuration for Elastic are set as expected (default localhost:9200)
* From command line navigate to project root directory and run:

`./gradlew clean build -x test`

*Should get a message saying: `BUILD SUCCESSFUL in 7s`*
* Extract the build zip file created at this location `build/distributions/WikipediaToElastic-1.0.zip`
* Run the process from command line:

`java -Xmx6000m -DentityExpansionLimit=2147480000 -DtotalEntitySizeLimit=2147480000 -Djdk.xml.totalEntitySizeLimit=2147480000 -jar build/distributions/WikipediaToElastic-1.0/WikipediaToElastic-1.0.jar`

### Generated Elastic Page Example

Once process has finished, you should see in your ElasticSearch selected index, pages that have been created with the following structures (also see "Created Fields Attributes" for more details):

**Page Example (Extracted from Wikipedia disambiguation page):**
```json
{
  "_index": "enwiki_v3",
  "_type": "wikipage",
  "_id": "40573",
  "_version": 1,
  "_score": 20.925367,
  "_source": {
    "title": "NLP",
    "text": "{{wiktionary|NLP}}\n\n'''NLP''' may refer to:\n\n; .....",
    "relations": {
      "isPartName": false,
      "isDisambiguation": true,
      "disambiguationLinks": [
        "Natural language programming",
        "New Labour",
        "National Library of the Philippines",
        "Neuro linguistic programming",
        "Natural language processing",
        "National Liberal Party",
        "Natural Law Party",
        "National Labour Party",
        "Normal link pulses",
        "New Labour Party"
      ],
      "categories": [
        "disambiguation"
      ],
      "titleParenthesis": [],
      "disambiguationLinksNorm": [
        "natural language processing",
        "natural law party",
        "national labour party",
        "natural language programming",
        "national library philippine",
        "neuro linguistic programming",
        "new labour party",
        "national liberal party",
        "new labour",
        "normal link pulse"
      ],
      "categoriesNorm": [
        "disambiguation"
      ],
      "titleParenthesisNorm": []
    }
  }
}
 ```
**Page Example (Extracted from Wikipedia redirect page):**
```json
{
  "_index": "enwiki_v3",
  "_type": "wikipage",
  "_id": "2577248",
  "_version": 1,
  "_score": 20.925367,
  "_source": {
    "title": "Nlp",
    "text": "#REDIRECT",
    "redirectTitle": "NLP",
    "relations": {
      "isPartName": false,
      "isDisambiguation": false
    }
  }
}
 ```

### Created Fields Attributes

| json field  | Value | comment |
| ------------- | ------------- | ------------- |
| _id | Text | Wikipedia page id |
| _source.title | Text | Wikipedia page title |
| _source.text | Text | Wikipedia page text |
| _source.redirectTitle | Text (optional) | Wikipedia page redirect title |
| _source.relations.beCompRelations | List (optional) | Be-Comp (or 'Is A') relation list |
| _source.relations.beCompRelationsNorm | List (optional) | Be-Comp (or 'Is A') relation list norm |
| _source.relations.categories | List (optional) | Categories relation list |
| _source.relations.categoriesNorm | List (optional) | Categories relation list norm |
| _source.relations.isDisambiguation | Bool (optional) | is Wikipedia disambiguation page |
| _source.relations.isPartName | List (optional) | is Wikipedia page name description |
| _source.relations.titleParenthesis | List (optional) | List of disambiguation secondary links  |
| _source.relations.titleParenthesisNorm | List (optional) | List of disambiguation secondary links norm |

### Citing
If you use this project or the created data in your research, please use the following citation https://doi.org/10.5281/zenodo.3239509


text:
# advanced-titlecase

Capitalize English titles.

## Installation

1.  Clone the repository:

    ```fish
    git clone https://github.com/Perlence/advanced-titlecase.git
    ```

2.  Install the package:

    ```fish
    pip install .
    ```

## Usage

advanced-titlecase reads lines from stdin, applies casing and prints the results to stdout.

The program is not bulletproof and is insensitive to edge cases. Please, check the output manually and refer to https://musicbrainz.org/doc/Style/Language/English.

repository: Perlence/advanced-titlecase

repo_name: Perlence/advanced-titlecase


text:
# Mapkit samples

This android project contains several sample apps with examples of use MapKit SDK lite API.

**Project structure:**
1. ```map-with-placemark``` - shows how to start work with MapKit SDK
2. ```common``` - the common part between all sample apps

repository: yandex/mapkit-android-demo

gha_license_id: NOASSERTION

repo_name: yandex/mapkit-android-demo


text:
# eCollabro
eCollabro - Collaborative .Net Framework

Collaborative Platform/Framework developed in .Net

Showcase for latest technologies, tools and design patterns like WCF Services, Entity Framework, Unity Of Work, MVC 5, Web API, JQuery, AngularJS and Bootstrap

Basic security framework and functionality helps to reduce development efforts for rapid development.

Basic features of configurable CMS which helps to setup a website without writing any code which consist of CMS tools like Blog, Web Site dynamic pages, Document Libraries, Image Gallery and Announcements.

Send email at<EMAIL_ADDRESS>for any queries or more details.

Explore it now?
Create User on demo.ecollabro.com (mapped as Site Admin) and explore and test all features.

Email to add your user as Super Admin to see portal setup features

Visit eCollabro.com to know more about eCollabro.

Register for your feedback, wish list and comments.

repository: eCollobro/eCollabro

repo_name: eCollobro/eCollabro


text:
# Cookbook: mo_backup

Cookbook to perform application backups. This cookbook uses
[backup gem](http://meskyanichi.github.io/backup/v4/) to run the backups. Please
check the gem documentation for valid options on each supported type.

## Table of Contents

* [Development](#development)
  * [Current state](#current-state)
  * [Features planned](#features-planned)
* [Supported Platforms](#supported-platforms)
* [Recipes](#recipes)
* [Resources](#resources)
* [Attributes](#attributes)
* [License](#license)
* [Authors](#authors)

## Development

This cookbook is still in development but can be used if current features cover
your needs.

### Current state

For now, this cookbook:

* Supports installing rbenv globally and the backup gem inside it.
* Provides a method to generate the backup configuration file (the model) for:
  * Application files.
  * MySQL, MongoDB and Redis databases.
* Supports:
  * Dropbox, Amazon S3, SCP and SFTP as storages.
  * Backup scheduling.
  * Compression with Gzip.
  * Mail relay configuration.
  * Encryption with OpenSSL.
  * Synchronization using Rsync.

### Features planned

Features to be implemented:

* Notifiers: not all alternatives are implemented
* Storages: not all alternatives are implemented
* Syncers: not all alternatives are implemented

## Supported Platforms

Tested on Ubuntu 14.04, should work on:

* Centos / Redhat / Fedora / Ubuntu / Debian.

## Recipes

This cookbook has only one recipe which is `install`, the one that sets up the
global rbenv environment and the backup gem inside that environment. Must be
run on every server that will execute backups with this cookbook.

## Resources

###`mo_backup`

Creates a model for backup specified archives to be backed up daily, weekly and
monthly. Unless a storage specifies a keep value, each period can specify a different
keep values

Supported attributes are:

* `name`: name of this backup. Name must not contain spaces
* `description`: description for this backup
* `user`: user to run backups as. Defaults to root
* `backup_directory`: directory relative to user's home directory where
backup configuration will be stored. Defaults to `Backup/models`
* `notifiers`: hash of notifiers specifications
* `use_sudo`: will run tar using sudo
* `root`: specifies base path where relatives archives will be considered
* `archives`: array or string of archives to backup
* `exclude`: array or string of archives to exclude
* `compress`: compress backed up data
* `storages`: hash of storages specifications
* `databases`: hash of databases specifications
* `daily_keeps`: how many backups will be kept for daily backups. *May be
  overwritten by storages definition*
* `weekly_keeps`: how many backups will be kept for weekly backups. *May be
  overwritten by storages definition*
* `monthly_keeps`: how many backups will be kept for monthly backups. *May be
  overwritten by storages definition*
* `start_hour`: start hour to calculate a random backup hour range. Defaults to
  1
* `end_hour`: end hour to calculate a random hour range. Defaults to 7
* `week_day`: default week day to backup data weekly. Defaults to Sunday (0)
* `month_day`: default month day to backup data monthly

###`mo_backup_sync`

Creates a model for syncing specified directories

Supported attributes are:

* `name`: name of this backup. Name must not contain spaces
* `description`: description for this backup
* `user`: user to run backups as. Defaults to root
* `backup_directory`: directory relative to user's home directory where
* `directories`: array or string of directories to be synced
* `exclude`: array or string exclude directories to be excluded
* `syncers`: hash of syncers specifications. *If you specify irectories and
  exclude attributes inside a syncer definition, these attributes will be
overwritten by resource values*
* `every_minutes`: number used to specify when sync will be done every number
  minutes. When false sync minutes will be disabled
* `every_hours`: number used to specify when sync will be done every number
  hours. When false sync by hours will be disabled

### Storage, Notifier and Syncer definitions

Are hashes of keys valid for backup gem with its values. For more information
view gem documentation and `library/mo_backu_*.rb` files

## License

MIT (see LICENSE.md)

## Authors

* Author:: Christian Rodriguez<EMAIL_ADDRESS>* Author:: Leandro Di Tommaso<EMAIL_ADDRESS>* Author:: Nahuel Cuesta Luengo<EMAIL_ADDRESS>

gha_language: Ruby


text:
# Ansible role ssh_config

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

An Ansible Role that creates SSH client config file.

## Role Variables

Available variables are listed below, along with default values (see `defaults/main.yml`):

Either of *ssh_config_targets* or *ssh_config_bastion_alias* is mandatory.

Target hosts are listed in the form of array of objects.
Each object must have *alias* property while other properties are optional.

```yaml
ssh_config_targets:
  - alias: "srv1"
    host: "<IP_ADDRESS>"
    port: 22
    user: username
    key: ~/.ssh/keys/secret.pem
```

If you use bastion host before target instances, you can use *ssh_config_bastion_\** variables.
`vars/aws.yml` shows AWS bastion pattern.
If you enable AWS pattern, set *ssh_config_aws* *yes* and define
*ssh_config_bastion_host*, *ssh_config_aws_bastion_key*, and *ssh_config_aws_target_key* variables.
An example is in `tests/vars/aws.yml`.

## Dependencies

None

## Example Playbook

```yaml
- hosts: localhost
  vars_files:
    - vars/main.yml
  roles:
    - role: skitazaki.ssh_config
```

## License

MIT

repository: skitazaki/sandbox

branch_name: refs/heads/develop

gha_language: Jupyter Notebook

repo_name: skitazaki/sandbox


text:
# CHANGELOG

## 0.3.10 (July 28th, 2019)

- Add the Electron framework demo

## 0.3.7 (July 25th, 2018)

- Add ability to disable individual titlebar controls (#125)
- Allow end-user to force `isWindowFocused` prop (#126)
- Allow defaultChecked to be string as well as boolean (#123) (Fixes #90)

## 0.3.6 (July 25th, 2018)

- This release was published incorrectly. Use 0.3.7 instead.

## 0.3.5 (April 6th, 2018)

- Fixed issue with case sensitivity

## 0.3.4 (April 4th, 2018)

- Added TextArea component
- Several minor fixes

## 0.3.3 (November 21st, 2017)

- Updated dependencies
- Fixed title props

## 0.3.2 (October 17th, 2017)

- Updated dependencies
- Fixed unit tests
- Fixed unit playground
- Add public `focus` and `blur` methods to TextInput
- Prop title of TitleBar now supports element node

## 0.3.1 (June 21th, 2017)

- Updated dependencies

## 0.3.0 (April 17th, 2017)

- Added prop-types dependency to avoid deprecation in React 16

## 0.2.19 (March 14th, 2017)

- Removed rubber band effect from list view

## 0.2.18 (March 14th, 2017)

- Fixed an issue with OS detection

## 0.2.17 (January 9th, 2017)

- Fixed issue with windows window background color
- Added ref value for input elements
- CheckBoxes and Radios now changes style when window is unfocused
- Can now import components based on OS from 'react-desktop'

## 0.2.16 (January 9th, 2017)

- Custom styles for Windows text field's label
- Default color for Windows text field's label changes based on theme

## 0.2.15 (January 9th, 2017)

- Fixed bug with macOs text field’s placeholder

## 0.2.14 (September 19th, 2016)

- Fixed duplicate onChange events on the windows textInput

## 0.2.13 (August 25th, 2016)

- Improve macOS title bar control icons

## 0.2.12 (August 17th, 2016)

- Fixed some styling issues with the list view
- Fixed some styling issues with the windows

## 0.2.11 (August 12th, 2016)

- Added macOS list view component

## 0.2.10 (August 11th, 2016)

- Quick fix for the macOS text input component border issue

## 0.2.9 (August 11th, 2016)

- Added macOS search field component
- Added centerPlaceholder, focusRing, icon and onEnter properties to the macOS text input component

## 0.2.8 (August 8th, 2016)

- Added macOS toolbar nav component
- Added inset property to macOS title bar component
- Added dimension and alignment properties to macOS toolbar component

## 0.2.7 (July 28th, 2016)

- Added macOS dialog component
- Added bold property to macOS text
- Added onEnter and disabled properties to macOS button
- Fixed issues with margin on pin component for macOS

## 0.2.6 (July 27th, 2016)

- Added macOS pin component
- Added size, padding and margin properties to macOS buttons
- Fixed issues with text input for macOS
- Added rounded corners and size properties to text input for macOS

## 0.2.5 (July 18th, 2016)

- Fixed some issues with View alignment

## 0.2.4 (July 17th, 2016)

- Removed all unknown props from components
- Intial window focus is now the real window focus instead of being always true

## 0.2.3 (June 24th, 2016)

- Fixed bug with title bar in macOS

## 0.2.2 (June 24th, 2016)

- Added Link component for macOS
- Added size to Text component
- Added transparent option to titlebar for macOS
- Fixed title bar size for macOS

## 0.2.1 (June 14th, 2016)

- Added support for React 15.1.0

## 0.2.0 (May 16th, 2016)

- Beta 1 release

repository: gabrielbull/react-desktop

repo_name: gabrielbull/react-desktop


text:
# URLs

- Light: 	https://localhost:44339/

- Server:   http://localhost:60916/

[POST]:

```
{
	Source: {
		/**/
		Latitude: 0,
		Longitude: 0
		/**/
	},
	Destination: {
		/**/
		Latitude: 0,
		Longitude: 0
		/**/
	}
}
```

- Proxy:

            http://localhost:60917/

		    http://localhost:60917/bikes/					[GET]: ```number, contract```

		    http://localhost:60917/stands/					[GET]: ```number, contract```

# Bypass CORS Policy

The first time I try to test the light web client, I got something like this:

Error: Access to XMLHttpRequest at 'http://localhost:60916/service.svc/' from origin 'https://localhost:44339' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

To work around this error you need to start google chrome with the disable-web-security flag, for that open your command prompt and write these two commands, change the path to the one where this solution currently exists.

1. cd c:\program files (x86)\google\chrome\application

2. chrome.exe  --disable-site-isolation-trials --disable-web-security --user-data-dir="d:\biking"

# Cache

To implement the cache, I used caching support for WCF HTTP Web services: https://docs.microsoft.com/en-us/aspnet/mvc/overview/older-versions-1/controllers-and-routing/improving-performance-with-output-caching-cs

The implementation of this caching support is pretty straightforward, all I have to do is to add this ASP.Net Tag above the method I want to cache:

[OutputCache("CacheFor60Seconds")]

And add this XML data to my web.config:
```
<system.web>
	<caching>
	  <outputCacheSettings>
	     <outputCacheProfiles>
	        <add name="CacheFor60Seconds" duration="60" varyByParam="none"/>
	     </outputCacheProfiles>
	  </outputCacheSettings>
	</caching>
</system.web>
```

# How can we be sure that the system caching is working?

To check the caching system all we have to do is to add a breakpoint in the code, the best position to add this breakpoint is the return value of one of the two CheckBikesAvailability() and CheckStandsAvailability() methods, but first we need to be sure that we are sending the same request, for that we need to comment out these two lines: $("#source").val(""), $("#destination").val(""), int the reset() function, in the project client, in the script.js file (To delete the javascript cache press CTRL+SHIFT+R ). A demo of this operation can be seen in video /demo/cache.mp4, to keep things simple in this demo, we're taking a cache time of just 30 seconds.

# Notes

1. During initialization, all dynamic data was ignored during our call to JCDecaux: https://developer.jcdecaux.com/#/opendata/vls?page=dynamic
2. While using the varyByParam attribute, a null value means the cache will ignore any changes to URL parameters, for example. https://www.google.com/?q=123 and https://www.google.com/?q=456 will be the same cache, if we specify an attribute such as: varyByParam = "q" now the system will create a cache for each value of "q", and with multiple fields all we have to do is just this: varyByParam = "*" like this the system will create a cache for each value for each parameter of the URL.
3. You can check demo folder for caching demo and light client demo


text:
# research-report

[![build](https://github.com/lijinglin3/research-report/actions/workflows/build.yml/badge.svg)](https://github.com/lijinglin3/research-report/actions/workflows/build.yml)

研报下载助手

## Usage

```text
$ research-report -h
Usage:
  research-report [command]

Available Commands:
  completion  generate the autocompletion script for the specified shell
  download    Download research reports
  help        Help about any command
  list        List research reports

Flags:
  -b, --begin string    begin time (default "2021-10-10")
  -e, --end string      end time (default "2021-10-10")
  -h, --help            help for research-report
  -m, --min-pages int   min pages limit (default 15)
  -t, --type strings    report type, 0: individual stocks, 1: industry, 2: macro (default [0,1,2])

Use "research-report [command] --help" for more information about a command.
```


text:
Ian's Quadcopter Stuff
======================

Scripts used to control my quadcopter, and other miscellaneous stuff.

* `remote/remote_server.py` - Accepts NMEA strings over TCP and makes the appropriate demands of the quad via serial output
* `remote/remote_client.py` - Hacky client for `remote_server.py` that uses keyboard input to send demands
* `video/stream.sh` - Stream video from the RPi using netcat and mplayer
* `transmitter/txconfig.dat` - Channel map for my 2.4GHz transmitter


text:
poorwm
======

PoorWM is a hostile fullscreen window manager for X11.

This project begins after finding TinyWM by Nick Welch
(http://incise.org/tinywm.html), whose 50 lines of code
were quickly studied, then modified to remove excess
features and implement window switching.

Features
========
- Fullscreen windows
- Window switching by pressing Alt+Tab
- No window borders
- No maximize / minimize / close user interaction
- No window dragging / moving
- No visual hints of any kind
- Small enough code base

Building poorwm
===============
- make
- sudo make install

Known bugs
==========
- New windows are not immediately forced to fullscreen, but
  will behave themselves after reaching them via Alt+Tabbing.

license: TCL

repository: kthxbyte/poorwm

repo_name: kthxbyte/poorwm


text:
---
hrs_structure:
  division: '3'
  volume: '12'
  title: '31'
  chapter: 583A
  section: 583A-109
type: hrs_section
tags:
  - Property
  - Family
menu:
  hrs:
    identifier: HRS_0583A-0109
    parent: HRS0583A
    name: Chapter 583A Uniform Child-Custody Jurisdiction and Enforcement Act
weight: 109045
title: Uniform Child-Custody Jurisdiction and Enforcement Act
full_title: Chapter 583A Uniform Child-Custody Jurisdiction and Enforcement Act
---
**[§583A-109] Appearance and limited immunity.** (a) A party to a child-custody proceeding, including a modification proceeding, or a petitioner or respondent in a proceeding to enforce or register a child-custody determination, is not subject to personal jurisdiction in this State for another proceeding or purpose solely by reason of having participated, or having been physically present for the purpose of participating, in the proceeding.

(b) A person who is subject to personal jurisdiction in this State on a basis other than physical presence is not immune from service of process in this State. A party present in this State who is subject to the jurisdiction of another state is not immune from service of process allowable under the laws of that state.

(c) The immunity granted by subsection (a) does not extend to civil litigation based on acts unrelated to the participation in a proceeding under this chapter committed by an individual while present in this State. [L 2002, c 124, pt of §2]

repository: SamMade/BlueAndKrabby

repo_name: SamMade/BlueAndKrabby


text:
---
title: "Major Site Enhancements"
authorName: jwage
authorEmail:
categories: []
permalink: /2009/07/04/major-site-enhancements.html
---
You've probably noticed over the past few days I have rolled out some
major new site enhancements. You can find more information below about
all the changes made.

Register Now!
=============

I have opened up a new registration portal on the Doctrine website. This
will create a login both on the website and Trac and is also connected
to your SVN account if you choose to request access.

Login Now!
==========

Once you have registered you can login to the
[website](https://www.doctrine-project.org/login) and
[Trac](http://trac.doctrine-project.org/login). This will make some
extra functionality available for you to manage your user information.

New Extensions Repository
=========================

A place where you can browse, search and find out what extensions are
available for Doctrine. It contains documentation, ability to run the
unit tests and download the code.

Check it out [here](https://www.doctrine-project.org/extensions).

User Documentation Area
=======================

For a long time I have wanted to have an area of the website where users
could manage as much user contributed documentation as they want. I have
started the new site with a tutorial on [how to write an
extension](https://www.doctrine-project.org/documentation/user/1_2/en/how-to-write-an-extension).

New Homepage Look
=================

I have slightly tweaked the homepage design to match the design of the
new Doctrine
[book](https://www.amazon.com/Doctrine-ORM-PHP-Jonathan-Wage/dp/2918390038/ref=sr_1_1?ie=UTF8&s=books&qid=1246303098&sr=8-1).
This is our first book so if you want to support the Doctrine project or
just want to learn about Doctrine then we suggest you purchase a copy!
:)

Manage your User Account
========================

Central location where you can manage all the information you control as
a Doctrine authenticated user. You can see what extensions you've
written, control your user contributed documentation, request SVN access
and update your account information. Check it out
[here](https://www.doctrine-project.org/user/account).

These changes are primarily based around the new extensions repository
which is available for Doctrine 1.2. You can read about what else is new
in Doctrine 1.2 [here](https://www.doctrine-project.org/upgrade/1_2).

repository: doctrine/doctrine-website

gha_language: PHP

repo_name: doctrine/doctrine-website


text:
# Book Collection

#### _A book collection website using MySQL, September 19, 2016_

#### By _**Katy Henning & Aimen Khakwani**_

## Description

This is a book collection site. It takes user input and adds books to your collection, storing them using MySQL. Users can also search the list by book title and delete the collection.

<img src='web/bookellect.png' alt='image of the site'>

## Setup/Installation Requirements

* Clone the repository
* Using the command line, navigate to the project's root directory
* Install dependencies by running $ composer install
* Navigate to the /web directory and start a local server with $ php -S localhost:8000
* Open a browser and go to the address http://localhost:8000 to view the application

## Known Bugs

There are no known bugs at this time.

## Support and Contact Details

For questions or comments, please contact us through GitHub.

## Technologies Used

* _PHP_
* _Silex_
* _Twig_
* _Bootstrap_
* _MySQL_

### License

*This website is licensed under the MIT license.*
Copyright (c) 2016 **_Katy Henning & Aimen Khakwani_**

repository: KatyCodes/PHP-bookcollection

repo_name: KatyCodes/PHP-bookcollection


text:
# MIPS applications

This repository contains some MIPS applications.
You can run these programs on **[MIPSimu][MIPSimu]**.

## Applications

Here is the list of available applications.
Each application have its own `README`.

- **Screen Saver** – A Windows XP like screen saver.

- **Flaps The Mips** – A [Flappy Bird][FlappyBird] like game.

- **Pong** – A pong game (Video Olympics like version).

- **Home** – A home menu for launching all applications above.

## License

This project is under the MIT license.
Read the file called `LICENSE` at the root of the project for more information.

[MIPSimu]: https://github.com/ParksProjets/MIPSimu
[FlappyBird]: https://en.wikipedia.org/wiki/Flappy_Bird

repository: ParksProjets/Mips-Applications

repo_name: ParksProjets/Mips-Applications


text:
# Django Deployment to Ubuntu 18.04

In this guide I will go through all the steps to create a VPS, secure it and deploy a Django application. This is a summarized document from this [digital ocean doc](https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-18-04)

Any commands with "$" at the beginning run on your local machine and any "#" run when logged into the server

## Create A Digital Ocean Droplet

# Security & Access

### Creating SSH keys (Optional)

You can choose to create SSH keys to login if you want. If not, you will get the password sent to your email to login via SSH

To generate a key on your local machine

```
$ ssh-keygen
```

Hit enter all the way through and it will create a public and private key at

```
~/.ssh/id_rsa
~/.ssh/id_rsa.pub
```

You want to copy the public key (.pub file)

```
$ cat ~/.ssh/id_rsa.pub
```

Copy the entire output and add as an SSH key for Digital Ocean

### Login To Your Server

If you setup SSH keys correctly the command below will let you right in. If you did not use SSH keys, it will ask for a password. This is the one that was mailed to you

```
$ ssh root@YOUR_SERVER_IP
```

### Create a new user

It will ask for a password, use something secure. You can just hit enter through all the fields. I used the user "SecretUserName" but you can use anything

```
# adduser SecretUserName
```

### Give root privileges

```
# usermod -aG sudo SecretUserName
```

### SSH keys for the new user

Now we need to setup SSH keys for the new user. You will need to get them from your local machine

### Exit the server

You need to copy the key from your local machine so either exit or open a new terminal

```
# exit
```

You can generate a different key if you want but we will use the same one so lets output it, select it and copy it

```
$ cat ~/.ssh/id_rsa.pub
```

### Log back into the server

```
$ ssh root@YOUR_SERVER_IP
```

### Add SSH key for new user

Navigate to the new users home folder and create a file at '.ssh/authorized_keys' and paste in the key

```
# cd /home/SecretUserName
# mkdir .ssh
# cd .ssh
# nano authorized_keys
Paste the key and hit "ctrl-x", hit "y" to save and "enter" to exit
```

### Login as new user

You should now get let in as the new user

```
$ ssh SecretUserName@YOUR_SERVER_IP
```

### Disable root login

```
# sudo nano /etc/ssh/sshd_config
```

### Change the following

```
PermitRootLogin no
PasswordAuthentication no
```

### Reload sshd service

```
# sudo systemctl reload sshd
```

# Simple Firewall Setup

See which apps are registered with the firewall

```
# sudo ufw app list
```

Allow OpenSSH

```
### sudo ufw allow OpenSSH
```

### Enable firewall

```
# sudo ufw enable
```

### To check status

```
# sudo ufw status
```

We are now done with access and security and will move on to installing software

# Software

## Update packages

```
# sudo apt update
# sudo apt upgrade
```

## Install Python 3, Postgres & NGINX

```
# sudo apt install python3-pip python3-dev libpq-dev postgresql postgresql-contrib nginx curl
```

# Postgres Database & User Setup

```
# sudo -u postgres psql
```

You should now be logged into the pg shell

### Create a database

```
CREATE DATABASE Your_DataBase_Name;
```

### Create user

```
CREATE USER Your_DataBase_User WITH PASSWORD 'Your_DataBase_Password';
```

### Set default encoding, transaction isolation scheme (Recommended from Django)

```
ALTER ROLE Your_DataBase_User SET client_encoding TO 'utf8';
ALTER ROLE Your_DataBase_User SET default_transaction_isolation TO 'read committed';
ALTER ROLE Your_DataBase_User SET timezone TO 'UTC';
```

### Give User access to database

```
GRANT ALL PRIVILEGES ON DATABASE Your_DataBase_Name TO Your_DataBase_User;
```

### Quit out of Postgres

```
\q
```

# Vitrual Environment

You need to install the python3-venv package

```
# sudo apt install python3-venv
```

### Create project directory

```
# mkdir pyapps
# cd pyapps
```

### Create venv

```
# python3 -m venv ./venv
```

### Activate the environment

```
# source venv/bin/activate
```

# Git & Upload

### Pip dependencies

From your local machine, create a requirements.txt with your app dependencies. Make sure you push this to your repo

```
$ pip freeze > requirements.txt
```

Create a new repo and push to it (you guys know how to do that)

### Clone the project into the app folder on your server (Either HTTPS or setup SSH keys)

```
# git clone https://github.com/yourgithubname/Your_Project_Name.git
```

## Install pip modules from requirements

You could manually install each one as well

```
# pip install -r requirements-prod.txt
```

# Local Settings Setup

Add code to your settings.py file and push to server

```
try:
    from .local_settings import *
except ImportError:
    pass
```

Create a file called **.env** in src folder on your server and add the following  ## .env for python decouble library to secure creadentails
See the Example .env File for more info
- SECRET_KEY
- DATABASES_Credentials
- DEBUG  ## Always make it False
- EMAIL_Credentials
- ANY OTHER CREDENTIALS YOU WANT TO PROTECT

## Edit manage.py
```
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mysite.settings)
to
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mysite.settings.production')
```

## Run Migrations
```
# python manage.py makemigrations
# python manage.py migrate
```

## Create super user

```
# python manage.py createsuperuser
```

## Create static files
```
python manage.py collectstatic
```

### Create exception for port 8000

```
# sudo ufw allow 8000
```

## Run Server

```
# python manage.py runserver <IP_ADDRESS>:8000
```

### Test the site at YOUR_SERVER_IP:8000

Add some data in the admin area

# Gunicorn Setup

Install gunicorn

```
# pip install gunicorn
```

Add to requirements.txt

```
# pip freeze > requirements.txt
```

### Test Gunicorn serve

```
# gunicorn --bind <IP_ADDRESS>:8000 ProjectName.wsgi
```

Your images, etc will be gone

### Stop server & deactivate virtual env

```
ctrl-c
# deactivate
```

### Open gunicorn.socket file

```
# sudo nano /etc/systemd/system/gunicorn.socket
```

### Copy this code, paste it in and save

```
[Unit]
Description=gunicorn socket

[Socket]
ListenStream=/run/gunicorn.sock

[Install]
WantedBy=sockets.target
```

### Open gunicorn.service file

```
# sudo nano /etc/systemd/system/gunicorn.service
```

### Copy this code, paste it in and save

```
[Unit]
Description=gunicorn daemon
Requires=gunicorn.socket
After=network.target

[Service]
User=djangoadmin
Group=www-data
WorkingDirectory=/home/djangoadmin/pyapps/btre_project
ExecStart=/home/djangoadmin/pyapps/venv/bin/gunicorn \
          --access-logfile - \
          --workers 3 \
          --bind unix:/run/gunicorn.sock \
          btre.wsgi:application

[Install]
WantedBy=multi-user.target
```

### Start and enable Gunicorn socket

```
# sudo systemctl start gunicorn.socket
# sudo systemctl enable gunicorn.socket
```

### Check status of guinicorn

```
# sudo systemctl status gunicorn.socket
```

### Check the existence of gunicorn.sock

```
# file /run/gunicorn.sock
```

# NGINX Setup

### Create project folder

```
# sudo nano /etc/nginx/sites-available/btre_project
```

### Copy this code and paste into the file

```
server {
    listen 80;
    server_name YOUR_IP_ADDRESS;

    location = /favicon.ico { access_log off; log_not_found off; }
    location /static/ {
        root /home/djangoadmin/pyapps/btre_project;
    }

    location /media/ {
        root /home/djangoadmin/pyapps/btre_project;
    }

    location / {
        include proxy_params;
        proxy_pass http://unix:/run/gunicorn.sock;
    }
}
```

### Enable the file by linking to the sites-enabled dir

```
# sudo ln -s /etc/nginx/sites-available/btre_project /etc/nginx/sites-enabled
```

### Test NGINX config

```
# sudo nginx -t
```

### Restart NGINX

```
# sudo systemctl restart nginx
```

### Remove port 8000 from firewall and open up our firewall to allow normal traffic on port 80

```
# sudo ufw delete allow 8000
# sudo ufw allow 'Nginx Full'
```

### You will probably need to up the max upload size to be able to create listings with images

Open up the nginx conf file

```
# sudo nano /etc/nginx/nginx.conf
```

### Add this to the http{} area

```
client_max_body_size 20M;
```

### Reload NGINX

```
# sudo systemctl restart nginx
```

### Media File Issue
You may have some issues with images not showing up. I would suggest, deleting all data and starting fresh as well as removeing the "photos" folder in the "media folder"
```
# sudo rm -rf media/photos
```

# Domain Setup

Go to your domain registrar and create the following a record

```
@  A Record  YOUR_IP_ADDRESS
www  CNAME  example.com
```

### Go to settings/production.py on the server and change "ALLOWED_HOSTS" to include the domain

```
ALLOWED_HOSTS = ['IP_ADDRESS', 'example.com', 'www.example.com']
```

### Edit /etc/nginx/sites-available/btre_project

```
server {
    listen: 80;
    server_name xxx.xxx.xxx.xxx example.com www.example.com;
}
```

### Reload NGINX & Gunicorn

```
# sudo systemctl restart nginx
# sudo systemctl restart gunicorn
```


text:
![gocondor logo](https://github.com/gocondor/gocondor.github.io/raw/master/img/logo.png)
# GoCondor

![Build Status](https://github.com/gocondor/gocondor/actions/workflows/build-master.yml/badge.svg)
![Test Status](https://github.com/gocondor/gocondor/actions/workflows/test-master.yml/badge.svg)
[![GoDoc](https://godoc.org/github.com/gocondor/gocondor?status.svg)](https://godoc.org/github.com/gocondor/gocondor)
[![Go Report Card](https://goreportcard.com/badge/github.com/gocondor/gocondor)](https://goreportcard.com/report/github.com/gocondor/gocondor)

## What is GoCondor?
GoCondor is a golang web framework with an `MVC` like architecture, it's based on [Gin framework](https://github.com/gin-gonic/gin), it features a simple organized directory structure for your next project with a pleasant development experience, made for developing modern APIs and microservices.

## Features
- Router
- Routing Groups
- Middlewares
- JWT tokens
- ORM (GORM)
- Sessions
- Authentication
- Cache (Redis)
- TLS
- Live-Reloading for development
- Features Control

## Architecture
The architecture is similar to `MVC`, where there is a routes file `http/routes.go` in which you can map all your app routes to their handlers.
Handlers are simply methods that get executed when the matching request is received, you can think of it like a controller's action in `MVC`.

#### The request journey:
`Request -> Routing -> Middleware -> Handler -> Middleware -> Json Response`

## Folder structure
```bash
├── condor
│   ├── config/ ---------------> control what features to turn on
│   ├── httpd/-----------------> http related code
│   │   ├── handlers/ --------------> contains your requests handlers
│   │   ├── middlewares/ -----------> middlewares are defined here
│   ├── routes.go -------------> routes are mapped to their handlers here
│   ├── logs/ -----------------> logs file is here
│   ├── models/ ---------------> database models
│   ├── ssl/ ------------------> ssl certificates goes here
│   ├── .env ------------------> environment variables
│   ├── .gitignore ------------> .gitignore file
│   ├── go.mod ----------------> Go modules that project depends on
│   ├── LICENSE ---------------> license
│   ├── main.go ---------------> main file
│   ├── README.md -------------> readme file
```

## Installation
To create a new GoCondor project you need to install the `gocondor cli` first

#### Install GoCondor cli
To install the `gocondor cli` globally open up your terminal and run the following command:
```bash
go get github.com/gocondor/installer/gocondor
```

#### Create a new project:
The command for creating a new project is the following:
```bash
gocondor new [project-name] [project-location]
```
where:
`project-name` is the name of your project
`project-location` is the remote repository that will host the project, usually people use `github.com`

Now let's create a project with the name `todo` and let's assume it's hosted on the repository `github.com/my-organization/todo`, here is the command to create that project
```bash
gocondor new todo github.com/my-organization/todo
```

## Getting started
Let's add the route `/hello`, and lets have `hello there!` as the response.
To do that Open the file `http/routes.go` in your editor, update the function `RegisterRoutes()`, make sure the it looks like below:
```go
func RegisterRoutes() {
    router := routing.Resolve()

    // Define your routes here
    router.Get("/hello", func(c *gin.Context) {
        message := "hello there!"

        c.JSON(http.StatusOK, gin.H{
            "message": message,
        })
    })
}
```
Next cd into the project folder and start the app by running the following command:
```bash
go run main.go
```
or you can start it using [Air](https://github.com/cosmtrek/air)
```bash
air main.go
```
Finally, open up your browser and navigate to `localhost:8000/hello`.

To learn how to create handlers files and how to add handlers to them check [handlers docs](https://gocondor.github.io/docs/handlers)

## Contribute
The framework consists of two main parts, each lives in a separate repository, the first part is the `core` which contains the framework core packages. the second part is `gocondor` which has the project folder structure and responsible of gluing everything together.

To contribute you simply need to clone these two repositories locally and create new branches from the `develop` branch, add your changes, then open up a `PR` to the `develop` branch.

Here is how you can clone and set up the development workflow in your local machine:

1. Create the organization `gocondor` directory in your workspace, make sure the full path to it looks like below:
```bash
$GOPATH/src/ginthub.com/gocondor
```
2. clone the repository `core` inside the organization `gocondor` directory:
```bash
git clone git@github.com:gocondor/core.git
```
3. clone the repository `gocondor`:
```bash
git clone git@github.com:gocondor/gocondor.git
```
4. cd into the project `gocondor` and open up `go.mod` in your editor and add the line `github.com/gocondor/gocondor/core => [full-local-path-to-core]` to the `replace`statement, make sure it looks something like this:
```go
module github.com/gocondor/gocondor

replace (
 github.com/gocondor/core => C:/Users/myname/go/src/github.com/gocondor/core

 github.com/gocondor/gocondor/config => ./config
 github.com/gocondor/gocondor/http => ./http
 github.com/gocondor/gocondor/http/middlewares => ./http/middlewares
 github.com/gocondor/gocondor/handlers => ./http/handlers
 github.com/gocondor/gocondor/models => ./models
)
```
Note:
this is needed to tell go that instead of using the remote core package use the local copy where we will be making the changes, once you are done, open a `PR` to `develop` branch.

repository: PetengDedet/learn-gocondor

repo_name: PetengDedet/learn-gocondor


text:
### [CVE-2023-24610](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-24610)
![](https://img.shields.io/static/v1?label=Product&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Version&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Vulnerability&message=n%2Fa&color=brighgreen)

### Description

NOSH 4a5cfdb allows remote authenticated users to execute PHP arbitrary code via the "practice logo" upload feature. The client-side checks can be bypassed. This may allow attackers to steal Protected Health Information because the product is for health charting.

### POC

#### Reference
No PoCs from references.

#### Github
- https://github.com/abbisQQ/CVE-2023-24610
- https://github.com/hktalent/TOP
- https://github.com/manas3c/CVE-POC
- https://github.com/nomi-sec/PoC-in-GitHub

repository: trickest/cve

gha_language: HTML

repo_name: trickest/cve