text:
# API

A model layer for [hapi](https://hapi.dev) integrating [Objection ORM](https://vincit.github.io/objection.js/)

> **Note**
>
> Schwifty is intended for use with hapi v19+, nodejs v12+, Joi v17+, Objection v1 through v3, and knex v0.16+ (_see v5 for lower support_).

## The hapi plugin
### Registration
Schwifty may be registered multiple times—it should be registered in any plugin that would like to use any of its features.  Upon each registration these options are collected until server initialization.  Knex configurations passed during registration are attributed to the registering plugin/server under schwifty's [ownership system](#plugin-ownership-of-knex-instances-and-models).  Server initialization will fail if any knex instances handled by schwifty do not have basic database connectivity.

Schwifty takes the following registration options,

  - `knex` - a knex instance or [configuration](https://knexjs.org/#Installation-client).  It may only be specified once per plugin/server.
  - `migrationsDir` - specifies a directory of knex migrations.  The directory path may be either absolute, relative to the server's [path prefix](https://hapi.dev/api/#server.path()) when set, or otherwise relative to the current working directory.  It may only be specified once per plugin/server.
  - `migrateOnStart` - a boolean, `'latest'`, or `'rollback'`, to determine how to handle [knex migrations](https://knexjs.org/#Migrations) at server initialization time.  Defaults to `false`, which indicates to not handle migrations at all.  When `true` or `'latest'`, runs all migrations that have not been run.  When `'rollback'`, rolls-back the latest group of migrations.  It may only be specified once.
  - `teardownOnStop` - a boolean indicating whether or not all knex connections should be torn-down when the hapi server stops (after server connections are drained).  Defaults to `true`, and may only be specified once.

### Server decorations
#### `server.registerModel(models)`
Used to declare models on a per-plugin basis or on the root server.  In other words, these models are particular to the current plugin under schwifty's [ownership system](#plugin-ownership-of-knex-instances-and-models).

The `models` should be an objection or [schwifty model class](#schwiftymodel), or an array of such model classes to be associated with the current plugin or root server.  Note that this method protects from model `name` conflicts across the server.

#### `server.knex([namespace])`
Returns `server`'s knex instance.

Per schwifty's [plugin ownership of knex instances](#knex-instances), this is the knex instance provided by `server` or the nearest knex instance among `server`'s ancestors (e.g. if `server` is within a plugin that has been registered by a separate plugin that provides a knex instance) that is also not [sandboxed](#sandboxing).

By passing a `namespace` you can obtain knex instance from the perspective of a different plugin. When `namespace` is a string, you receive the knex instance that is visibile within the plugin named `namespace`. And when `namespace` is `true`, you receive the knex instance that is visible to the root server.

#### `server.models([namespace])`
Returns an object containing models keyed by their `name`.

Per schwifty's [plugin ownership of models](#models), the models that are available on this object are only those registered by `server` or any plugins for which `server` is an ancestor (e.g. if `server` has registered a plugin that registers models) that are also not [sandboxed](#sandboxing).

By passing a `namespace` you can obtain the models from the perspective of a different plugin. When `namespace` is a string, you receive models that are visibile within the plugin named `namespace`. And when `namespace` is `true`, you receive models that are visible to the root server: every model registered with the hapi server– across all plugins– that isn't sandboxed.

### Request decorations
#### `request.knex([namespace])`
Returns a knex instance.  See [`server.knex()`](#serverknexnamespace), where `server` is the one in which the `request`'s route was declared (i.e. based upon `request.route.realm`).

#### `request.models([all])`
Returns an object containing models keyed by their `name`.  See [`server.models()`](#servermodelsnamespace), where `server` is the one in which the `request`'s route was declared (i.e. based upon `request.route.realm`).

### Response toolkit decorations
#### `h.knex([namespace])`
Returns a knex instance.  See [`server.knex()`](#serverknexnamespace), where `server` is the one in which the corresponding route or server extension was declared (i.e. based upon `h.realm`).

#### `h.models([namespace])`
Returns an object containing models keyed by their `name`.  See [`server.models()`](#servermodelsnamespace), where `server` is the one in which the corresponding route or server extension was declared (i.e. based upon `h.realm`).

### Plugin ownership of knex instances and models
> How do plugins "own" knex instances and models?

Schwifty cares a whole lot about plugin boundaries.  Plugins represent the structure of your application, and we think that's not only practical but also very meaningful.  Under schwifty plugins declare knex instances and models, and actually retain _ownership_ of them in a useful way that respects your application's plugin boundaries.

#### Knex instances
Whenever a plugin or the root server configures a knex instance by [registering](#registration) schwifty and passing `knex`, an instance of knex is attributed to that plugin.  Consider `plugin-x` that declares a knex instance.  It becomes available by calling [`server.knex()`](#serverknexnamespace) within `plugin-x`, or [`request.knex()`](#requestknexnamespace) within one of `plugin-x`'s routes.  But it goes further!  This instance of knex is also available to all plugins _registered by_ `plugin-x` that do not have their own knex instances.

This allows us to handle very common use-cases, e.g. a single knex/database is configured on the root server: all other plugins using schwifty are registered under the root server and automatically inherit that database configuration.  But it also allows us to handle complex cases, e.g. multiple applications with their own knex/databases all being deployed together as separate plugins on a single hapi server.

#### Models
Whenever a plugin or the root server declares some models by calling [`server.registerModel()`](#serverregistermodelmodels), those models are attributed to that plugin.  Consider `plugin-x` registering plugin `plugin-a`, which declares the model `Pets`.  Inside `plugin-a` the `Pets` model is available by calling [`server.models()`](#servermodelsnamespace) within `plugin-a`, or [`request.models()`](#requestmodelsnamespace) within one of `plugin-a`'s routes.  But, just as with [knex instances](#knex-instances), it goes further!  `Pets` is also available to `plugin-x` since it registered `plugin-a`.  In fact, `Pets` is available to the entire plugin chain up to the root server.  In this way, the root server will have access to every model declared by any plugin (barring [sandboxing](#sandboxing)).

This allows us to handle very common use-cases, e.g. a plugin simply wants to declare and use some models.  But it also allows us to handle complex cases, e.g. authoring a plugin that declares some models that you would like to reuse across multiple applications.

Note that the [schmervice](https://github.com/hapipal/schmervice) plugin deals with plugin ownership of services in exactly the same way.

> As an escape hatch, you can always call [`server.models(true)`](#servermodelsnamespace) (passing `true` to any of the server, request, or response toolkit's `models()` decoration) to break the plugin boundary and access models declared by any plugin on the entire server.  You may similarly pass a plugin name in order to access models from the perspective of that specific plugin, e.g. `server.models('my-plugin')`.

#### Sandboxing
When a model or knex instance is "sandboxed", it is only visible within the plugin that directly provides it.  This is a form of opting-out of transitive ownership of models and knex instances described in the previous two sections.  However, sandboxed models and knex instances can still be accessed from other plugins using the `namespace` parameter as described in [`server.models([namespace])`](#servermodelsnamespace) and [`server.knex([namespace])`](#serverknexnamespace)

In order to sandbox a model, set the [`Schwifty.sandbox`](#schwiftysandbox) property to `true` on it statically (you may also use a getter):

```js
class User extends Schwifty.Model {
    static tableName = 'Users';
    static [Schwifty.sandbox] = true;
};
```

Similarly, in order to sandbox a knex instance, set its [`Schwifty.sandbox`](#schwiftysandbox) property to `true`:

```js
const knex = Knex({ client: 'sqlite3' });
knex[Schwifty.sandbox] = true;
```

> In order to make ensure that this property doesn't conflict with Objection or Knex internals, `Schwifty.sandbox` is a symbol.

#### An example
Consider two plugins, `plugin-a` and `plugin-b`,

- the root server registers `plugin-a`.
- `plugin-a` registers `plugin-b`.
- `plugin-a` declares a knex instance by registering schwifty and the model `Dogs` using `server.registerModel()`.
- `plugin-b` declares the model `Zombies` using `server.registerModel()` and does not declare a knex instance.

Then we can say the following,

- The root server will have access to both `Dogs` and `Zombies` models, having inherited both of them from its "children" plugins.
- The root server has no knex instance of its own.
- `plugin-a` will have access to both `Dogs` and `Zombies` models, having inherited `Zombies` from `plugin-b`.
- `plugin-b` will have access to only the `Zombies` model.
- Both `Dogs` and `Zombies` models will be bound to `plugin-a`'s knex instance. `Zombies` is bound to that instance because `plugin-b` inherits its knex instance from its nearest "ancestor" with a knex instance, `plugin-a`.

### What happens during server initialization?
Schwifty performs a few important routines during server initialization.

#### Binding models to knex
First, models are bound to instances of knex on a per-plugin basis.  Each model is bound to the knex instance of the plugin—under [plugin ownership of knex instances](#knex-instances)—in which the model was defined.  If a model already is bound to a knex instance prior to initialization, it will not be bound to a new one.  Additionally, if a model's [`Schwifty.bindKnex`](#schwiftybindknex) property is `false` then it will not be bound.

This means that prior to server initialization, calls to [`server.models()`](#servermodelsnamespace) will provide models that will not be bound to a knex instance (unless you've done so manually).  If you would like to perform some tasks during server initialization that rely on database-connected models, simply tell your `onPreStart` server extension to occur after schwifty, e.g.,
```js
server.ext('onPreStart', someDbConnectedTask, { after: 'schwifty' });
```

You could also do this by treating schwifty as a plugin dependency,
```js
server.dependency('schwifty', someDbConnectedTask);
```

#### Database connectivity
Second, every knex instance declared during [plugin registration](#registration) is checked for connectivity.  If any instance of knex does not have database connectivity, you will receive an error and your server will not initialize.  While this does not make any guarantees about table existence or structure, it does guarantee database connectivity at server initialization time.

#### Migrations
Lastly, if you specified `migrateOnStart` as `true`, `'latest'`, or `'rollback'`, then migrations will be run against each knex instance.  Your instance of knex may specify its own [knex migration options](https://knexjs.org/#Migrations-API), except for `directory`, which will be ignored in favor of the migration directories declared using the `migrationsDir` [plugin registration](#registration) option.

If a knex instance is shared across plugins (under [plugin ownership of knex instances](#knex-instances)) and each plugin specifies its own migrations directory using `migrationsDir`, then migrations from each of those plugin's migrations directories will simply be run against the knex instance.  In short, schwifty pluginizes knex migrations.

The `migrateOnStart` options `true` and `'latest'` correspond to [`knex.migrate.latest()`](https://knexjs.org/#Migrations-latest), while `'rollback'` corresponds to [`knex.migrate.rollback()`](https://knexjs.org/#Migrations-rollback).

## `Schwifty.Model`
Schwifty's model class extends [`Objection.Model`](https://vincit.github.io/objection.js/api/model/), adding support for [Joi](https://joi.dev/) schemas wherever objection's base model class employs [`jsonSchema`](https://vincit.github.io/objection.js/api/model/static-properties.html#static-jsonschema).  This primarily plays into model instance validation and serialization of JSON/array fields.

### `joiSchema`
An optional [`Joi.object()`](https://joi.dev/api/#object) schema, where each of its keys is a field of the given model.

### `joiSchemaPatch`
This property is computed as a getter using the contents of `joiSchema`.  It is identical to `joiSchema`, except it ignores default values and missing required fields.  Objection additionally validates `Model.query().patch()` query input against this schema.

### `jsonAttributes`
This property is computed as a getter using the contents of `joiSchema`.  Any of the schema's keys that are [`Joi.object()`](https://joi.dev/api/#object)s or [`Joi.array()`](https://joi.dev/api/#array)s will be included in the list of JSON attributes.  If this property is set, it will forget about having been computed.  For more info, see objection's [`jsonAttributes`](https://vincit.github.io/objection.js/api/model/static-properties.html#static-jsonattributes).

### `field(name)`
Returns the schema for the field named `name` on the model's [`joiSchema`](#joischema), but marked as optional and ignoring defaults.  The schema also has two [alterations](https://joi.dev/api/#anyaltertargets): one named `'full'` which respects defaults and required/optional/forbidden status, and another named `'patch'` which does nothing but exists to allow for explicitness.

```js
const User = class User extends Schwifty.Model {
    static joiSchema = Joi.object({
        username: Joi.string().min(4).required()
    });
};

// no alteration
User.field('username').validate();        // { value: undefined }
User.field('username').validate('pal');   // { error }, as username must be at least 4 characters
User.field('username').validate('paldo'); // { value: 'paldo' }

// "patch" alteration: identical to the above
User.field('username').tailor('patch').validate();
User.field('username').tailor('patch').validate('pal');
User.field('username').tailor('patch').validate('paldo');

// "full" alteration
User.field('username').tailor('full').validate();         // { error }, as username is required
User.field('username').tailor('full').validate('pal');    // { error }, as username must be at least 4 characters
User.field('username').tailor('full').validate('paldo');  // { value: 'paldo' }
```

### `model.$validate()`
Validates the model instance using its [`joiSchema`](#joischema).  This is implemented using objection's [`Validator`](https://vincit.github.io/objection.js/api/types/#class-validator) interface.

## Utilities and Symbols

### `Schwifty.assertCompatible(ModelA, ModelB, [message])`
Ensures that `ModelA` and `ModelB` have the same class `name`, share the same `tableName`, and that one model extends the other, otherwise throws an error.  When `message` is provided, it will be used as the message for any thrown error.

### `Schwifty.migrationsStubPath`
A path to a knex migrations stub file that utilizes async/await and is set to follow the hapi style guide.  This is intended to be used with [knexfile](https://knexjs.org/#knexfile) configurations (as of knex v0.18.4) and the [`knex migrate:make`](https://knexjs.org/#Migrations-CLI) command:

```js
// knexfile.js
const Schwifty = require('@hapipal/schwifty');

module.exports = {
    client: 'pg',
    migrations: {
        stub: Schwifty.migrationsStubPath
    }
};
```

### `Schwifty.sandbox`

A symbol that may be added as a property to a knex instance or a model in order to participate in [sandboxing](#sandboxing).

Sandboxing ensures that the object in question opts out of transitive ownership as described in ["Plugin ownership of knex instances and models"](#plugin-ownership-of-knex-instances-and-models), and in turn is only visible within the plugin where it is provided.

When this property is set to `true` or `'plugin'` the object will be sandboxed. The default behavior of plugin ownership can be explicitly configured using the value `false` or `'server'`.

### `Schwifty.bindKnex`

A symbol that may be added as a property to a model in order to opt-out of [knex-binding during server initialization](#binding-models-to-knex).  When this property is set to `false`, a knex instance will not automatically be bound to the model.

repository: hapipal/schwifty

repo_name: hapipal/schwifty


text:
---
layout: post
title: Launching Backdoor
excerpt: SDSLabs launches backdoor
author:
  name: Dhaval Kapil
  link: http://dhavalkapil.com
  bio: Developer, SDSLabs
  twitter: dhaval_kapil
  image: vampire.jpg
---

[Backdoor](https://backdoor.sdslabs.co.in/ "Backdoor") is a platform for the hackers out there to showcase their talent in a competitive environment. Currently it has been launched only within the IIT Roorkee campus.

> It is a Capture the Flag styled event. A flag (basically a string) is associated with every challenge. Once you have solved a particular challenge you would get the hidden flag which you need to submit back to us for getting points.

## History

In March 2013, SDSLabs organized the first ever Capture the Flag event by IIT Roorkee under the banner of Cognizance, the technical festival of IIT Roorkee. 80 teams participated in it from all over the world with Team [dcua](https://ctftime.org/team/762 "Team dcua")(currently ranked 9 at [ctftime](https://ctftime.org/ "ctftime") winning it.

Encouraged by its success, SDSLabs was back with BackdoorCTF '14 the next year during Cognizance. We had a participation of whopping 460 teams from 68 different countries.

Inspired by all this, we decided to develop Backdoor not only as an annual CTF, but as an application that consists of challenges available for the user anytime of the year, more like a continuous learning environment, a cyber security playground. Apart from this, we shall be hosting competitions frequently.

> ### Challenges

The challenges in Backdoor will range from web, security, network, binary, crypto, etc. Each of these will have a score associated with them. We have tried to simulate real world applications so as to give a hands-on experience. To solve these challenges you would need to exploit some vulnerability.

## Practice Arena

Backdoor has a Practice Arena where users can test their skills by solving various challenges. Each challenge will be tagged for easier accessibility. Users will be ranked based on their scores.

![PracticeArena](/images/posts/launching-backdoor/practice-arena.png)

![User](/images/posts/launching-backdoor/user.png)

## Competitions

This is where we would be hosting our competitions. There will be team participation as is the case with many other CTFs. Each competition will be open for a particular amount of time only and there will be a separate leaderboard for each one. Challenges will be shifted to Practice Arena soon after the competition ends.

![Competitions](/images/posts/launching-backdoor/competitions.png)

## Technical details

1. The challenges are hosted on a different server so that the main Backdoor platform is free from any exploits.
2. We even have a different domain for the challenges so as to prevent an `XSS` vulnerability in one of the challenges leading to the hijacking of the SDSLabs account of the user.
3. Backdoor's backend is written in `PHP` using `Toro` as the framework.
4. All the services on the server are running in a `chroot` jail thereby preventing access to the parent directory and files.

license: MIT

branch_name: refs/heads/master

extension: md

gha_language: SCSS

gha_license_id: MIT

license_type: permissive


text:
About extra-cmake-modules-feedstock
===================================

Feedstock license: [BSD-3-Clause](https://github.com/conda-forge/extra-cmake-modules-feedstock/blob/main/LICENSE.txt)

Home: https://api.kde.org/frameworks/extra-cmake-modules/html/index.html

Package license: BSD-3-Clause

Summary: The Extra CMake Modules package, or ECM, adds to the modules provided by CMake.

Development: https://cgit.kde.org/extra-cmake-modules.git

Documentation: https://api.kde.org/ecm/manual/ecm.7.html

The Extra CMake Modules package, or ECM, adds to the modules provided by CMake,
including ones used by find_package() to find common software, ones that can be
used directly in CMakeLists.txt files to perform common tasks and toolchain files
that must be specified on the commandline by the user.

In addition, it provides common build settings used in software produced by the KDE community.

While the driving force of this module is to reduce duplication in CMake scripts
across KDE software, it is intended to be useful for any software that uses the
CMake build system.

Current build status
====================

    Azure

Variant	Status

              linux_64

Current release info
====================

| Name | Downloads | Version | Platforms |
| --- | --- | --- | --- |
| [![Conda Recipe](https://img.shields.io/badge/recipe-extra--cmake--modules-green.svg)](https://anaconda.org/conda-forge/extra-cmake-modules) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/extra-cmake-modules.svg)](https://anaconda.org/conda-forge/extra-cmake-modules) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/extra-cmake-modules.svg)](https://anaconda.org/conda-forge/extra-cmake-modules) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/extra-cmake-modules.svg)](https://anaconda.org/conda-forge/extra-cmake-modules) |

Installing extra-cmake-modules
==============================

Installing `extra-cmake-modules` from the `conda-forge` channel can be achieved by adding `conda-forge` to your channels with:

```
conda config --add channels conda-forge
conda config --set channel_priority strict
```

Once the `conda-forge` channel has been enabled, `extra-cmake-modules` can be installed with `conda`:

```
conda install extra-cmake-modules
```

or with `mamba`:

```
mamba install extra-cmake-modules
```

It is possible to list all of the versions of `extra-cmake-modules` available on your platform with `conda`:

```
conda search extra-cmake-modules --channel conda-forge
```

or with `mamba`:

```
mamba search extra-cmake-modules --channel conda-forge
```

Alternatively, `mamba repoquery` may provide more information:

```
# Search all versions available on your platform:
mamba repoquery search extra-cmake-modules --channel conda-forge

# List packages depending on `extra-cmake-modules`:
mamba repoquery whoneeds extra-cmake-modules --channel conda-forge

# List dependencies of `extra-cmake-modules`:
mamba repoquery depends extra-cmake-modules --channel conda-forge
```

About conda-forge
=================

[![Powered by
NumFOCUS](https://img.shields.io/badge/powered%20by-NumFOCUS-orange.svg?style=flat&colorA=E1523D&colorB=007D8A)](https://numfocus.org)

conda-forge is a community-led conda channel of installable packages.
In order to provide high-quality builds, the process has been automated into the
conda-forge GitHub organization. The conda-forge organization contains one repository
for each of the installable packages. Such a repository is known as a *feedstock*.

A feedstock is made up of a conda recipe (the instructions on what and how to build
the package) and the necessary configurations for automatic building using freely
available continuous integration services. Thanks to the awesome service provided by
[Azure](https://azure.microsoft.com/en-us/services/devops/), [GitHub](https://github.com/),
[CircleCI](https://circleci.com/), [AppVeyor](https://www.appveyor.com/),
[Drone](https://cloud.drone.io/welcome), and [TravisCI](https://travis-ci.com/)
it is possible to build and upload installable packages to the
[conda-forge](https://anaconda.org/conda-forge) [Anaconda-Cloud](https://anaconda.org/)
channel for Linux, Windows and OSX respectively.

To manage the continuous integration and simplify feedstock maintenance
[conda-smithy](https://github.com/conda-forge/conda-smithy) has been developed.
Using the ``conda-forge.yml`` within this repository, it is possible to re-render all of
this feedstock's supporting files (e.g. the CI configuration files) with ``conda smithy rerender``.

For more information please check the [conda-forge documentation](https://conda-forge.org/docs/).

Terminology
===========

**feedstock** - the conda recipe (raw material), supporting scripts and CI configuration.

**conda-smithy** - the tool which helps orchestrate the feedstock.
                   Its primary use is in the construction of the CI ``.yml`` files
                   and simplify the management of *many* feedstocks.

**conda-forge** - the place where the feedstock and smithy live and work to
                  produce the finished article (built conda distributions)

Updating extra-cmake-modules-feedstock
======================================

If you would like to improve the extra-cmake-modules recipe or build a new
package version, please fork this repository and submit a PR. Upon submission,
your changes will be run on the appropriate platforms to give the reviewer an
opportunity to confirm that the changes result in a successful build. Once
merged, the recipe will be re-built and uploaded automatically to the
`conda-forge` channel, whereupon the built conda packages will be available for
everybody to install and use from the `conda-forge` channel.
Note that all branches in the conda-forge/extra-cmake-modules-feedstock are
immediately built and any created packages are uploaded, so PRs should be based
on branches in forks and branches in the main repository should only be used to
build distinct package versions.

In order to produce a uniquely identifiable distribution:
 * If the version of a package **is not** being increased, please add or increase
   the [``build/number``](https://docs.conda.io/projects/conda-build/en/latest/resources/define-metadata.html#build-number-and-string).
 * If the version of a package **is** being increased, please remember to return
   the [``build/number``](https://docs.conda.io/projects/conda-build/en/latest/resources/define-metadata.html#build-number-and-string)
   back to 0.

Feedstock Maintainers
=====================

* [@scopatz](https://github.com/scopatz/)
* [@zklaus](https://github.com/zklaus/)

branch_name: refs/heads/main

gha_language: Shell


text:
Default
                 BlackDeck.json.

  [-hs int]      Number of Cards a player starts with in their hands. Default 5.

  [-mp int]      Max points a player reaches to win. Default 7.

  [-np int]      Number of players in this game. Default 3.

  [-p int]       Source port to listen on. Default 8080.

  [-wd string]   Filename containing white deck representation. Default
                 WhiteDeck.json.

  [-build-info]  print info about this build and exit

  [-version]     print the version of this build and exit

  [-help]        print this help text and exit

For example, to play with 5 players run:

./Host.native -np 5

All other players: run make play, type in the (IP address:port) of the host,
and your name to connect

Requires cohttp and async


text:
# ARCHIVED - homebrew-folderify
This formula can now be found in homebrew/core

To install:
```
brew install folderify
```

repository: harens/homebrew-folderify

repo_name: harens/homebrew-folderify


text:
AdaptiveBoosting_Machine_Learning
=================================
# _Binary and Real Adaptive Boosting Algorithms_

_Description: Adaptive boosting(AdaBoost) algorithms are used by many other machine learning algorithms to improve their performance. Algorithm combines several weak hypothesis to create stronger hypothesis among them. I have implemented java program for binary and real adaptive boosting algorithms. You can know more about adaptive boosting at:http://en.wikipedia.org/wiki/AdaBoost#Overview_

## Project Setup

_How do I, as a developer, start working on the project?_

1. _What dependencies does it have (where are they expressed) and how do I install them?_
A. _It doesn't have any dependencies.
2. _How can I see the project working before I change anything?_
A. _Just run run the code in Eclipse.

## Deploying

### _How to setup the deployment environment_

- _Required Eclipse with jdk 1.6 or higher_

### _What is input and output files for project?_

- _Input is text file. Sample dataset is attached in project_

- _First element of first line is number of iterations for program_

- _Second element of first line is number of elements._

- _Third element of first line is Ebsilon value_

- _Second, Third and fourth lines are element names,associated values and probability of each elements. _

- _Output is boosted hypothesis._

## Contributing changes

- _Email<EMAIL_ADDRESS>- _"Please open github issues, emails can get messy"_

## License
MIT License


text:
# YouTube Playlist Downloader BOT
Using python, we can create a bot that accesses a video playlist on youtube and downloads it locally. It's a basic web-scrapping example using Selenium and Python3.

## Bash commands to build this app
```python3 -m pip install selenium
```

## Robotics Process Automation (RPA)
Defined as an automatized script that executes multiples activities as a human would do.

### Features
- Automates repetitive and rule-based processes
- Interacts with apps and systems as humans
- Boosts productivity in repetitive tasks


text:
Patience
========

Patience is a lightweight javascript tool that allows you to wait for various conditions to be met, before doing something else.

----

Patience was originally created as a test helper, but can surely be used for other things. In any test scenario, you want to keep your test code out of your production code. With javascript, it's really easy to be intrusive. Patience avoids being intrusive, and lets you test asynchronous computation without latching into any of the code running it.

Patience has many similarities to some of the helper methods from [Casper JS](http://casperjs.org/) and uses native Promises (in browser land) that makes the syntax very easy to read and use. If you are not familiar with browser Promises, check out [mozilla's explanation here](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).

Last but not least, some of the syntax was influenced by Pivotal's test framework [Jasmine JS](http://jasmine.github.io/)

#Usage
###Core Functionality
Let us say that you have a calorie counting app, and when you load the page a global value `calories` starts incrementing. We can use patience to wait for that value to reach 500 or above, and then alert something on screen.

```javascript
var isFull = function() {
   return calories > 500;
};
Patience.waitFor(isFull).toBe(true).then(function() {
   // This is your success callback
   alert('Ate more than 500 calories');
}, function() {
   // This is your fail callback, which happens when Patience times out
   alert('Never quite got to 500...');
});
```
###jQuery Built Ins
Patience also works great with jQuery selectors, and is incredibly useful for testing the DOM. Some great examples are, waiting for animations to finish, waiting for long computations, or asynch API calls to finish *without hooking into production code*. No mocks, no manipulation, just waiting patiently in test code land.

With that being said, let us say that our calorie counting app pops up a monster when the calorie count gets to 500.

```javascript
Patience.waitForSelector('#calorie-monster').toBe.visible().then(function(){
    alert('Calorie monster popped up!');
 }, function() {
    alert('Calorie monster never popped up..');
 });
```
Patience comes with three built-in selector checks

* `Patience.waitForSelector(<jquery selector>).toBe.visible()`
* `Patience.waitForSelector(<jquery selector>).toBe.hidden()`
* `Patience.waitForSelector(<jquery selector>).toBe.present()`

#Customization
Patience will time out a call based on the default timeout, or the timeout specified. Each call to .waitFor and .waitForSelector accepts a second argument that can override the default timeout (milliseconds). If you want to change the default, or the interval in which Patience checks conditions, use the following methods:

* `Patience.setDefaultTimeout(10000) // 10 seconds`
* `Patience.setDefaultInterval(100) // 10 times a second`

#Demo

Check out [Patience in action!](http://skiggz.github.io/patience/)

#jQuery
Currently Patience requires jQuery for use of the built in helpers. However, Patience will still work without it. I may move this complely away from jQuery in the future, but do not have plans to as of now. **The core funcitonality does not require jQuery**.

#Installation
If you want to use the built-ins, include jQuery first, then patience. Otherwise, you just need `patience.js`.
```html
<script type="text/javascript" src="patience.js"></script>
```

#Tests
Tests are all written using jasmine. To run them, navigate your browser to both `test/patience.html` and `test/patience-jquery.html`.

#Contact

As always, if you find issues with anything I've shared on github, open a ticket in github tracker or submit a pull request! Features or bugs! Thanks!

repository: Skiggz/patience

repo_name: Skiggz/patience


text:
[![license](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat)](https://github.com/m-peko/booleval/blob/master/LICENSE)
[![Build Status](https://app.travis-ci.com/m-peko/booleval.svg?branch=master)](https://travis-ci.org/m-peko/booleval)
[![codecov](https://codecov.io/gh/m-peko/booleval/branch/master/graph/badge.svg)](https://codecov.io/gh/m-peko/booleval)
[![Standard](https://img.shields.io/badge/C%2B%2B-17-blue.svg)](https://en.wikipedia.org/wiki/C%2B%2B17)

Header-only C++17 library for evaluating logical expressions.

The library is under development and subject to change. Contributions are welcome. You can also log an issue if you have a wish for enhancement or if you spot a bug.

## Quick start

```cpp
#include <string>
#include <iostream>
#include <booleval/evaluator.hpp>

class foo
{
public:
    foo( std::string value ) noexcept : value_{ std::move( value ) } {}

    std::string const & value() const noexcept { return value_; }

private:
    std::string value_{};
};

int main()
{
    foo x{ "foo" };
    foo y{ "bar" };

    booleval::evaluator evaluator
    {
        booleval::make_field( "field", &foo::value )
    };

    if ( !evaluator.expression( "field eq foo" ) )
    {
        std::cerr << "Expression not valid!" << std::endl;
    }

    if ( evaluator.is_activated() )
    {
        std::cout << std::boolalpha << evaluator.evaluate( x ) << std::endl; // true
        std::cout << std::boolalpha << evaluator.evaluate( y ) << std::endl; // false
    }

    return 0;
}
```

## Table of Contents

* [Motivation](#motivation)
* [Getting Started](#getting-started)
    * [Zero Copy](#zero-copy)
    * [EQUAL TO Operator](#equal-to-operator)
    * [Valid Expressions](#valid-expressions)
    * [Invalid Expressions](#invalid-expressions)
    * [Evaluation Result](#evaluation-result)
    * [Supported Tokens](#supported-tokens)
* [Benchmark](#benchmark)
* [Compilation](#compilation)
* [Tests](#tests)
* [Compiler Compatibility](#compiler-compatibility)
* [Contributing](#contributing)
* [License](#license)
* [Support](#support)

## Motivation

`booleval` is a header-only C++17 library for evaluating logical expressions. It implements recursive descent parser mechanism for building an expression tree for a user-defined logical expression. After the expression tree is being built, map of fields and values representing a certain object can be passed to the `evaluator` component of this library which will evaluate those values to `true` or `false` according to the user-defined logical expression.

In programming languages like Java and C# accessing arbitrary fields inside a class represents an omnipresent problem. However, it got solved by introducing a **reflections** feature. This feature provides us information about the class to which a certain object belongs to and, also, the methods of that class which we can invoke at runtime.

Since the reflection feature is missing in C++, `booleval` library is implemented. It checks whether the members of a class to which an object belongs to have certain values. Members of a class are specified in a string format and can be used to form a logical expression.

 E.g. [`tcpdump`](https://www.tcpdump.org/manpages/tcpdump.1.html) and [BPF](https://en.wikipedia.org/wiki/Berkeley_Packet_Filter) (Berkeley Packet Filter), network tools available on most UNIX-like operating systems, have pretty much the same syntax for their filter expression.

## Getting Started

`booleval` is a header-only C++17 library for evaluating logical expressions.

### Zero Copy

In order to improve performance, `booleval` library does not copy objects that are being evaluated.

### EQUAL TO operator

EQUAL TO operator is an optional operator. Therefore, logical expression that checks whether a field with the name `field_a` has a value of `foo` can be constructed in a two different ways:

- EQUAL TO operator is specified in the expression: `field_a eq foo`
- EQUAL TO operator is **not** specified in the expression: `field_a foo`

To conclude, equality operator is a default operator between two fields. Thus, it **does not need** to be specified in the logical expression.

### Valid expressions

- `(field_a foo and field_b bar) or field_a bar`
- `(field_a eq foo and field_b eq bar) or field_a eq bar`

### Invalid expressions

- `(field_a foo and field_b bar` _Note: Missing closing parentheses_
- `field_a foo bar` _Note: Two field values in a row_

### Evaluation Result

Result of evaluation process contains two information:

- `success`: `true` if evaluation process is successful; otherwise, `false`
- `message`: meaningful message if evaluation process is unsuccessful; otherwise, empty message

This kind of enriched lightweight result is being used instead of exceptions for performance reasons.

Examples of messages:

- `"Missing operand"`
- `"Unknown field"`
- `"Unknown token type"`

### Supported tokens

|Name|Keyword|Symbol|
|:---:|:---:|:---:|
|AND operator|AND / and|&&|
|OR operator|OR / or|\| \||
|EQUAL TO operator|EQ / eq|==|
|NOT EQUAL TO operator|NEQ / neq|!=|
|GREATER THAN operator|GT / gt|>|
|LESS THAN operator|LT / lt|<|
|GREATER THAN OR EQUAL TO operator|GEQ / geq|>=|
|LESS THAN OR EQUAL TO operator|LEQ / leq|<=|
|LEFT parentheses|∅|(|
|RIGHT parentheses|∅|)|

## Benchmark

Following table shows benchmark results:

|Benchmark|Time|Iterations
|:---:|:---:|:---:|
|Building expression tree|3817 ns|180904|
|Evaluation|1285 ns|532522|

In other words, it is possible to evaluate **2,413,045.84 objects per second**.

## Compilation

In order to compile the library, run the following commands:

```Shell
$ # create the build directory
$ mkdir build
$ cd build

$ # configure the project
$ cmake ../

$ # compile
$ make
```

## Tests

In order to run unit tests, run the following commands:

```Shell
$ # fetch the googletest submodule, needed for tests
$ git submodule init
$ git submodule update

$ mkdir build
$ cd build

$ # configure the project
$ cmake ..

$ # compile tests
$ make tests

$ # run tests
$ make test
```

## Compiler Compatibility

* Clang/LLVM >= 7
* MSVC++ >= 19.16
* GCC >= 8.4

There are no 3rd party dependencies.

## Contributing

Feel free to contribute.

If you find that any of the tests **fail**, please create a ticket in the issue tracker indicating the following information:

* platform
* architecture
* library version
* minimal reproducible example

## License

The project is available under the [MIT](https://opensource.org/licenses/MIT) license.

## Support

If you like the work `booleval` library is doing, please consider supporting it:

repository: m-peko/booleval

repo_name: m-peko/booleval


text:
# python-aio-geojson-nsw-transport-incidents

[![Build Status](https://travis-ci.org/Fred-Ch/python-aio-geojson-nsw-transport-incidents-master.svg)](https://travis-ci.org/Fred-Ch/python-aio-geojson-nsw-transport-incidents-master)
[![PyPi](https://img.shields.io/pypi/v/aio-geojson-nsw-transport-incidents.svg)](https://pypi.python.org/pypi/aio-geojson-nsw-transport-incidents)
[![Version](https://img.shields.io/pypi/pyversions/aio-geojson-nsw-transport-incidents.svg)](https://pypi.python.org/pypi/aio-geojson-nsw-transport-incidents)

This library provides convenient async access to the [NSW Transport Service Live traffic status](https://opendata.transport.nsw.gov.au/dataset/live-traffic-site-status) incidents feed.
The feed can be seen online on (https://www.livetraffic.com/)

## Installation
`pip install aio-geojson-nsw-transport-incidents`

## Usage
See below for examples of how this library can be used. After instantiating a
particular class - feed or feed manager - and supply the required parameters,
you can call `update` to retrieve the feed data. The return value
will be a tuple of a status code and the actual data in the form of a list of
feed entries specific to the selected feed.

Status Codes
* _OK_: Update went fine and data was retrieved. The library may still
  return empty data, for example because no entries fulfilled the filter
  criteria.
* _OK_NO_DATA_: Update went fine but no data was retrieved, for example
  because the server indicated that there was not update since the last request.
* _ERROR_: Something went wrong during the update

**Parameters**

| Parameter          | Description                               |
|--------------------|-------------------------------------------|
| `home_coordinates` | Coordinates (tuple of latitude/longitude) |
| `feature`          | Type of Hazard to retreive                |

Traffic Hazards are divided into six basic types:
* Incidents (`incident-open` `incident-closed` `incident`)
* Fire  (`fire-open` `fire-closed` `fire`)
* Flood (`flood-open` `flood-closed` `flood`)
* Alpine conditions (`alpine-open` `alpine-closed` `alpine`)
* Major Events (`majorevent-open` `majorevent-closed` `majorevent`)
* Roadworks (`roadwork-open` `roadwork-closed` `roadwork`)

Hazards can be open, closed (or both can be retreived). Refer to the [Live Traffic Data Developer Guide](https://opendata.transport.nsw.gov.au/sites/default/files/Live_Traffic_Data_Developer_Guide.pdf)

**Supported Filters**

| Filter     |                     | Description |
|------------|---------------------|-------------|
| Radius     | `filter_radius`     | Radius in kilometers around the home coordinates in which events from feed are included. |
| Categories | `filter_categories` | Array of category names. Only events with a category matching any of these is included. |

**Example**
```python
import asyncio
from aiohttp import ClientSession
from aio_geojson_nsw_transport_incidents import NswTransportServiceIncidentsFeed
async def main() -> None:
    async with ClientSession() as websession:
        # Home Coordinates: Latitude: -33.0, Longitude: 150.0
        # Filter radius: 50 km
        # Filter categories: 'Scheduled roadwork'
        # Hazard type : 'roadworks-open'
        feed = NswTransportServiceIncidentsFeed(websession,
                                                (-33.0, 150.0),
                                                filter_radius=50,
                                                filter_categories=['Scheduled roadwork'],
                                                hazard="roadwork-open")
        status, entries = await feed.update()
        print(status)
        print(entries)
asyncio.get_event_loop().run_until_complete(main())
```

## Feed entry properties
Each feed entry is populated with the following properties:

| Name               | Description                                                                                | Feed attribute |
|--------------------|-----------------------------------------------------------------------------------------------------|----------------|
| geometry           | All geometry details of this entry.                                                                 | `geometry`     |
| coordinates        | Best coordinates (latitude, longitude) of this entry.                                               | `geometry`     |
| external_id        | The unique public identifier for this incident.                                                     | `guid`         |
| title              | Title of this entry.                                                                                | `title`        |
| attribution        | Attribution of the feed.                                                                            | n/a            |
| distance_to_home   | Distance in km of this entry to the home coordinates.                                               | n/a            |
| category           | The broad hazard category description assigned to the hazard by TMC Communications. Used internally by TMCCommunications for reporting hazard statistics.Please note the values used by this property are subject to change and should not be relied upon.                                 | `mainCategory`     |
| publication_date   | The publication date of the incidents.                                                              | `created`      |
| description        | The description of the incident.                                                                    | `headline`  |
| council_area       | Council are this incident falls into.                                                               | `roads` -> `suburb`        |
| road               | Council are this incident falls into.                                                               | `roads` -> `mainStreet`        |
| type               | Type of the incident (e.g. Bush Fire, Grass Fire, Hazard Reduction).                                | `type`         |
| publicTransport    | The publication date of this entry                                                                  | `publicTransport`        |
| adviceA            | The first advice of this entry. The first standard piece of advice to motorists. At the present time | `adviceA`       |
| adviceB            | Turn the second advice of this entry                                                                | `adviceB`        |
| adviceOther        | The other advice of this entry                                                                      | `adviceOther`        |
| isMajor            | True is the incident is major for this entry                                                        | `isMajor`        |
| isEnded            | True if the hazard has ended, otherwise false. Once ended, the hazard’s record in our internal tracking system is closed and further modification becomes impossible unless the record is later re-opened. This  property is a counterpart to the createdproperty. When true, the  lastUpdatedproperty of the hazard will be the date/time when  the hazard’s record  in the tracking system was closed.                                                                    | `isEnded`        |
| isNew              | True if the incident is new for this entry.                                                         | `isNew`        |
| isImpactNetwork    | True if the hazard is currently having some impact on traffic on the road network.                  | `isImpactNetwork`        |
| diversions         | The Summary of any traffic diversions in place. The text may contain HTML markup..                  | `diversions`        |
| subCategory        | The sub-category of incident of this entry.                                                         | `subCategory`        |
| duration           | The Planned duration of the hazard. This property is rarely used.                                   | `duration`        |

## Feed Manager

The Feed Manager helps managing feed updates over time, by notifying the
consumer of the feed about new feed entries, updates and removed entries
compared to the last feed update.

* If the current feed update is the first one, then all feed entries will be
  reported as new. The feed manager will keep track of all feed entries'
  external IDs that it has successfully processed.
* If the current feed update is not the first one, then the feed manager will
  produce three sets:
  * Feed entries that were not in the previous feed update but are in the
    current feed update will be reported as new.
  * Feed entries that were in the previous feed update and are still in the
    current feed update will be reported as to be updated.
  * Feed entries that were in the previous feed update but are not in the
    current feed update will be reported to be removed.
* If the current update fails, then all feed entries processed in the previous
  feed update will be reported to be removed.

After a successful update from the feed, the feed manager provides two
different dates:

* `last_update` will be the timestamp of the last update from the feed
  irrespective of whether it was successful or not.
* `last_update_successful` will be the timestamp of the last successful update
  from the feed. This date may be useful if the consumer of this library wants
  to treat intermittent errors from feed updates differently.
* `last_timestamp` (optional, depends on the feed data) will be the latest
  timestamp extracted from the feed data.
  This requires that the underlying feed data actually contains a suitable
  date. This date may be useful if the consumer of this library wants to
  process feed entries differently if they haven't actually been updated.

## Attribution and motivation
This is a fork of [exxamalte/python-aio-geojson-nsw-rfs-incidents](https://github.com/exxamalte/python-aio-geojson-nsw-rfs-incidents).
It deferes mainly as the geoJSON feeds generated by NSW Transport using QGis.  QGis generates files that don't match exactly geojson format (geometry types : `POINT` instead of `Point`)

This library has been created for [Home Assistant component](https://github.com/Fred-Ch/core/tree/dev/homeassistant/components/nsw_transport_incident_service_feed).


text:
# U-Connect <img src="https://img.shields.io/badge/LICENSE-mit-green"/>

## Description:

This Employee Directory is a react app that loads in a random set of 20 users from the random user generator api, and populates a table with the most relevant user data. Some notable features of this app include sorting all columns in ascending and descending order by clicking on the col title,
and dynamically filtering all employees over 65 years of age as per the user's indication.

## Screenshot of App:

![Employee Directory](./public/Employee.png)

## Technology Used:

- HTML
- CSS
- Bootstrap
- Node JS
- react
- Heroku

## Contributors:

- [James Totah ](https://github.com/jtwob)

## Links

- [Live App](https://react-employee-tracker-jtwob.herokuapp.com/)
- [Github Repo](https://github.com/jtwob/React-Employee-Directory)

repository: jtwob/React-Employee-Directory

repo_name: jtwob/React-Employee-Directory


text:
# Mastery Exercises (required)

## jQuery

1. Chatty Revisited - Create your own branch from your group project and use jQuery for all XHRs, DOM querying & manipulation, and CSS manipulation.
1. [Music History 5](MJ_JQUERY_MUSIC_HISTORY_5.md)

## Browserify

1. [Music History 6](MJ_BROWSERIFY_MUSIC_HISTORY_6.md)
1. [Sandwich Maker upgrade with Browserify](MJ_BROWSERIFY_SANDWICH_MAKER.md)

## Promises

1. [Acme Explosive](MJ_PROMISES_ACME_EXPLOSIVES.md)

## Prototypal Inheritance

1. [Car Manufactory](MJ_PROTOTYPAL_CARS.md)
1. [Tree Orchard](MJ_PROTOTYPAL_TREE_FARM.md)

## Testing

1. [Word Checking Tests](MJ_TESTING_WORD_CHECKER.md)
1. [Writing Math Tests](MJ_TESTING_MATH.md)

# In-class Exercises

# Group Exercises

repository: anothersusan/ux-developer-milestones

repo_name: anothersusan/ux-developer-milestones


text:
# ScrollViewController

![Platform](https://img.shields.io/badge/platform-iOS-333333.svg)
![Swift v5.0](https://img.shields.io/badge/swift-v5.0-orange.svg)
![test coverage 97%](https://img.shields.io/badge/test_covergage-97%25-success.svg)
[![CocoaPods](https://img.shields.io/cocoapods/v/ScrollViewController.svg)](https://cocoapods.org/pods/ScrollViewController)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)

Wraps your custom view and presents it on the screen in the way it fills visible area (not covered by navigation bar, keyboard etc.). If your custom view is too big, you will be able to scroll the content thanks to embedded `UIScrollView`.

![ScrollViewController Demo App](Misc/ScrollViewController_DemoApp.gif)

Starting from version `v1.1.0`, ScrollViewController does no longer depends on [KeyboardFrameChangeListener](https://github.com/darrarski/KeyboardFrameChangeListener) and [ScrollViewKeyboardAvoider](https://github.com/darrarski/ScrollViewKeyboardAvoider) frameworks, which makes it more portable and easier to integrate. That change also makes those frameworks obsolete.

`KeyboardFrameChangeListener` is used to observe keyboard frame changes and then
adjust insets using `ScrollViewKeyboardAvoider` so the keyboard does not cover the content. Supports "safe area layout" and makes the content fill visible area.

Designed to work on iPhone (including iPhone X) in portrait orientation (should also support other screen orientations as well as iPad screen).

## Install

Minimum deployment target: **iOS 10.0** (on **iOS >= 11** uses Safe Area Layout for iPhone X compatibility).

Last version developed using Swift 4.2 is `v1.0.12`.

### CocoaPods

You can integrate `ScrollViewController` with your project using [CocoaPods](https://cocoapods.org). Just add this line to your `Podfile`:

```ruby
pod 'ScrollViewController', '~> 1.1'
```

### Carthage

You can also use [Carthage](https://github.com/Carthage/Carthage) if you prefer by adding following line to your `Cartfile`:

```
github "darrarski/ScrollViewController" ~> 1.1
```

## Use

Example can be found in [DemoApp](DemoApp).

**TL;DR**

```swift
let yourContentView: UIView

let scrollViewController = ScrollViewController()
scrollViewController.contentView = yourContentView
```

## Develop

Requirements:

- [Xcode](https://developer.apple.com/xcode/) v10.3
- [Carthage](https://github.com/Carthage/Carthage) v0.33.0
- [SwiftLint](http://github.com/realm/SwiftLint) v0.34.0
- [Ruby](https://www.ruby-lang.org/) with [Bundler](https://bundler.io/pl)

To bootstrap the project run:

```sh
bundle install
bundle exec fastlane setup
```

Then open `ScrollViewController.xcodeproj` in Xcode.

Use `DemoApp` build scheme for building and runing demo app.

Use `Tests` build scheme for runing tests.

To run tests from command line execute:

```sh
bundle exec fastlane test
```

To generate test coverage report in HTML format, run:

```sh
bundle exec fastlane coverage_html
```

Report will be saved in `coverage_report` directory.

## License

Copyright © 2019 Dariusz Rybicki Darrarski

[MIT License](LICENSE)

repository: zDILIGENCEz/goland

repo_name: zDILIGENCEz/goland


text:
---
hrs_structure:
  division: '1'
  volume: '7'
  title: '20'
  chapter: '346'
  section: 346-66
type: hrs_section
tags:
  - Government
menu:
  hrs:
    identifier: HRS_0346-0066
    parent: HRS0346
    name: 346-66 Psychological services
weight: 8515
title: Psychological services
full_title: 346-66 Psychological services
---
**[§346-66] Psychological services.** When the health care or rehabilitative services authorized under this chapter are services which a psychologist is licensed to render under chapter 465, the department shall not require referral, direction, or prescription of services by another health care practitioner. [L 1987, c 290, §1]

repository: SamMade/BlueAndKrabby

repo_name: SamMade/BlueAndKrabby


text:
---
layout: post
title:  Securing EC2 Instance
description: In this post i'll show you how to secure your EC2 instance using ssh and IAM roles and policies
date:   2020-07-14
---
This post is based on my learnings from [FooBar's video](https://www.youtube.com/watch?v=9dpPCJxtHe0). If you prefer to see the video instead, please click [here](https://www.youtube.com/watch?v=9dpPCJxtHe0)

When you are trying to access any AWS service from your EC2 instance (virtual server), giving proper permission and securing your EC2 is essential. You should always follow the best practice known as "least privilege" principle for permissions which means that only give your EC2 least amount of permissions that it needs to get the job done.

Along with the permissions you should also make sure that your EC2 instance is secured as you don't want anyone hacking into your server and steal all the important files you have. Securing an EC2 instance can be done via Secure Shell (SSH) and Security Groups which are nothing more than virtual firewalls.

## Prerequisites:
*   AWS Account
*   Familiarity with Cloud9
*   AWS CLI (verify `aws --version`)
*   `pip3` from Python3 (verify pip3 --version))

If you don't have pip3 (Python3) or CLI installed, run the below commands

pip3 from Python3 - `sudo apt-get install python3-pip3`

AWS CLI - `sudo pip3 install awscli`

## Assumptions:
This blog assumes you know how to:
*   Spin up and EC2 instance
*   Create an S3 bucket and upload a file into it

## What's Covered
*   SSH into EC2
*   IAM Policies and Roles

### SSH into EC2
SSH is an application that enables you to access another Linux machine from a remote connection
*   Run your instance in Cloud9 / Terminal
*   Run the command to ssh in your instance
```
ssh -i <path-to-private-key> ec2-user@<server's-IP-Address>
```

where:

`-i` - means to "include"

`<path-to-private-key>` - whereever you stored your private key. Private keys come in different formats such as `.pem`(default format), which is obtained from AWS console and Putty Private Key (`.ppk`), for using in Putty for windows machines only.

`ec2-user` - what's the user you want to connect to on the other machine

`<server's-IP-Address>` - this would be an actual IP adress such as 11.2.445.55

**Bonus Tip:**
If you want to only create a key pair manually,then you can do the following steps:
*   Go to EC2 Dashboard
*   On the left menu scroll down to **Network and Security**
*   Click on **Key Pairs**
![](/assets/images/2020-07-14/key-pair.png)

Always use keys and for extra security, put a passphrase (like a password) on the key too.

*   Now, got to **AWS console**,
*   Create an S3 bucket
*   Upload a file into it.
*   Then copy the bucket name
*   Now run the below command
```
aws --region <region-of-the-bucket> s3 ls s3://<name-of-the-bucket>
```

You will get and error saying:

> Unable to locate credentials. You can configure credentials bu running "aws configure"

This is becuase IAM Roles or profile are not yet configured for the EC2 instance. Now we need to create and attach a role to the EC2 instance.

### IAM Roles and Policies
Essentially, what an IAM role is the ability to give a non-human set of permission to do a specific task. It's can be attached to an EC2 instance, another service or another AWS Account, Web identity or SAML Federation. We will be giving permission to EC2 instance (in our case) to read the files in S3 bucket.
*   Go to **AWS Console**
*   Click on **Services**
*   Under **Security, Identity, & Compliance**, click **IAM**
*   On the left scrollable menu, click on **Roles**
*   Click **Create role** button
*   Under **Choose a use case**, choose **EC2**
*   Click **Next: Permission** in the bottom right
*   We won't attach any policies(permissions) yet as there is an interesting aspect with EC2 that I found from the [video]() at 13:40 which is a service in a background that provides API credentials to that instance and rotates every 15 minutes for us. So, will see how we go from no credentials to having credentials without policies to prove that we have the credentials in place.
*   No tags needed
*   Give the role a name
*   Click **Create role**

Now that we have the role, we need to attached it to EC2 instance to be able to use it.

*   Go EC2 Dashboard
*   Right click on your EC2 instance
*   Choose **Instance Settings**
*   Click **Attach/Replace IAM Role**
*   On the next page, click on the dropdown box for **IAM role** and select the role you just created.
*   Click **Apply**

Now run the below command again:
```
aws --region <region-of-the-bucket> s3 ls s3://<name-of-the-bucket>
```
You should see the below error:
>   An error occured (Access Denied) when calling the ListObjectV2 operation: Access Denied
which shows we can access the bucket with our credential however to list the files in the bucket, we still need to set policy(permission) for it and then attach the policy to our role.

*   Go to **AWS Console**
*   Click on **Services**
*   Under **Security, Identity, & Compliance**, click **IAM**
*   On the left scrollable menu, click on **Policies**

We have three types of policies, Customer Managed (custom), AWS managed(AWS built in) and AWS managed - job function
![](/assets/images/2020-07-14/policy-types.png)
*   Select the **Visual Editor** tab
*   For **Service**, click **Choose a Service**
*   In search bar, type **S3**
*   Click **S3**
*   Under **Access Level**, tick **List** and **Read**
*   For **Resources** choose **Specific**
*   For **bucket**, click **Add ARN**
*   Enter the bucket name in the text box
*   Click **Add**
*   For **object**, click **Add ARN**
*   Type the bucket name in **Bucket name** text box for bucket level access to list all the file in the bucket
*   Type `*` (wildcard) for **object** as we need to get object (files) level access in the bucket.
*   Click **Review Policy**
*   Give your policy a name
*   Give a description
*   Click **Create Policy**
*   Now attach the policy to your previously created role.

Now run the below command again:
```
aws --region <region-of-the-bucket> s3 ls s3://<name-of-the-bucket>
```
and you should see all the files in your bucket.

If it didn't work for you, feel free to get in touch with me. I'd be happy to help


text:
# DocumentBlockPreview

This is the preview component for `document-block` blocks. It is used in:
+ The `DocumentBlockModal` (see `@triniti/cms/plugins/blocksmith/components/document-block-modal`)
+ The `DocumentBlockPlaceholder` (see `@triniti/cms/plugins/blocksmith/components/document-block-placeholder`)
+ Node preview components (eg the `ArticlePreviewModal`, see `@triniti/cms/plugins/news/components/article-preview-modal`). When used in a preview component, it is retrieved by the `resolver`'s `getPreview` function (see `@triniti/cms/plugins/blocksmith/resolver.js`).

### Required props
+ `documentNode` - The block's associated document node (uses mixin `triniti:dam:mixin:document-asset`). From selector.
+ `block`     - A `document-block` block (uses mixin `triniti:canvas:mixin:document-block`).

### Optional Props
+ `className`    - String for css class name(s).
+ `imageNode` - Message using mixin `triniti:dam:mixin:image-asset`, used as poster image.

### FYI
+ See the [Triniti document block mixin](https://github.com/triniti/schemas/tree/master/schemas/triniti/canvas/mixin/document-block).

repository: triniti/cms-js

gha_language: JavaScript

repo_name: triniti/cms-js


text:
# September 10, 2019 - Remove element [Easy]

Given an array of elements and a target element to remove, return a new array
with all instances of the target element removed while preserving the order
of the other elements.

Example:
```
Input: Array = [1, 2, 3, 1, 2, 3], Target = 1
Output: [2, 3, 2, 3]

Input: ['a', 'b', 'c', 'd'], Target = 'c'
Output: ['a', 'b', 'd']
```

repository: jonathan-vidal/daily-questions

repo_name: jonathan-vidal/daily-questions


text:
Here are the most popular packages that published new releases to npm this week. Packages are ranked by downloads in March 2019, and versions are broken down by major, minor, and patch releases.

### Major

1<EMAIL_ADDRESS>Check if argv has a specific flag

2<EMAIL_ADDRESS>easily create complex multi-column command-line-interfaces

3<EMAIL_ADDRESS>Bash-like brace expansion, implemented in JavaScript. Safer than other brace expansion libs, with complete support for the Bash 4.3 braces specification, without sacrificing speed.

4<EMAIL_ADDRESS>Glob matching for javascript/node.js. A replacement and faster alternative to minimatch and multimatch.

5<EMAIL_ADDRESS>Fill in a range of numbers or letters, optionally passing an increment or `step` to use, or create a regex-compatible range with `options.toRegex`

6<EMAIL_ADDRESS>Matches strings against configurable strings, globs, regular expressions, and/or functions

7<EMAIL_ADDRESS>Finds the common standard cache directory

8<EMAIL_ADDRESS>Toggle the CLI cursor

9<EMAIL_ADDRESS>Convert a value to an array

10<EMAIL_ADDRESS>Pass two numbers, get a regex-compatible source string for matching ranges. Validated against more than 2.78 million test assertions.

### Minor

1<EMAIL_ADDRESS>Read and parse a JSON file

2<EMAIL_ADDRESS>Find the root directory of a Node.js project or npm package

3<EMAIL_ADDRESS>Get a stream as a string, buffer, or array

4<EMAIL_ADDRESS>Convert a camelized string into a lowercased one with a custom separator: unicornRainbow → unicorn_rainbow

5<EMAIL_ADDRESS>Get callsites from the V8 stack trace API

6<EMAIL_ADDRESS>Create an array without duplicates

7<EMAIL_ADDRESS>Get the PATH environment variable key cross-platform

8<EMAIL_ADDRESS>List of the Node.js builtin modules

9<EMAIL_ADDRESS>Get your PATH prepended with locally installed binaries

10<EMAIL_ADDRESS>Convert object keys to camelCase

### Patch

1<EMAIL_ADDRESS>A comprehensive library for mime-type mapping

2) **[@types/node](https://npmjs.com/package/<EMAIL_ADDRESS>TypeScript definitions for Node.js

3<EMAIL_ADDRESS>Standard library

4<EMAIL_ADDRESS>YAML 1.2 parser and serializer

5<EMAIL_ADDRESS>JavaScript parser, mangler/compressor and beautifier toolkit

6<EMAIL_ADDRESS>Fixes stack traces for files with source maps

7<EMAIL_ADDRESS>A list of SPDX license identifiers

8<EMAIL_ADDRESS>Parse CSS and add vendor prefixes to CSS rules using values from the Can I Use website

9<EMAIL_ADDRESS>Provides a list of electron-to-chromium version mappings

10<EMAIL_ADDRESS>An Object.keys replacement, in case Object.keys is not available. From https://github.com/es-shims/es5-shim

Moving On
---------

There were 76,868 new releases between April 5 and April 12. How many of those affect you? Check out [JSReport for Slack](https://js.report/slack) and keep up to date with the JavaScript libraries you depend on.


text:
# PaymentService
This component consists of two microservices: PaymentProxy and PaymentGateway.

## PaymentProxy
It is a Reliable Stateful Service used by the platform to send a payment request to the external payment system.

### Requirements
It exposes a feature to enqueue a payment request. It must verify the consistency of the request, if the request is valid enqueues it and invokes the external payment system.

### Partitioning
The partition key for each payment request is the hash of the invoice number.

### PaymentProxyProxy
It is the class that exposes the PaymentProxy features and incapsulate the partitioning algorithm.

Client must use this class instead of creates the service proxy directly (using `ServiceProxy.Create` method).

## PaymentGateway
It is a Reliable Stateless Service that hosts the web API application that exposes the WebHook for the payment confirmation.

### Requirements
It exposes a webhook used by the external payment system to comunicate the payment of an invoice (see [invoice payment](Scenario-InvoicePayment.md)).

The webhook must check if the invoice exists and then calls the invoice actor to communicate the payment.

repository: massimobonanni/iRentCarServiceFabric

gha_language: C#

repo_name: massimobonanni/iRentCarServiceFabric


text:
# haxe-babylon

Generated haxe externs for [Babylon.js](https://www.babylonjs.com/)

## How?

The externs are created using [ts2hx](https://github.com/firefalcom/ts2hx).
Some manual fixes are made by hand.

## Versioning

Package version matches Babylon version.

## Samples

Babylon.js samples are available in [haxe-babylon-samples](https://github.com/firefalcom/haxe-babylon-samples.git).

repository: firefalcom/haxe-babylon

repo_name: firefalcom/haxe-babylon


text:
# Pixel Link using a Mobilenet feature detector

This repository contains a modified version of the [PixelLink](https://github.com/ZJULearning/pixel_link) text detector. This fork uses a Mobilenet v2 feature detector, rather than the VGG detector used in the original version. Please see the original repository for more details.

The advantage of using Mobilenet instead of ResNet for feature detection is a substantial reduction in model size for a relatively small drop in accuracy. Furthermore, by using deconvolution transforms instead of bilinear interpolation for upsampling in the fusion layers, this model slightly outperforms the original design.

# Usage

##Training

As per the original, this model is intended to be trained on the Synthtext and icdar2015 image sets. A modified version of the training script can be found in the scripts subdirectory.

The training script expects the training data to be available in a subdirectory called "training_data".

A machine with a GPU, supported by Tensorflow, with a minimum of 8GB RAM is recommended for training. At the time of writing, it is not practicable to train this model on a CPU alone.

The script takes the following parameters:

|Parameter|Description|
|---|---|
|GPUS|zero indexed list of GPUs to use.|
|Batch size|the training batch size, 8 is recommended for GPUs with 8GB RAM|
|Output Directory|the directory to save the trained model and checkpoints to.|

### Examples

To train a model using GPUs 0 and 1, with a batch size of 8, saving the model to a subdirectoru called model, execute the following:

```shell
pixel_link$ scripts/train.sh 0,1 8 model
```

## Freezing the Model

A training checkpoint can be frozen for optimal use for inference by using the freeze.py script, found in the top level directory.

Frozen models are saved in a subdirectory named "frozen".

So, to freeze checkpoint number 372284 in the model directory, saving the frozen model as frozen/mymodel.pb, execute the following:

```shell
pixel_link$ python freeze.py \
	--eval_image_height=1152 \
	--eval_image_width=1536 \
	--model_name=tiny \
	--pixel_conf_threshold=0.5 \
	--link_conf_threshold=0.5 \
	--checkpoint_path=model/model.ckpt-372284 \
	--output=mymodel
```

## Converting the frozen model to CoreML format

CoreML is Apples' machine learning library. It provides access to hardware accelerated inference on recent iPhone models.

The ios.py script can be used to convert a trained frozen model to CoreML format.

The script takes the name of the frozen model, saved in the frozen subdirectory, and saves the converted model to the same directory, with a .mlmodel extension.

So to convert a frozen model, frozen/mymodel.pb, execute the following:

```
pixel_link$ python ios.py mymodel.pb
```

The converted model will be saved as frozen/mymodel.mlmodel.

# Inference Library

Neither Tensorflow nor CoreML provide all the operations required to carry out inferences using the model. In the original source, inference calculations are performed using python routines.

In order to allow inferences to be performed on iOS or Android, the inference code has been rewritten in C++. This new inference code is contained in the post_process subdirectory.

# TODO

Basic sanity testing and sample code for an iOS app using model.

# Licence

This fork is released under the same MIT licence as the original.


text:
# pdml2flow-elasticsearch [![PyPI version](https://badge.fury.io/py/pdml2flow-elasticsearch.svg)](https://badge.fury.io/py/pdml2flow-elasticsearch)
_Saves [pdml2flow] output in Elasticsearch_

| Branch  | Build  | Coverage |
| ------- | ------ | -------- |
| master  | [![Build Status master]](https://travis-ci.org/Enteee/pdml2flow-elasticsearch) | [![Coverage Status master]](https://coveralls.io/github/Enteee/pdml2flow-elasticsearch?branch=master) |
| develop  | [![Build Status develop]](https://travis-ci.org/Enteee/pdml2flow-elasticsearch) | [![Coverage Status develop]](https://coveralls.io/github/Enteee/pdml2flow-elasticsearch?branch=develop) |

## Prerequisites

* [pdml2flow]

* [pip](https://pypi.python.org/pypi/pip)

## Installation

```shell
    $ sudo pip install pdml2flow-elasticsearch
```

## Usage

```shell
$ pdml2flow +elasticsearch -h
usage: Elasticsearch output [-h] [--host ES_HOST] [--port ES_PORT]
                            [--flowindex ES_FLOW_INDEX]
                            [--flowtype ES_FLOW_TYPE] [--no-frames]
                            [--frameindex ES_FRAME_INDEX]
                            [--frametype ES_FRAME_TYPE]

optional arguments:
  -h, --help            show this help message and exit
  --host ES_HOST        Elasticsearch api host [default: localhost]
  --port ES_PORT        Elasticsearch api port [default: 9200]
  --flowindex ES_FLOW_INDEX
                        Index name [default: pdml2flow]
  --flowtype ES_FLOW_TYPE
                        Type [default: flow]
  --no-frames           Do not store frames [default: False]
  --frameindex ES_FRAME_INDEX
                        Index name [default: pdml2frame]
  --frametype ES_FRAME_TYPE
                        Type [default: frame]
```

## Example

## Test environment

```shell
$ sysctl -w vm.max_map_count=262144
$ docker-compose up
```

* Elasticsearch: http://localhost:9000
* Kibana: http://localhost:5601

[pdml2flow]: https://github.com/Enteee/pdml2flow
[python]: https://www.python.org/
[wireshark]: https://www.wireshark.org/

[Build Status master]: https://travis-ci.org/Enteee/pdml2flow-elasticsearch.svg?branch=master
[Coverage Status master]: https://coveralls.io/repos/github/Enteee/pdml2flow-elasticsearch/badge.svg?branch=master
[Build Status develop]: https://travis-ci.org/Enteee/pdml2flow-elasticsearch.svg?branch=develop
[Coverage Status develop]: https://coveralls.io/repos/github/Enteee/pdml2flow-elasticsearch/badge.svg?branch=develop


text:
# reddit-react
A reddit web client.

## Setup

How to set up the application locally for development.

### Prerequisites

You'll need the following tools on your machine:

- *[Node](https://nodejs.org/en/download/)
- [concurrently](https://www.npmjs.com/package/concurrently) as a global user (`npm i -g concurrently`)

\* I actually recommend installing [NVM](https://github.com/creationix/nvm), and then running the command `nvm i stable`. Much easier, and allows you to switch between Node versions later.

### Initialization

In the project directory, run the init script:

    $ npm i

### Running & Viewing

Navigate to the project directory in your terminal. Run the following command:

    $ npm start

Default port for local is `3000`. Navigate to `http://localhost:3000` in your browser, and you should see the application running.

repository: mattbalmer/reddit-react

repo_name: mattbalmer/reddit-react


text:
---
layout: post
title: "Summer internship at Vespa"
author: enikolaisen
date: '2022-08-12'
image: assets/2022-08-12-summer-internship/internship.jpg
image_credit: 'Photo by Arnold Francisca on Unsplash'
tags: []
excerpt: After the summer internship of 2022 the intern has summarized what he has done and his experience at Vespa
---

Photo by Arnold Francisca on Unsplash

Through the summer as an intern at Vespa I got the opportunity to learn new technologies and  experience how it is to work for a software company. At the start of my internship I got an introduction to the company and was told about the projects I was going to work on during the internship.

During the internship I	 worked on two projects. The first one was to recreate the Vespa Query Builder using React, and the second one was to create a solution for visualizing the traces made by the Vespa engine. Both of these projects have been implemented into a [client](https://github.com/vespa-engine/vespa/tree/master/client/js/app).

### Query Builder

The Query Builder is a tool for creating Vespa queries. The tool is a website that helps with creating the queries by allowing the user to select query-options from drop-down menus. The old website consisted of a HTML website with some old, hard to read, JavaScript code, and a backend handler written in Java. This made the website separate and hard to integrate with other tools.

My assignment was to recreate the Query Builder using React making it a complete JavaScript application. Before I started on the assignment I spent a day learning about React, and then I dove into the deep end and started on creating the application, learning more as I went. The old JavaScript code was difficult to read and did not merge well with React so many functionalities had to be recreated from scratch.

The finished application looks very much like the old one, but since it is created in React it is much simpler to implement it in other React applications. I did update the UI some by adding tooltips to buttons to make the application simpler to use.

### Trace Visualizer

The Trace Visualizer is supposed to make it easier to identify bottlenecks in queries. The idea is to remove the need to comb through in search for where the problems could be. The solution consists of an application to input and transform the Vespa trace and the third-party tool [Jaeger](https://www.jaegertracing.io/) to visualize the transformed trace.

I started by looking at and comparing several existing solutions for visualizing traces and chose to use Jaeger because it was the simplest to use and was the best fit for the use-case. Because Jaeger did not support the traces created by Vespa the traces had to be transformed into a format that Jaeger could use. One of the formats Jaeger supports, and the one I used, is similar to OpenTelemtry´s trace definition with spans being the smallest unit of work (more information here: [OpenTelemetry tracing](https://opentelemetry.io/docs/concepts/signals/traces/).

The first iteration of the transformation tool could handle simple traces from Vespa and transform them into traces that could be imported into Jaeger. The hardest part was figuring out how to best traverse the Vespa trace to find the relevant information that Jaeger would need. The Vespa trace always seemed to have more special cases that needed to be handled differently just when I thought I had found them all. The Vespa trace could also be much more complicated and the first iteration could not handle them.

Vespa trace
Transformed trace

{
  "trace": {
    "children": [
      ...
      {
        "timestamp": 4,
        "message": "Invoke searcher ..."
      },
      {
        "timestamp": 5,
        "children": [
          {
            "timestamp": 5,
            "message": Invoke searcher ..."
          },
          {
            "timestamp": 6,
            "message": "Return searcher ..."
          }
        ]
      },
      {
        "timestamp": 8,
        "message": "Retunr searcher ..."
      }
      ...
      {
        "start_time": "2022-07-28 13:49:47.816 UTC",
        "trace": [
          {
            "traces": [
              {
                "timestamp_ms": 0.051936,
                "event": "Start query setup"
              }
              ...
              {
                "timestamp_ms": 1.045379,
                "event": "Complete query setup"
              }
            ]
          }
        ]
      }
    ]
  }
}

{
  "data": [
    {
      "traceID": "db187cb870b90c0ad8cc235fed504c16",
      "spans": [
        {
          "traceID": "db187cb870b90c0ad8cc235fed504c16",
          "spanID": "8182dc73c8bd68ed",
          "operationName": "default",
          "references": [],
          "startTime":<PHONE_NUMBER>159000,
          "duration": 2000,
          "tags": [],
          "logs": [],
          "processID": "p0"
        },
        {
          "traceID": "db187cb870b90c0ad8cc235fed504c16",
          "spanID": "52bc94897ad844b6",
          "operationName": "Invoke searcher ...",
          "references": [
            {
              "refType": "CHILD_OF",
              "traceID": "db187cb870b90c0ad8cc235fed504c16",
              "spanID": "8182dc73c8bd68ed"
            }
          ],
          "startTime":<PHONE_NUMBER>159000,
          "duration": 1,
          "tags": [],
          "logs": [],
          "processID": "p1"
        },
        ...
        {
          "traceID": "db187cb870b90c0ad8cc235fed504c16",
          "spanID": "d94b2b388d92864d",
          "operationName": "Return searcher ...",
          "references": [
            {
              "refType": "CHILD_OF",
              "traceID": "db187cb870b90c0ad8cc235fed504c16",
              "spanID": "d671eeb306d4784b"
            }
          ],
          "startTime":<PHONE_NUMBER>159000,
          "duration": 100,
          "tags": [],
          "logs": [],
          "processID": "p7"
        }
      ]
    }
  ]
}

To make the tool capable of handling the more complicated traces I first refactored much of the code to make it easier to use and then I created a recursive function to handle the more complex structure that the traces could have. I also implemented better naming of the spans in the transformed trace to make it easier so see what was happening in each span. By using regex on the description of the work the span is doing it is possible to find the process that work is being done on and use this as the name of the span.

![Jaeger UI](/assets/2022-08-12-summer-internship/JaegerUI.png)

There is some further work to be done with the naming of spans as a few can get names that do not reflect the work contained in the span. The timings and durations of spans are also a bit imprecise. This imprecision is small and does not have any impact on the use of the tool to find bottlenecks. The imprecision happens because the Vespa trace mostly uses milliseconds for timestamps with some parts using microseconds and Jaeger always using microseconds there can be some problems with the timings because of imprecision.

### My experience at Vespa

At the start of my internship I was excited to find how it would be to work for a software company and get insight into the workflow. I felt that I was warmly welcomed and was well introduced to the work environment.

At the beginning of my internship it was a bit daunting to have to learn both a bit about how the Vespa engine worked and how to use React and JavaScript. It was all completely new to me and at the beginning felt a bit insurmountable, but I always had colleagues that seemed eager to help me with problems.

I really enjoyed my time working at Vespa with knowledgeable colleagues who could always help me when I was stuck and have taught me alot. My experience at Vespa has been very enjoyable and educational and has and will continue to benefit me in the future.

repository: vespa-engine/blog

gha_language: HTML

repo_name: vespa-engine/blog


text:
# Password Strength Verificator

Verifies password strength interactively

### Prerequisites
```
python3.6+
```

### Installing and running
Clone repository, install dependencies from requirements.txt and run with
```
python3 verify_pass.py
```
## Running the tests

```
python3 tests.py
```
## License

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details


text:
## Acknowledgements

This resume is based upon styles and toolchain developed by @mszep and @pjf, under an MIT license.

You can find the original system [on github](https://github.com/pjf/pandoc_resume), as well as my own [resume and changes](https://github.com/Hoohm/pandoc_resume).


text:
---
title: Agile and Kanban
status: draft
---

**Topics to cover and ideas**

 - history
 - why it worked
 - agile manifesto
    - https://www.agilealliance.org/agile101/the-agile-manifesto/
        - Individuals and interactions over processes and tools
        - Working software over comprehensive documentation
        - Customer collaboration over contract negotiation
        - Responding to change over following a plan

 - [Software Craftsmanship](http://manifesto.softwarecraftsmanship.org/)
    - Not only working software             , but also well-crafted software
    - Not only responding to change         , but also steadily adding value
    - Not only individuals and interactions , but also a community of professionals
    - Not only customer collaboration       , but also productive partnerships

 - Anton cords
 - explain concepts (with diagrams)
 - how agile become dogma and created environments where agile teams where not agile at all
    - processes become more important than understanding why something was being created in the first place, to much effort was put on estimates, to much focus was placed on what could be done in 2 weeks
 - Scrumbam is a nice alternative

 - [The Mythical Man-Month](https://en.wikipedia.org/wiki/The_Mythical_Man-Month)


text:
---
layout: news
title: Congratulations to Jessica Bartley!
author: kbottenhorn
category: news
tags: [awards]

excerpt: Jessica Bartley wins first prize in Physics Graduate Student Research Competition!
---

Good news! Jessica Bartley, a third year Ph.D. student in the Neuroinformatics and Brain Connectivity (NBC) Laboratory, has been awarded first place in a department-wide competition of graduate research! This year’s competition of oral presentations welcomed nine FIU Physics Ph.D. students to present their dissertation research to an audience of faculty and peers. A faculty panel awarded Jessica first prize, which included a cash prize of $500, for her presentation entitled “Physics Learning Facilitates Enhanced Resting-State Brain Connectivity in Problem Solving Network”. Jessica’s work is funded by the National Science Foundation’s REAL DRL-1420627 grant.

[Would you like to know more about NSF REAL DRL-1420627?](https://nbclab.github.io/projects/physics-learning)


text:
---
title: 'Tip: Close all file in VSCode without saving'
path: /posts/tip-close-all-files-in-vscode-without-saving
date: 2019-06-14T02:20:32.209Z
category: programming
tags:
  - tip
  - vscode
layout: post
draft: false
description: "A quick tip for when you accidentally make changes to 100's of files in Visual Studio Code and don't want to save them."
---

I updated my root folder because it had a typo in it. For some reason every time I type the word `survey` my fingers decide `survery` is what I really need.

After renaming the folder and blindly hitting "yes" to update all the imports and references I was left with a large number of open files with changes that I didn't need - nearly all of them were changes to `node_modules` import statements.

![](/assets/screen-shot-2019-06-14-at-12.15.41-pm.png)

Try to close these using the `Close All` option in the tab context menu and you will get a dialog for each and every one of those unsaved open files.

![](/assets/screen-shot-2019-06-14-at-12.16.12-pm.png "This might take a while")

After getting annoyed with this I did some googling, quickly finding many people with the same issue. In particular this [open issue #44024](https://github.com/Microsoft/vscode/issues/44024) in which it is mentioned that the `Close Folder` action will combine all the files.

| ![](/assets/screen-shot-2019-06-14-at-12.16.49-pm.png) | ![](/assets/screen-shot-2019-06-14-at-12.17.05-pm.png) |
|-|-|

This was much nicer.

You still need to `Close All` once you open the project up again but you won't be asked to save each and every one of them again.

branch_name: refs/heads/lumen


text:
# SafeContentResolver

A replacement for Android's [`ContentResolver`](https://developer.android.com/reference/android/content/ContentResolver.html)
that protects against the *Surreptitious Sharing* attack.

## Surreptitious Sharing

Read all about it in the [corresponding blog post](https://www.ibr.cs.tu-bs.de/news/ibr/surreptitious-sharing-2016-04-04.xml).

## Usage

Replace all occurrences of [`ContentResolver.openInputStream()`](https://developer.android.com/reference/android/content/ContentResolver.html#openInputStream(android.net.Uri))
where URIs provided by other apps are opened with `SafeContentResolver.openInputStream()`.

`SafeContentResolver` will refuse to open `file://` URIs pointing to files belonging to your app and `content://` URIs
belonging to content providers of your app.
If you wish to allow access to certain content providers, add the following `<meta-data>` element to the appropriate
`<provider>` entries in your manifest:
```xml
<provider … >
    <meta-data
        android:name="de.cketti.safecontentresolver.ALLOW_INTERNAL_ACCESS"
        android:value="true" />
</provider>
```

The library comes in two flavors `safe-content-resolver-v14` and `safe-content-resolver-v21`. The former includes
native code to be able to invoke the `fstat` system call that is used to retrieve the owner of a file. Starting with
Lollipop (API 21) the framework includes the class [`Os`](https://developer.android.com/reference/android/system/Os.html)
to access this functionality. So `safe-content-resolver-v21` is free of native code and thus much smaller.

To retrieve an instance of `SafeContentResolver` use:
```java
SafeContentResolver safeContentResolver = SafeContentResolverCompat.newInstance(context);
```

If your `minSdkVersion` is 21 or higher you only need to include `safe-content-resolver-v21` and use the following code:
```java
SafeContentResolver safeContentResolver = SafeContentResolver.newInstance(context);
```

## Include the library

```groovy
implementation 'de.cketti.safecontentresolver:safe-content-resolver-v14:1.0.0'
```

Or, if you're using `minSdkVersion` 21 or higher:

```groovy
implementation 'de.cketti.safecontentresolver:safe-content-resolver-v21:1.0.0'
```

## Native code

`safe-content-resolver-v14` contains native code for the following ABIs:
* armeabi-v7a
* arm64-v8a
* x86
* x86_64

If you don't want to include all of them in your APK you might want to look into
[ABIs Splits](https://developer.android.com/studio/build/configure-apk-splits.html#configure-abi-split).

## License

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

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

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

repository: cketti/SafeContentResolver

repo_name: cketti/SafeContentResolver


text:
---
title: improve TIBCO Designer tester performance under linux
date: 2009-04-22T00:20:25+00:00
layout: post
tags:
  - designer
  - java
  - linux
  - TIBCO
---
I’m using the TIBCO designer for quite a while now. Before using it in a debian environment I developed all TIBCO related stuff in Windows XP. Now with the switch to linux there came quite a shift in user experience. One thing that really annoyed me was the slow performance of the designer debugger.

So I started some measurements with a simple test process. The test process creates a simple list of all files (2000 items) in one folder and then iterates over every entry. Here is what I got:

> Windows XP: 194sec

> Windows XP (minimized): 6sec

> Gnome: 470sec

> Gnome (minimized): 4sec

All this data was gathered with the same default installation of a TIBCO designer 5.6 with the default java runtime. The configs were all left untouched. So now I tried to find something to improve that behavior. I first concentrated on how to influence the jvm.

After a bit of research in the TIBCO direction a found the following value in the tra-file which allows the user to pass parameters directly to the jvm:

> java.extended.properties

With that information I tried several parameters suggested by google. After a few tries I came to this one:

> sun.java2d.pmoffscreen=false

What [Sun says about it](http://java.sun.com/j2se/1.5.0/docs/guide/2d/flags.html#pmoffscreen) isn’t really clear to me but it helps drastically to improve performance. Back to my original test I came up with the following timings:

> Gnome (pmoffscreen=false): 75sec

> Gnome (pmoffscreen=false): 5sec

As you can see it actually surpasses the Windows installation. That was a result I didn’t actually expect. Till now I found no drawback to this solution.

Just for the sake of completeness here my full config line of the designer.tra

> java.extended.properties=-Xrs -Xmx3072M -Xms1536M -XX:+AggressiveOpts -XX:-UseParallelGC -XX:-UseConcMarkSweepGC -XX:MaxPermSize=512M -XX:+UseFastAccessorMethods -Xverify:none -Dsun.java2d.pmoffscreen=false


text:
---
layout: post
title: Barcelona PerlMongers GPG Key Signing Party
---

Like every fourth Thursday, the Barcelona Perl Mongers meet to share insights and discuss elevated topics around Perl.
Today there is such a meeting, and since we had no one volunteering to give a presentation, we'll discuss the remodelation of Barcelona.pm's web site and, partially because of my proposal, have a GPG Key Signing party.

I created my key pair some time ago, but since it was not very useful (since no one I knew used encryption) and had to be on my linux workstation to use it (and using mutt) I stopped using it after a bit of experimenting.

Today, with the advent of Enigmail, I can use it at my own leisure in an easy to use, unobtrusive GUI way.

So, if you want to send me private mail, you can use my public key to encrypt your message. You can find my public key at many keyservers, or right here:

My key ID: 0x6DF1354D
Key fingerprint: 762F 2DF9 8DFE 2323 8341 399F ECDA 8664 6DF1 354D

extension: markdown


text:
# Backtesting-of-MVO-portfolio

This backtesting used `stocks = ['PTT', 'CPALL', 'SCC', 'BDMS', 'AOT']` as samples
and visualized the profit/loss of the MVO portfolio in the period between 2009 and 2019

### Rebalance result
![](https://github.com/tongplw/Backtesting-of-MVO-portfolio/blob/master/example.png)

repository: wayRaimy/Backtesting-of-MVO-portfolio

repo_name: wayRaimy/Backtesting-of-MVO-portfolio


text:
---
author: Haquor
date: 2019-11-29T00:16:45-05:00
draft: false
title: "How to Set Up a Free, Anonymous VoIP phone"
type: post
url: /2019/11/29/anonymous-burner/
image: "voip-client.png"
---

I found this service while searching for a free VoIP provider and debated whether I should share. The reason? I didn't want it to catch on. I'd like to keep this SIP provider & method relatively obscure so it isn't abused by bad threat actors. So please, only use this for legal purposes.

I'm sharing this in the hopes it'll be useful to other security researchers or even just IT enthusiasts who want a quick, anonymous VoIP number.

Shout out to Kerberos for helping me troubleshoot the VPN aspect & JMP for the free services.
<!--more-->

## Basic OPSEC

Even the best laid plans fall apart with bad OPSEC. This isn't the blog for learning [basic OPSEC](https://medium.com/@JMartinMcFly/basic-opsec-for-the-uninitiated-77d0839f7bce). Randomize handles, browse securely, and pay attention to services/softwae that creates unique fingerprints that might identify you later.

## Secure Browsing

For this to really be anonymous you should do this from a secure browser, and a secure tunnel. Chain VPN or TOR together however you see fit. Otherwise you're sorta wasting your time.

## Register for Jabber/XMP/JMP

Register for a Jabber/XMP account
https://xmpp.is/account/register/

You should choose an XMPP client that JMP chat recommends. Good options are Psi, Gajim or Movim. Movim worked best for me.

Make sure you're logged in to the XMP client before you complete this next step.

Go to JMP chat and register for a phone with desired area code
https://jmp.chat/sp1a/register1/

Put in your XMP information.

## Your Free SIP Account

Paste verification code into JMP site.
You should then get your SIP server info
If you don't, download: Psi, Gajim or Movim and add cheogram.com as a contact
Then right click cheogram -> Execute Command -> Reset SIP Account
This will give you your SIP info in the following format:

server: jmp.servers
user ID: your_user
Password: your_pass

## Download a VoIP Client
Download linphone or similar VOIP SIP client
Put in your VOIP info

You get 30 minutes of calling & 300 texts/picture for 30 days.
After 30 days or after you run out make a new account

JMP may also accept BTC payments (not sure yet)
You need to message "ossguy" in the JMP/Soprani.ca chatroom at<EMAIL_ADDRESS>or text them - +1<PHONE_NUMBER> (Canada) or +1<PHONE_NUMBER> (US)

## VoIP Client through
To use VoIP (such as linphone or Jami) with VPN, make sure your VoIP client is configured to use the local IP of your VPN interface when it sends the "register" command to the SIP server. Had a lot of issues with clients using other IP. You can specify this in .linphonerc or in Jami's advanced settings. May take a few restarts to take affect

You should see something like this:
{{< fluid_imgs
  "pure-u-1-1|/voip-client.png|VoIP"
>}}


text:
# Jade Template Engine for Punch

Use this plugin to replace Punch's default Mustache template engine with [Jade](http://jade-lang.com/).

### How to Setup

* Install the package

		npm install punch-engine-jade

* Open your Punch project's configurations (`config.json`) and add the following:

		"plugins": {

			"template_engine": "punch-engine-jade"

		}

* Now you can use Jade syntax for your project's templates.

	Make sure you **save the templates with `.jade` extension**.

* Paths for includes must start with `/` and be relative to the templates_dir in your config

repository: blakeblackshear/punch-engine-jade

repo_name: blakeblackshear/punch-engine-jade