text:
# EpiPalooza Stage Tracker

##### This application will track bands and the stages they are playing on during a musical event. It was created to show what I learned about Ruby and ActiveRecord (database relationships) {August 28, 2015}

#### By **Alyssa Horrocks**

## Description

This application will track bands and the stages they play on during a large musical festival. Every band can have many stages and every stage can house many bands. This runs in Sinatra with ActiveRecord. This application was created as a student at Epicodus.

## Setup

* `git clone https://github.com/alyssahorrocks/epipalooza.git`
* `rake db:create`
* `rake db:schema:load`

## Technologies Used

This app uses Ruby, Sinatra, and a bootswatch template as well as the gems: Sinatra, Sinatra-Contrib, and Rake.

### Legal

Copyright (c) 2015 **Alyssa Horrocks**

This software is licensed under the MIT license.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

 IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

repository: alyssahorrocks/epipalooza

repo_name: alyssahorrocks/epipalooza


text:
# Sonarqube

## Overview

[Sonarqube](https://www.sonarqube.org/) is an open-source platform for continuous inspection of code quality to perform automatic reviews with static analysis of code to detect bugs, code smells, and security vulnerabilities.

## Big Bang Touch Points

```mermaid
graph TB
  subgraph "Ingress"
    ingressgateway
  end

  subgraph "Sonarqube"
    ingressgateway --> sonarqube
  end

  subgraph "Metrics"
    sonarqube --> prometheus
  end

  subgraph "Database"
    sonarqube --- postgres
  end
```

### Storage

Persistent storage can be enabled by setting the following values in the bigbang chart:

```yaml
addons:
  sonarqube:
    values:
      persistence:
        enabled: true
        annotations: {}
        storageClass:
        accessMode: ReadWriteOnce
        size: 10Gi
```

### Database

Sonarqube needs a postgres database to function. If one is not specified in the bigbang chart Sonarqube will deploy one internally within the namespace it is deployed to.

```yaml
addons:
  sonarqube:
    database:
      host: ""
      port: 5432
      database: ""
      username: ""
      password: ""
```

### Istio Configuration

Istio is disabled in the sonarqube chart by default and can be enabled by setting the following values in the bigbang chart:

```yaml
hostname: bigbang.dev
istio:
  enabled: true
```

These values get passed into the sonarqube chart [here](https://repo1.dso.mil/platform-one/big-bang/apps/developer-tools/sonarqube/-/blob/main/chart/values.yaml#L358). This creates the virtual service and maps to the istio gateway.

## High Availability

This can be accomplished by increasing the number of replicas in the deployment.

```yaml
addons:
  sonarqube:
    values:
      replicaCount: 2
```

## Single Sign on (SSO)

SSO integration can be configured by modifying the following settings in the bigbang chart.

```yaml
sso:
  oidc:
    host: login.dso.mil
    realm: baby-yoda

addons:
  sonarqube:
    enabled: true
    sso:
      enabled: true
      client_id: ""
      label: ""
      certificate: ""
      login: login
      name: name
      email: email
```

```mermaid
flowchart LR

S --> K[(Keycloak)]

subgraph external
K
end

ingress --> IP

subgraph "Sonarqube namespace"
    subgraph "Sonarqube pod"
        S["sonarqube"]
        IP["istio proxy"] --> K
        IP --> S
    end
end
```

## Licencing

Sonarqube is released under the [Lesser GNU General Public License](https://en.wikipedia.org/wiki/Lesser_GNU_General_Public_License). The Bigbang chart utilizes the community edition of Sonarqube, but there are are also paid supported versions. Upgrades from community edition to enterprise or developer editions are possible via the [upgrade path](https://docs.sonarqube.org/latest/setup/upgrading/). Here is a link to their [Feature Comparison](https://www.sonarsource.com/plans-and-pricing/)

## Dependencies

Node kernel mods:
<https://repo1.dso.mil/platform-one/big-bang/bigbang/-/blob/master/docs/d_prerequisites.md#sonarqube>

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
# Development Strategy

> `Encapsulation week 2`

## todo-list-with-class

### WIREFRAME

![wireframe](/wireframe.png)

---

### 0. Set-Up

_A User can see my initial repository and live demo_

### Repository

- Created a new repository from this [template](https://github.com/HackYourFutureBelgium/encapsulation-starter-wk-3-class/)
- Clone the repository
- Add a wireframe
- Start the development strategy
- Push the changes to GitHub
- Turn on GitHub Pages

---

## 1. Initial HTML and CSS structure and Development strategy

> _assigned to Oguz_

__As a user I want to see the initial page when I load the site__

### Repo

This user story has been developed through a branch called `master`

### HTML

- Created initial user interface according to wireframe

### CSS

- Added some css features

### Javascript

- Nothing to change

---

license: MIT

repository: ibrahimkanber/Todo-Encapsulation

repo_name: ibrahimkanber/Todo-Encapsulation


text:
recordio
========

recordio provides a interface to read/write multiple Protocol Buffers messages
from/to a single binary file.

Forked from [google/or-tools](https://github.com/google/or-tools)

# Usage

See [test.cc](https://github.com/xeno1991/recordio/blob/master/test/test.cc)
for an example

## Write

```cpp
Person person;    // a protobuf message

std::ofstream ofs("example.recordio", std::ios::binary);
recordio::RecordWriter writer(&ofs);

writer.WriteProtocolMessage(person);
writer.Close()
```

## Read

```cpp
std::ifstream ifs("example.recordio", std::ios::binary);
recordio::RecordReader reader(&ifs);

Person person;
while (reader.ReadProtocolMessage(&person)) {
  // do something
}
reader.Close();
```

# Dependencies

- zlib
- protocol buffer

# License

Apache License, Version 2.0 (see the codes for more details)


text:
# PegasusCMDChallenge

Learn and solve cmd problems

## Flow

1. Clone Repository
2. Create branch with your name
3. Head over to [CMD Challenge](https://cmdchallenge.com/) and Solve the challenges
4. For every challenge solved do the following:
   - Create a new file with the challenge name, eg. challenge name: hello world, file name: hello_world.sh
   - Add the problem statement as a comment - Refer examples/hello_world.sh
   - For every file, create a separate commit and push to your branch


text:
---
layout: default
permalink: /installation/
title: Installation
redirect_from:
  - /docs/installation.md/
  - /docs/installation/
---

# Installation

* TOC
{:toc}

We have multiple ways to install Kompose. Our preferred (and most up-to-date) method is downloading the binary from the latest GitHub release.

## GitHub release

Kompose is released via GitHub, you can see all current releases on the [GitHub release page](https://github.com/kubernetes/kompose/releases).

**Linux and macOS:**

```sh
# Linux
curl -L https://github.com/kubernetes/kompose/releases/download/v1.30.0/kompose-linux-amd64 -o kompose

# macOS
curl -L https://github.com/kubernetes/kompose/releases/download/v1.30.0/kompose-darwin-amd64 -o kompose

chmod +x kompose
sudo mv ./kompose /usr/local/bin/kompose
```

**Windows:**

Download from [GitHub](https://github.com/kubernetes/kompose/releases/download/v1.30.0/kompose-windows-amd64.exe) and add the binary to your PATH.

## Go

Installing using `go install` pulls from the main branch with the latest development changes.

```sh
go install github.com/kubernetes/kompose@latest
```

## CentOS

Kompose is in [EPEL](https://fedoraproject.org/wiki/EPEL) CentOS repository.
If you don't have [EPEL](https://fedoraproject.org/wiki/EPEL) repository already installed and enabled you can do it by running `sudo yum install epel-release`

If you have [EPEL](https://fedoraproject.org/wiki/EPEL) enabled in your system, you can install Kompose like any other package.

```bash
sudo yum -y install kompose
```

## Fedora

Kompose is in Fedora 24, 25 and 26 repositories. You can install it just like any other package.

```bash
sudo dnf -y install kompose
```

## macOS

On macOS, you can install the latest release via [Homebrew](https://brew.sh) or [MacPorts](https://www.macports.org/).

```bash
brew install kompose
```

## Windows

Kompose can be installed via [Chocolatey](https://chocolatey.org/packages/kubernetes-kompose)

```console
choco install kubernetes-kompose
```

or using winget

```console
winget install Kubernetes.kompose
```

## Docker

You can build an image from the official repo for [Docker](https://docs.docker.com/engine/reference/commandline/build/) or [Podman](https://docs.podman.io/en/latest/markdown/podman-build.1.html):

```bash
docker build -t kompose https://github.com/kubernetes/kompose.git\#main
```

To run the built image against the current directory, run the following command:

```bash
docker run --rm -it -v $PWD:/opt kompose sh -c "cd /opt && kompose convert"
```

repository: kubernetes/kompose

branch_name: refs/heads/main

gha_language: Go

repo_name: kubernetes/kompose


text:
---
id: use-subscription
title: useSubscription
slug: /api-reference/use-subscription/
---

import DocsRating from '@site/src/core/DocsRating';
import {OssOnly, FbInternalOnly} from 'docusaurus-plugin-internaldocs-fb/internal';
import GraphQLSubscriptionConfig from '../types/GraphQLSubscriptionConfig.md';

## `useSubscription`

Hook used to subscribe and unsubscribe to a subscription.

```js
import {graphql, useSubscription} from 'react-relay';
import {useMemo} from 'react';

const subscription = graphql`
  subscription UserDataSubscription($input: InputData!) {
    # ...
  }
`;

function UserComponent({ id }) {
  // IMPORTANT: your config should be memoized.
  // Otherwise, useSubscription will re-render too frequently.
  const config = useMemo(() => ({
    variables: {id},
    subscription,
  }), [id, subscription]);

  useSubscription(config);

  return (/* ... */);
}
```

### Arguments

* `config`: a config of type [`GraphQLSubscriptionConfig`](#type-graphqlsubscriptionconfigtsubscriptionpayload) passed to [`requestSubscription`](../request-subscription/)
* `requestSubscriptionFn`: `?<TSubscriptionPayload>(IEnvironment, GraphQLSubscriptionConfig<TSubscriptionPayload>) => Disposable`. An optional function with the same signature as [`requestSubscription`](../request-subscription/), which will be called in its stead. Defaults to `requestSubscription`.

<GraphQLSubscriptionConfig />

### Flow Type Parameters

* `TSubscriptionPayload`: The type of the payloads vended by the subscription. You should pass the flow type imported from the auto-generated `.graphql` file corresponding to the subscription, e.g. use `UserDataSubscription` as the type parameter, from `import type {UserDataSubscription} from './__generated__/UserDataSubscription.graphql'`;

### Behavior

* This is only a thin wrapper around the `requestSubscription` API. It will:
  * Subscribe when the component is mounted with the given config
  * Unsubscribe when the component is unmounted
  * Unsubscribe and resubscribe with new values if the environment, config or `requestSubscriptionFn` changes.
* If you have the need to do something more complicated, such as imperatively requesting a subscription, please use the [`requestSubscription`](../request-subscription/) API directly.
* See the [GraphQL Subscriptions Guide](../../guided-tour/updating-data/graphql-subscriptions/) for a more detailed explanation of how to work with subscriptions.

<FbInternalOnly>

:::note
`useSubscription` doesn't automatically add `client_subscription_id`. You may need to provide an arbitrary `client_subscription_id` to `config.variables.input`
:::

</FbInternalOnly>

<DocsRating />

repository: facebook/relay

gha_language: Rust

gha_license_id: MIT

repo_name: facebook/relay


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

### Description

Multiple PHP remote file inclusion vulnerabilities in PBSite allow remote attackers to execute arbitrary PHP code via a URL in the (1) dbpath parameter to (a) useronline.php, (b) ucp.php, (c) setcookie.php, (d) sendpm.php, (e) search.php, (f) register.php, (g) profile.php, (h) post.php, (i) pmpshow.php, (j) pm.php, (k) ntopic.php, (l) nreply.php, (m) news.php, (n) memberslist.php, (o) logout.php, (p) login.php, (q) index.php, (r) help.php, (s) forum.php, (t) error.php, (u) editpost.php, (v) delpost.php, (w) delpm.php, (x) confirm.php, (y) board.php, (z) admin2.php, (aa) admin.php, or (bb) templates/pb/css/formstyles.php; or the (2) temppath parameter to (a) useronline.php, (c) setcookie.php, (e) search.php, (f) register.php, (h) post.php, (l) nreply.php, (m) news.php, (o) logout.php, (p) login.php, (q) index.php, (r) help.php, (s) forum.php, (t) error.php, (w) delpm.php, (x) confirm.php, or (y) board.php.

### POC

#### Reference
- http://securityreason.com/securityalert/2777

#### Github
No PoCs found on GitHub currently.

repository: trickest/cve

gha_language: HTML

repo_name: trickest/cve


text:
# AJAX for JS++

This is a basic AJAX library for JS++. It supports HTTP GET and POST.

Tired of including the entire jQuery library just to make one AJAX call? With JS++ you don't have to. With [dead code elimination](https://en.wikipedia.org/wiki/Dead_code_elimination), if you only send a GET request, the JS++ compiler will *not* compile all of the library's functions for dealing with POST requests.

## Getting Started

In your editor, create a `main.jspp` file:

	import Vendor.Onux.Utils.DOM.AJAX;
	external console;

	AJAX.get("/path/to/some/resource/", void(string result) {
	    console.log("Success: " + result);
	});

Make sure you link the AJAX library when you compile. In your terminal:

    $ js++ main.jspp path/to/ajax-lib/

## License

MIT License

repository: fChristenson/jspp-vs-typescript-vs-flow

repo_name: fChristenson/jspp-vs-typescript-vs-flow


text:
## plaso (Plaso Langar Að Safna Öllu)

*super timeline all the things*

In short, plaso is a Python-based backend engine for the tool
[log2timeline](http://plaso.kiddaland.net "Plaso home of the super timeline").

### A longer version

log2timeline is a tool designed to extract timestamps from various files found
on a typical computer system(s) and aggregate them.

The initial purpose of plaso was to collect all timestamped events of interest
on a computer system and have them aggregated in a single place for computer
forensic analysis (aka Super Timeline).

However plaso has become a framework that supports:

* adding new parsers or parsing plug-ins;
* adding new analysis plug-ins;
* writing one-off scripts to automate repetitive tasks in computer forensic analysis or equivalent.

And is moving to support:

* adding new general purpose parses/plugins that may not have timestamps associated to them;
* adding more analysis context;
* tagging events;
* allowing more targeted approach to the collection/parsing.

### Project status

[Travis-CI](https://travis-ci.com/) | [AppVeyor](https://ci.appveyor.com) | [Codecov](https://codecov.io/) | [ReadTheDocs](https://readthedocs.org)
--- | --- | --- | ---
[![Build Status](https://travis-ci.com/log2timeline/plaso.svg?branch=master)](https://travis-ci.com/log2timeline/plaso) | [![Build status](https://ci.appveyor.com/api/projects/status/7slp4uexetn8bomg?svg=true)](https://ci.appveyor.com/project/log2timeline/plaso) | [![codecov](https://codecov.io/gh/log2timeline/plaso/branch/master/graph/badge.svg)](https://codecov.io/gh/log2timeline/plaso) | [![Documentation Status](https://readthedocs.org/projects/plaso/badge/?version=latest)](https://plaso.readthedocs.io/en/latest/?badge=latest)

### Also see

* [Homepage](https://github.com/log2timeline/plaso)
* [Downloads](https://github.com/log2timeline/plaso/releases)
* [Documentation](https://plaso.readthedocs.io)

repository: joshlemon/plaso

repo_name: joshlemon/plaso


text:
# Test data of tokens
This test data format is [TOML](https://github.com/toml-lang/toml).

## Test Data
```toml
# Single or Multiple data
[[test]]
name = "" # test name
jfol = '''
'''
  [[test.tokens]]
  text = ""
  token = "" # Token Type
```

test.jfol's string must cut last `\r\n` or `\n`(depend on runtime) when your test, because inserting this line breaks means readable test data.
And line break(`\r\n` or `\n`) is expected `\n` on expected result, so replace `\r\n` to `\n` when testing.

## Token Type
```ts
export type TokenType =
    | "Text"
    | "Dollar"
    | "DoubleDollar"
    | "LeftParenthesis" /* ( */
    | "RightParenthesis" /* ) */
    | "LeftSquareBracket" /* [ */
    | "RightSquareBracket" /* ] */
    | "Dot"
    | "Colon"
    | "SemiColon"
    | "Comma"
    | "Space"
    | "DoubleQuotation" /* " */
    | "Equal"
    | "Plus"
    | "Minus"
    | "Slash"
    | "Asterisk"
    | "Percent"
    | "Bang" /* ! */
    | "Ampersand" /* & */
    | "VerticalLine" /* | */
    | "LessThan" /* < */
    | "GreaterThan" /* > */;
```


text:
# Generate-Resume

This CLI will help you generate your resume in HTML and PDF.

### How to use this library

1. Install the library using `npm` as follows:
  ```
  npm install -g generate-resume
  ```
2. Write your information in XML format and save it in some file, e.g. `resume.xml`. The schema can be found in [bin/reference-xml/resume.xml](bin/reference-xml/resume.xml).

3. Execute the following command:
  ```
  generate-resume <path-to-XML-file>/resume.xml
  ```
4. Your resume in HTML and PDF format will be generated in your current directory.

The library uses templates written in Pug (erstwhile Jade) format.

Demo: http://www.sumeetdas.me/resume

repository: sumeetdas/Generate-Resume

repo_name: sumeetdas/Generate-Resume


text:
Pico Robots
===========

This is the repository of Pico's official robots plugin.

Pico is a stupidly simple, blazing fast, flat file CMS. See http://picocms.org/ for more info.

`PicoRobots` is a simple plugin that add a `robots.txt` and `sitemap.xml` to your website. Both the [robots exclusion protocol][RobotsProtocol] (`robots.txt`) and the [Sitemaps protocol][SitemapsProtocol] (`sitemap.xml`) are used to communicate with web crawlers and other web robots. `robots.txt` informs the web robot about which areas of your website should not be processed or scanned. `sitemap.xml` allows web robots to crawl your website more intelligently. `sitemap.xml` is a URL inclusion protocol and complements `robots.txt`, a URL exclusion protocol.

Install
-------

`PicoRobots` requires Pico 2.0+

If you're using a `composer`-based installation of Pico (e.g. [`picocms/pico-composer`][PicoComposer]), simply open a shell on your server, navigate to Pico's install directory (e.g. `/var/www/html`) and run `composer require phrozenbyte/pico-robots` (via [Packagist.org][]). That's it!

If you're rather using one of [Pico's pre-built release packages][PicoRelease], you need to first create an empty `plugins/PicoRobots` directory in Pico's install directory (e.g. `/var/www/html`) on your server. Then download [`PicoRobot`'s latest source package][PicoRobotsRelease] and upload all containing files (esp. `PicoRobots.php` and the `theme` directory) into the said `plugins/PicoRobots` directory.

And that's it! The resulting structure in your `plugins` directory should look like this:

```
plugins/
└── PicoRobots/
	 ├── PicoRobots.php
	 └── theme/
		 ├── robots.twig
		 └── sitemap.twig
```

You can copy the `theme` directory into your own theme directory under `./themes/yourtheme`. This enables you to overwrite the plugin's templates in your theme without the need to fiddle around with the plugin's files. Even in this case, though, you still need to keep this plugin's original `theme` directory and its contents in `./plugins/PicoRobots`.

Config
------

After installing `PicoRobots`, you can navigate to your `robots.txt` (http://example.com/pico/robots.txt) and `sitemap.xml` (http://example.com/pico/sitemap.xml) using your favourite web browser. As you can see, `robots.txt` just holds a reference to your website's `sitemap.xml` by default. The default `sitemap.xml` lists all your website's pages with the last modification time as specified by the Markdown file's last modification time reported by your server's operating system. Pretty convenient, right?

As always, you can adjust `PicoRobot`'s behavior to fit your needs. First we'll start with the `robots.txt`:

#### More about `robots.txt`

The `robots.txt` consists of a arbitrary number of URL exclusion rules separated by paragraphs (i.e. a empty line). A rule consists of one or more `User-agent` rows to state which web robots are concerned, and one or more `Disallow` rows to state which URLs shouldn't be processed or scanned by said web robots. Optionally you can add one or more `Allow` rows to specify exceptions to the `Disallow` rows. Please refer to Wikipedia's article about the [robots exclusion protocol][RobotsProtocol] for more information.

You can add URL exclusion rules to your `robots.txt` by using Pico's `config/config.yml` (or any other config file in the `config` dir, e.g. `config/PicoRobots.yml`). Rather than extensively describing the config syntax, a example says more than a thousand words. So, by adding the following configuration to your `config/config.yml`

```yml
PicoRobots:
  robots:
    - user_agents: "BadBot"
      disallow: "/"
    - user_agents: "*"
      disallow: [ "/private/", "/admin/" ]
      allow: "/private/about_me"
```

you get the following two rules in your `robots.txt`

```
User-agent: BadBot
Disallow: /

User-agent: *
Disallow: /private/
Disallow: /admin/
Allow: /private/about_me
```

The first rule (line 1 and 2) tells `BadBot` (`User-agent: BadBot`) not to crawl your website at all (`Disallow: /`). The second rule (lines 4 to 7) tells any other web robot (`User-agent: *`) not to crawl your website's `private` (`Disallow: /private/`) and `admin` (`Disallow: /admin/`) folders. As an exception to this, crawling the `private/about_me` page (`Allow: /private/about_me`) is fine. It implicitly also tells any web robot (except `BadBot`) that crawling your website is basically fine.

The `robots.txt` doesn't affect Pico's `Robots` meta header in the YAML Frontmatter of your Markdown files in any way (as long as your theme uses that information to add a `<meta name="robots" content="..." />` tag to your website). You should rather use the `Robots` meta header than the `robots.txt` to disallow crawling a single page.

`PicoRobots` uses the `theme/robots.twig` template to create the contents of `robots.txt`. If you want to add some custom logic to your `robots.txt`, simply add a `robots.twig` to your theme and use `PicoRobot`'s `theme/robots.twig` as a starting point. Pico will automatically use your theme's `robots.twig` rather than `PicoRobot`'s default one.

The plugin furthermore exposes a simple API to allow other plugins to access and add URL exclusion rules to your `robots.txt`. As a plugin developer you may use the `PicoRobots::getRobots()` method to get a list of all URL exclusion rules. `PicoRobots` furthermore triggers the custom `onRobots(array &$robots)` event with the following payload, allowing you to add custom rules to the website's `robots.txt`.

```php
$robots = [
    [
        'user_agents' => string[],  /* list of user agents, or '*' to match all web robots */
        'disallow'    => string[],  /* list of URLs that shouldn't be crawled */
        'allow'       => string[]   /* list of disallowed URLs that are allowed to be crawled even though */
    ],
    …
]
```

Please note that URL exclusion rules in your `robots.txt` won't affect your website's `sitemap.xml` created by `PicoRobots` in any way.

#### More about `sitemap.xml`

`sitemap.xml` is a [XML][]-based protocol to help web robots to crawl your website more intelligently. It consits of one or more `<url>` records, telling web robots what URLs (the `<loc>` tag) should be crawled. You can optionally tell web robots when a page was last modified (`<lastmod>` tag) and how frequently the page may change (`<changefreq>` tag, possible values are `always`, `hourly`, `daily`, `weekly`, `monthly`, `yearly` and `never`). By adding the optional `<priority>` tag, you can suggest web robots which pages are considered more important than others (the valid range is from `0.0` to `1.0`, with `1.0` being the most important; the default value is `0.5`). Please refer to Wikipedia's article about the [Sitemaps protocol][SitemapsProtocol] for more information.

`PicoRobot`'s default `sitemap.xml` lists all your website's pages with the last modification time as specified by the Markdown file's last modification time reported by your server's operating system. If you don't want a particular page to be in the `sitemap.xml`, simply add the `Sitemap: false` meta header to the page's YAML Frontmatter. `PicoRobots` will automatically exclude inaccessible pages (pages whose file name starts with a `_`) and pages with the `Robots: noindex` meta header in the YAML Frontmatter.

The `Sitemap` meta header can also be used to specify a page's change frequency and priority, as well as overwriting the page's last modification time. If you want to tell web robots that a page is usually changed once per week, was last changed on 1 December 2017, and has a increased priority of `0.7`, add the following to the page's YAML Frontmatter:

```yml
Sitemap:
    lastmod: 2017-12-01
    changefreq: weekly
    priority: 0.7
```

You can furthermore use Pico's `config/config.yml` (or any other config file in the `config` dir, e.g. `config/PicoRobots.yml`) to add more records to your `sitemap.xml`. If you want to add a record for the dynamically created page `team/max-mustermann` (the page is dynamically created by a plugin and there is no `content/team/max-mustermann.md`, thus it isn't in the `sitemap.xml` by default) to your `sitemap.xml`, add the following to your `config/config.yml`

```yml
PicoRobots:
  sitemap:
    - url: %base_url%?team/max-mustermann
      changefreq: yearly
```

to get the following record in your `sitemap.xml`

```xml
    <url>
        <loc>http://example.com/pico/team/max-mustermann</loc>
        <changefreq>yearly</changefreq>
    </url>
```

As you can see, `PicoRobots` interprets the `%base_url%` placeholder the same way as in Markdown files and replaces it by the website's base URL. As with the `Sitemap` meta header in a page's YAML Frontmatter, you may add `lastmod`, `changefreq` and `priority` keys to the config to specify a URL's last modification time, change frequency and priority.

`PicoRobots` uses the `theme/sitemap.twig` template to create the contents of `sitemap.xml`. If you want to add some custom logic to your `sitemap.xml`, simply add a `sitemap.twig` to your theme and use `PicoRobot`'s `theme/sitemap.twig` as a starting point. Pico will automatically use your theme's `sitemap.twig` rather than `PicoRobot`'s default one.

The plugin furthermore exposes a simple API to allow other plugins to access and add sitemap records to your `sitemap.xml`. As a plugin developer you may use the `PicoRobots::getSitemap()` method to get a list of all sitemap records. `PicoRobots` furthermore triggers the custom `onSitemap(array &$sitemap)` event with the following payload, allowing you to add custom records to the website's `sitemap.xml`.

```php
$sitemap = [
    [
        'url'              => string,   /* URL of the concerned page, including the protocol */
        'modificationTime' => int,      /* Unix timestamp of the page's last modification time */
        'changeFrequency'  => string,   /* how frequently the contents of the page may change */
        'priority'         => float     /* priority of that URL relative to other URLs on the site */
    ],
    …
]
```

[RobotsProtocol]: https://en.wikipedia.org/wiki/Robots_exclusion_standard
[SitemapsProtocol]: https://en.wikipedia.org/wiki/Sitemaps
[PicoComposer]: https://github.com/picocms/pico-composer
[Packagist.org]: https://packagist.org/packages/phrozenbyte/pico-robots
[PicoRelease]: https://github.com/picocms/Pico/releases/latest
[PicoRobotsRelease]: https://github.com/PhrozenByte/pico-robots/releases/latest
[XML]: https://en.wikipedia.org/wiki/XML

repository: PhrozenByte/pico-robots

gha_language: PHP

repo_name: PhrozenByte/pico-robots


text:
# List unused requirements

The _list-unused-requirements_ command is a complementary tool to the _detect_ command that allows you to easily clean
your configuration. It lists the requirements that are not necessary anymore for each rule :

```bash
    php bin/php-coupling-detector list-unused-requirements
```

Like the _detect_ command, you can specify the path to the configuration file with the ``--config-file`` option.

The exit status of the _list-unused-requirements_ command can be: ``10`` if some unused requirements have been found,
or ``0`` otherwise.

Please note that for the moment this is relevant only for rules of type ``ONLY`` as the notion of "unused requirement"
in a ``DISCOURAGED`` or ``FORBIDDEN`` rule makes no sense.

repository: akeneo/php-coupling-detector

repo_name: akeneo/php-coupling-detector


text:
# Dijkstra’s Algorithm

`Dijkstra's algorithm` is an algorithm for finding the shortest paths between nodes in a graph. It was conceived by computer scientist Edsger W. Dijkstra in 1956 and published three years later. In artificial intelligence, Dijkstra's algorithm or a variant of it is known as `uniform cost search` and formulated as an instance of the more general idea of `best-first search`. From a dynamic programming point of view, `Dijkstra's algorithm` is a successive approximation scheme that solves the `dynamic programming` functional equation for the shortest path problem by the `Reaching` method.

## Problem

Given a source vertex s from set of vertices V in a weighted graph where all its edge weights w(u, v) are non-negative, find the shortest-path weights d(s, v) from given source s for all vertices v present in the graph

## Algorithm

> Dijkstra’s Algorithm is based on the principle of relaxation, in which an approximation to the correct distance is gradually replaced by more accurate values until shortest distance is reached. The approximate distance to each vertex is always an overestimate of the true distance, and is replaced by the minimum of its old value with the length of a newly found path. It uses a priority queue to greedily select the closest vertex that has not yet been processed and performs this relaxation process on all of its outgoing edges.

## Time Complexity

O(|E| + |V|log|V|)

## Code

   ```python
   def dijkstra(g, source, N):
    heap = []
    heappush(heap, (0, source))

    dist = [sys.maxsize for _ in range(N)]
    dist[source] = 0
    visited = [False for _ in range(N)]
    visited[source] = True
    parent = [None for _ in range(N)]
    parent[source] = -1

    while heap:
       print(heap)
       weight, u = heappop(heap)

       for edge in g.edges(u):
          v = edge.dest
          w = edge.weight
          if visited[v] == False and dist[u] + w < dist[v]:
                dist[v] = dist[u] + w
                parent[v] = u
                heappush(heap, (dist[v], v))

       visited[u] = True

    for i in range(N):
        print("Path from vertex " + str(source) + " to vertex " + str(i) +
                            " has minimum cost of " + str(dist[i]) +
                            " and the route is [", end = ' ')
        print_path(parent, i)
        print("]")

def print_path(parent, i):
    if i < 0:
        return
    print_path(parent, parent[i])
    print(str(i), end=" ")
   ```

References:

[https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm](https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm)

[Single-Source Shortest Paths – Dijkstra’s Algorithm](http://www.techiedelight.com/single-source-shortest-paths-dijkstras-algorithm/)

repository: nootfly/CodeMoments

repo_name: nootfly/CodeMoments


text:
# [TalkLocal](http://alexa.amazon.com/#skills/amzn1.echo-sdk-ams.app.f3413a23-9bcd-466b-b6d2-7c95371fc66b)
![5 stars](../../images/ic_star_black_18dp_1x.png)![5 stars](../../images/ic_star_black_18dp_1x.png)![5 stars](../../images/ic_star_black_18dp_1x.png)![5 stars](../../images/ic_star_black_18dp_1x.png)![5 stars](../../images/ic_star_black_18dp_1x.png) 1

To use the TalkLocal skill, try saying...

* *Alexa, ask Talk Local to repair my toilet that keeps running*

* *Alexa, tell Talk Local that I have a clogged sink in our kitchen*

* *Alexa, ask Talk Local to finish completing our bathroom and install a new toilet and vanity*

TalkLocal helps you connect with and get estimates from the best local service professionals, usually within a few minutes. Currently, TalkLocal can help you find a plumber.  We will be adding services such as handymen, painters, roofers, and others soon.

We compare and rank all local service professionals based on reviews, call analytics, social standing, and job preferences and notify them immediately of your service needs.  Up to 3 service professionals can respond and call you directly.

***

### Skill Details

* **Invocation Name:** talk local
* **Category:** null
* **ID:** amzn1.echo-sdk-ams.app.f3413a23-9bcd-466b-b6d2-7c95371fc66b
* **ASIN:** B01EIT5YHM
* **Author:** Talk Local
* **Release Date:** May 12, 2016 @ 18:41:47
* **Privacy Policy:** http://www.talklocal.com/legal/privacy_policy.php
* **Terms of Use:** http://www.talklocal.com/legal/terms_of_use.php
* **In-App Purchasing:** No


text:
# bash

## bash

[Here’s the expanded list:](https://medium.com/p/f1bbcd632fd0)

[My Personal Arsenal Of Convenience Scripts](https://medium.com/p/3c7869fdae53)

[The Penultimate Web Developer’s Cheat Sheet](https://medium.com/p/a02a423139a4)

[BASH CHEAT SHEET](https://medium.com/p/d3077114aea7)

[Life Saving Bash Scripts Part 2](https://medium.com/p/b40c8ee22682)

By bryanguner on July 16, 2021.

[Link to list](https://medium.com/@bryanguner/list/37e89077bb28)

Exported from [Medium](https://medium.com) on September 12, 2021.


text:
# Chatty Project

Chatty Kathy is a simple, single-page chat application created using React and WebSockets.

## Getting Started

1. Fork this repository, then clone your fork of this repository.
2. Install dependencies using the `npm install` command.
3. Start the web server using the `npm run local` command. The app will be served at <http://localhost:3000/>.
4. Start the web socket server by changing into the 'chatty_server' directory and using the `npm run local` command. The web socket will be served at <http://localhost:3001>
5. Go to <http://localhost:3000/> in your browser.

## Dependencies

### `chatty-app`
  - babel-core
  - babel-loader
  - babel-preset-es2015
  - babel-preset-react
  - babel-preset-stage-0
  - css-loader
  - node-sass
  - sass-loader
  - sockjs-client
  - style-loader
  - webpack
  - webpack-dev-server
  - express
  - react
  - react-dom
  - uuid
  - ws

### `chatty_server`
  - express
  - uuid
  - ws

## Screenshots

!["Screenshot of Chatty Kathy"](https://github.com/emmarskillings/chatty-app/blob/master/docs/chatty-cathy.png)

repository: emmarskillings/chatty-app

repo_name: emmarskillings/chatty-app


text:
---
title: Style The Application Button
page_title: Style The Application Button
description: Style The Application Button
slug: radribbonview-howto-style-app-button
tags: style,the,application,button
published: True
position: 11
---

# Style The Application Button

The default look of the application button is an empty rectangular button similar to the one on the next snapshot:
![Rad Ribbon View How To Style The Application Button 02](images/RadRibbonView_HowTo_StyleTheApplicationButton_02.png)

When you want to set a picture in this button you can use the __ApplicationButtonImageSource__ property. The result may look like this

#### __XAML__

{{region radribbonview-howto-style-app-button_0}}
	<telerik:RadRibbonView x:Name="xRibbonView" ApplicationButtonImageSource="Images/3dRedButton.png">
		...
	</telerik:RadRibbonView>
{{endregion}}

![Rad Ribbon View How To Style The Application Button](images/RadRibbonView_HowTo_StyleTheApplicationButton.png)

Also for further customization you can set the following properties:
* ApplicationButtonContent
* ApplicationButtonStyle
* ApplicationButtonVisibility
* IsApplicationButtonEnabled

gha_license_id: NOASSERTION


text:
# Stagonospora samarorum (Desm.) Boerema, 1970 SPECIES

#### Status
ACCEPTED

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

#### Published in
Persoonia 6(1): 25 (1970)

#### Original name
Phoma samarorum Desm., 1828

### Remarks
null

repository: mdoering/backbone

repo_name: mdoering/backbone


text:
# Changelog

It aims to save the big change of features or codes for [zhonger/nav]() project.

**1.1.1**

- Support customized search engine icons and links type icons
- Support customized page title
- Add more available search engines and search urls

**1.1.0**

- Add Qweather plugin (support all cities in China and most cities in the world)
- Support Chinese and English

**1.0.0**

- Add search engines
- Add links
- Add one poem

repository: zhonger/nav

repo_name: zhonger/nav


text:
CLIENT - JavaScript MVC
=============

A client built from MVC basics, not using any particular framework.

### The case for

The upside of a build-your-own client architecture is that it can be extremely flexible.  At no point will development be stopped because the surrounding framework is unable to account for a specific use case.  Performance can be maximized, because the code will be custom to the application's specific usage patterns.

Building the framework from scratch can be a good choice for projects which will need to be complex, performant, and maintained for a long period of time.  It's can also be a good choice for retrofitting existing projects due to its high levels of encapsulation and flexibility of application.

### The case against
Most companies are not in the business of building frameworks, so time spent on the internals may carry a somewhat larger opportunity cost.  Many challenges with the framework itself will have already been solved by other frameworks, leading to some potentially wasted effort.

Another downside of a build-your-own client architecture is that it can be somewhat fragile.  A solid understanding of the fundamentals is required for all who work on the project, and any shortcuts taken have to be considered especially carefully, lest they silently grow into big problems.

A custom framework is typically not a good fit for prototyping or rapid initial development, or for teams with mixed skill levels.

## Setup

Configure your favorite web server to serve up the www directory, using nginx or the like.

As is the case for all of the JavaScript clients, the web server will need to present the API endpoints as though they're on the same domain as the static HTML files to satisfy browsers' same-domain policies.  Normally, this is done by way of a transparent proxy for those endpoints.

Please see your web server's documentation for how to set this up.  [An example for nginx can be found here.](http://nginx.org/en/docs/beginners_guide.html#proxy)

Note that all endpoints are served from the /api/ path, which should simplify configuration somewhat.

## Notes

This client follows a traditional MVC-style architecture, breaking up the visual page into small, self-contained widgets.  Business model objects are kept separate from client model objects.  View updating is done by subscribing to updates from its model, which always triggers a refresh of all of its data fields.  Even though it's a little extra wiring, DOM events are the domain of the views so that the models and controllers might be re-usable in a non-browser context.

Alternate variants of MVC exist, of course, but this structure was chosen for its ease of implementation and its flexibility.

## Libraries Used

* [jsclass](http://jsclass.jcoglan.com/) is used to ease working with the class inheritance mechanisms that are a hallmark of MVC development.
* [jQuery](http://jquery.com/) is used to ease working with the DOM.

gha_language: Python


text:
At a very high level, I would like:

1.  To ensure the dungeon is connected.

2.  To allow flexibility to mix many different generation algorithms together:
    rooms and passages, caverns, cellular automata, rivers, lakes, castles, etc.

3.  To be able to apply different tile styles to any given algorithm: lakes of
    lava, wooden rooms, etc.

There is some tension here. Any over-arching system for ensuring connectivity
tends to presume or favor a certain algorithm for generating dungeons. I think a
lot of my thrashing is because I'm trying to make the one meta-dungeon generator
to rule them all, which means avoiding any constraints on the algorithms, which
prevents me from making any progress.

Ultimately, the goal is to ship one game with rich dungeons but not, like, an
infinite number of algorithms. I probably need to make some choices and be more
specific.

The junction system used by the rooms biome seems to work pretty well and can
fairly naturally extend to different kinds of "rooms", where a "room" might be
an entire region of the dungeon carved out using a different algorithm.

The current river/lake code looks nice but the fact that it relies on
*hopefully* getting connected to rooms has always been pretty dubious.

Also, the current code doesn't seem to scale well. As I try to add more
features, the complexity quickly gets overwhelming. It seems like there's a
missing abstraction preventing different pieces of the system from composing.

As far as styling and places go, there's an unsolved problem where it's not
clear which "side" owns doors and walls shared between two places. We can
probably solve that by just picking arbitrarily.

## Aquatics

Lakes aren't too hard to incorporate into the rooms-and-junctions system. We
could just generate lake "rooms" on demand and attach them. Rivers are harder
because they are so big and span the whole dungeon.

There is possibly room to improve how they look and work anyway. It could be
cool if a room could span a river with a bridge to get from one side to the
other. Or a room could open into a lake. Rivers and lakes could exist without
shores. You could imagine two rooms opening onto different sides of the same
lake -- you could see the other room, but have to find a different path to
actually reach it.

## Passages

Brian Walker's technique for carving random passages works amazingly well
(though it is kind of slow). I think there's a promising approach for connecting
natural areas (shores, caverns) to each other and to built (rooms) structures
using it. Something like:

1.  Fill the edge of the dungeon with rock and the center with some temporary
    open tile that means "maybe passage maybe filled". We'll say dirt.

2.  Place rivers and lakes as it already does. Either with or without shore
    tiles should work.

3.  Consider placing some caverns. A cellular automata with varying density
    seems to work well, that way some areas of the dungeon don't have any caves
    at all to leave room for rooms. These replace some of the fillable dirt
    tiles with guaranteed open tiles.

4.  Try to find a spot to place a starting room. If this fails, the dungeon is
    too full of natural areas. That's OK. Skip to 7.

5.  Place the room. That means setting its floor to floor but *not* filling in
    its walls. Place junctions as usual.

6.  Spreading out from those junctions try to place more rooms using the normal
    room and passage algorithm.

7.  At this point, the dungeon is fully connected because, aside from water,
    it's nothing but either dirt or floor tiles. Lakes aren't allowed too close
    to edges or rivers, so there is always room to get around them. Rivers have
    bridges.

8.  Find all of the permanent floor tiles -- cave floors, room floors, shores.
    Find all of the fillable dirt tiles. Now, use Brian Walker's technique to
    fill in as many fillable tiles as possible while still ensuring all the
    permanent floor tiles are connected.

    This will create passageways between the natural areas and rooms as needed.
    It will eventually fill in "walls" around all of the rooms too. (We don't
    do that eagerly because this lets natural areas create passageways into
    rooms wherever they need to.)

9.  Now we have a still-connected but filled in dungeon with lots of different
    regions. But it's generically tiled. Use the place/room data to go back and
    "style" things by swapping out rock and floor tiles for more interesting
    ones.

repository: munificent/hauberk

filename: 2018-10-14 dungeon architecture.md

gha_language: Dart

repo_name: munificent/hauberk


text:
The Oil Pump is a placeable machine added in the [GPS](https://github.com/Slimefun/Slimefun4/wiki/GPS) category.

## Obtaining
The Oil Pump can be crafted in an [Enhanced Crafting Table](https://github.com/Slimefun/Slimefun4/wiki/Enhanced-Crafting-Table).

## Usage
The Oil Pump requires chunk to be scanned using a [GPS Geo-Scanner](https://github.com/Slimefun/Slimefun4/wiki/GPS-Geo-Scanner) or a [Portable Geo-Scanner](https://github.com/Slimefun/Slimefun4/wiki/Portable-Geo-Scanner).
</br> Oil Pump also requires electricity.

The Oil Pump is used to mine [Oil](https://github.com/Slimefun/Slimefun4/wiki/Bucket-of-Oil).

repository: Seggan/Wiki

repo_name: Seggan/Wiki


text:
# Linode Setup

> How to setup [Linode][linode].

The following are notes on how to setup [Linode][linode]. The initial setup steps have been mainly compiled from the [Linode][linode] getting started guides, which collectively provide a good starting point for basic configuration.

1. [Provision](#provision)
1. [Remote Access](#remote-access)
1. [Basic Ubuntu Setup](#basic-ubuntu-setup)
1. [Basic Security Setup](#basic-ubuntu-setup)
1. [Reverse DNS](#reverse-dns)
1. [Software](#software)
1. [Sites](#sites)
1. [References](#references)

---

## Provision

To provision a new [Linode][linode] server, see the getting started [guide][linode-getting-started]. After a few minutes, a [Linode][linode] server will be provisioned. This guide assumes you have chosen `Ubuntu 14.04 LTS` as your base image.

---

## Remote Access

To connect to a [Linode][linode] server,

``` bash
$ ssh root@<your_server_ip>
```

where your server IP may be found via

```
Linodes --> dashboard --> Remote Access
```

You will be prompted for the `root` password you created when deploying a new image to your [Linode][linode].

---

## Basic Ubuntu Setup

To set up your new server, do as follows...

#### Hostname

Set the server hostname. The hostname should be unique (similar to naming a person or pet). For example,

``` bash
$ echo "myserver" > /etc/hostname
$ hostname -F /etc/hostname
```

Verify that the hostname was set:

``` bash
$ hostname
```

#### Hosts

Set the server's full-qualified domain name (FQDN) by updating the `/etc/hosts` file.

``` bash
$ sudo nano /etc/hosts
```

Update the `/etc/hosts` file to include your FQDN:

```
<IP_ADDRESS> 	localhost.localdomain 	localhost
<IP_ADDRESS> 	ubuntu
<your_server_ip> myserver.<your_domain> 	myserver
<your_ipv6_ip> myserver.<your_domain> 	myserver
```

where `<your_server_ip>` is your server's IP address and `<your_domain>` is a domain over which you have control; e.g., `example.com`.

The assigned FQDN should have a corresponding "A" record in DNS pointing to your server's IPv4 address and an "AAAA" record in DNS pointing to your server's IPv6 address. Doing so allows you to easily resolve your server when using, e.g., SSH.

``` bash
$ ssh myserver.<your_domain>
```

For more information, see the "Adding DNS Records" section in the Linode [guide][linode-hosting-website].

#### Timezone

Set the server timezone:

``` bash
$ dpkg-reconfigure tzdata
```

Verify that the date is correct:

``` bash
$ date
```

#### Update

Install any available updates and security patches:

``` bash
$ apt-get update
$ apt-get upgrade --show-upgraded
```

---
## Basic Security Setup

To setup basic security and protect the server from unauthorized access, do as follows...

#### Two-Factor Authentication

You are encouraged to setup two-factor authentication when logging in to the Linode manager. From the Linode manager, navigate to

```
My Profile --> Password & Authentication --> Two-Factor Authentication
```

#### User

You are recommended to never use `root` for day-to-day tasks. A `root` user has the ability to execute any command, including commands which could break your server. For most tasks, you can use an account having normal permissions and execute `superuser` commands using `sudo`. To add a new user,

``` bash
$ adduser <your_username>
```

where `<your_username>` if your desired user name. Add the user to the `sudo` group:

``` bash
$ usermod -a -G sudo <your_username>
```

Logout from the server and then login with the new user:

``` bash
$ logout
$ ssh <your_username>@<your_server_ip>
```

#### SSH

SSH keys allow you to authenticate using a public-private key pair and remove the need for password-based authentication.

__WARNING__: do __not__ complete the following steps from a publicly shared computer. Run the commands from your local computer.

##### Generate SSH keys

If you have already generated SSH keys before (e.g., when configuring GitHub to use SSH), you can skip the following step. To generate SSH keys,

``` bash
$ ssh-keygen -t rsa -C "<your_email_address>"
```

When prompted, create a strong password. If you use a Mac, the password can be added to your keychain.

##### Copy the public key

Copy the public key to the server using the secure copy command `scp` from your local computer.

``` bash
$ scp ~/.ssh/id_rsa.pub <your_username>@<your_server_ip>:
```

Remember the `:` at the end. Once copied to our Linode server, we need to create a new directory on that server to store the public key and set the appropriate permissions.

``` bash
$ mkdir .ssh
$ mv id_rsa.pub .ssh/authorized_keys
$ chown -R <your_username>:<your_username> .ssh
$ chmod 700 .ssh
$ chmod 600 .ssh/authorized_keys
```

##### Disable SSH password authentication

If you connect to your Linode from only one computer, you should disable password authentication and require that all users authenticate using key-based authentication. If you need to connect from multiple computers, you may want to keep password authentication enabled to prevent having to copy your private key to multiple computers.

``` bash
$ sudo nano /etc/ssh/sshd_config
```

Change `PasswordAuthentication` to `no`. You may need to remove the `#` symbol to uncomment the line.

```
PasswordAuthentication no
```

Change the `PermitRootLogin` option to `no`.

```
PermitRootLogin no
```

Restart the SSH service.

``` bash
$ sudo service ssh restart
```

After the SSH service restarts, the SSH configuration changes will be applied.

##### Change the SSH port

Since all Ubuntu servers have a `root` user and most servers run SSH on port `22` (default), hackers often use automated attacks to guess the `root` password. We already prevented the `root` user from using SSH to login (see above). We can make things more difficult by changing our SSH port to a port other than `22`.

``` bash
$ sudo nano /etc/ssh/sshd_config
```

Set the `Port` to a value less than `1024`; e.g., `567`.

```
Port 567
```

Save the file and restart the SSH service.

``` bash
$ sudo service ssh restart
```

Now, when connecting to our Linode server, we need to specify the SSH port.

``` bash
$ ssh<EMAIL_ADDRESS>-p 567
```

#### Fail2Ban

[Fail2Ban][fail2ban] is an application that prevents dictionary attacks on your server. [Fail2Ban][fail2ban] can monitor login attempts across different protocols (SSH, HTTP, SMTP) and will create temporary firewall rules to block traffic from an attacker's IP address. To install,

``` bash
$ sudo apt-get install fail2ban
```

To configure,

``` bash
$ sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
$ sudo nano /etc/fail2ban/jail.local
```

In __both__ the `[ssh]` and `[ssh-ddos]` sections, set the `port` to the SSH port you specified above.

```
[ssh]

enabled 	= true
port 		= <your_ssh_port>
```

In the `[ssh-ddos]` section, set `enabled` to `true`.

```
[ssh-ddos]

enabled 	= true
port 		= <your_ssh_port>
```

Some additional configuration changes (optional):
*	Set the `bantime` option to specify how long a ban should last.
*	Set the `maxretry` option to specify the number of allowed retries before an IP is banned.

Save the file and restart Fail2Ban.

``` bash
$ sudo service fail2ban restart
```

Once running, Fail2Ban will block any IP address which exceeds the maximum allowed connection attempts and will log the event to `/var/log/fail2ban.log`.

#### Firewall

Create a firewall to limit and block unwanted inbound traffic. To see the current rules,

``` bash
$ sudo iptables -L
```

which, beside any rules created by Fail2Ban, should contain an empty ruleset. To create a file for specifying filewall rules,

``` bash
$ sudo nano /etc/iptables.firewall.rules
```

Paste the following into the opened file. By default, the rules allow traffic to the following services and ports: HTTP (80), HTTPS (443), SSH (`<your_ssh_port>`), and ping. Be sure to replace `<your_ssh_port>` with the port specified in `sshd_config` above.

```
*filter

#  Allow all loopback (lo0) traffic and drop all traffic to 127/8 that doesn't use lo0
-A INPUT -i lo -j ACCEPT
-A INPUT -d <IP_ADDRESS>/8 -j REJECT

#  Accept all established inbound connections
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

#  Allow all outbound traffic - you can modify this to only allow certain traffic
-A OUTPUT -j ACCEPT

#  Allow HTTP and HTTPS connections from anywhere (the normal ports for websites and SSL).
-A INPUT -p tcp --dport 80 -j ACCEPT
-A INPUT -p tcp --dport 443 -j ACCEPT

#  Allow SSH connections
#
#  The -dport number should be the same port number you set in sshd_config
#
-A INPUT -p tcp -m state --state NEW --dport <your_ssh_port> -j ACCEPT

#  Allow ping
-A INPUT -p icmp --icmp-type echo-request -j ACCEPT

#  Log iptables denied calls
-A INPUT -m limit --limit 5/min -j LOG --log-prefix "iptables denied: " --log-level 7

#  Drop all other inbound - default deny unless explicitly allowed policy
-A INPUT -j DROP
-A FORWARD -j DROP

COMMIT
```

Save the file and then activate the firewall rules.

``` bash
$ sudo iptables-restore < /etc/iptables.firewall.rules
```

Verify the rules:

``` bash
$ sudo iptables -L
```

To ensure that the firewall rules are activated each time your Linode restarts, open

``` bash
$ sudo nano /etc/network/if-pre-up.d/firewall
```

and paste

```
#!/bin/sh
/sbin/iptables-restore < /etc/iptables.firewall.rules
```

Save the file and set file permissions.

``` bash
$ sudo chmod +x /etc/network/if-pre-up.d/firewall
```

---

## Reverse DNS

While DNS allows a domain name to be resolved to an IP address, reverse DNS allows an IP address to be resolved to a domain name. Reverse DNS is useful when network troubleshooting (`ping`, `traceroute`). From the Linode manager, navigate to

```
Linodes --> Remote Access --> Reverse DNS
```

and enter your domain.

---

## Software

#### Compiler

A compiler is often required to install packages and software. To install one,

``` bash
$ sudo apt-get install build-essential
```

#### Git

Install [git][git]:

``` bash
$ sudo apt-get install git
```

Once installed, configure for use with [GitHub][github-git].

``` bash
$ git config --global user.name "<your_github_username>"
$ git config --global user.email "<your_github_email>"
```

To interact with GitHub over SSH, first check for any existing SSH keys on your server.

``` bash
$ ls -al ~/.ssh
```

If you see an existing private-public key pair which you can use with GitHub, skip the next step. To generate a new SSH key,

``` bash
$ ssh-keygen -t rsa -b 4096 -C "<your_github_email>"
```

Accept the default file name. When prompted, enter a __strong__ passphrase. Once a key is generated, you will see a key fingerprint in your terminal.

To configure the [ssh-agent][ssh-agent] program to use your SSH key, start the agent in the background

``` bash
$ eval "$(ssh-agent -s)"
```

and add your SSH key

``` bash
$ ssh-add ~/.ssh/id_rsa
```

where `<id_rsa>` corresponds to the name of an existing SSH key, if not generated above. Next, copy the public key,

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

and add to your list of SSH keys on [GitHub][github-ssh-keys]. To verify that everything is working,

``` bash
$ ssh -T<EMAIL_ADDRESS>```

Verify the fingerprint and type `yes`. If the user name matches yours, everything works as expected.

#### Python

Install Python environment:

``` bash
$ sudo apt-get install python-pip python-dev
$ sudo pip install virtualenv
```

The above creates a global `pip` command to install Python packages. You are encouraged __not__ to use it, as packages will be installed globally. Instead, use `virtualenv`.

To create a new virtual Python environment,

``` bash
$ virtualenv --distribute <environment_name>
```

where `<environment_name>` is the name of your choosing; e.g., `python/dev`. To switch to the new environment,

``` bash
$ cd <environment_name>
$ source bin/activate
```

`pip` can then be used inside of `virtualenv`.

``` bash
$ pip search <package_name>
$ pip install <package_name>
```

To exit a virtual environment,

``` bash
$ deactivate
```

#### Golang

To install [Golang][golang-ubuntu], first download a Golang binary

``` bash
$ sudo wget https://storage.googleapis.com/golang/go$VERSION.$OS-$ARCH.tar.gz
```

where `$VERSION` is your desired version (e.g., `1.5`), `$OS` is your operating system (e.g., `linux`), and `$ARCH` is your architecture (e.g., `amd64`). See the Golang [downloads][golang-downloads] for a list of possible downloads. Next, extract the archive into `/usr/local`

``` bash
$ sudo tar -C /usr/local -xzf go$VERSION.$OS-$ARCH.tar.gz
```

For example,

``` bash
$ sudo wget https://storage.googleapis.com/golang/go1.5.linux-amd64.tar.gz -P ./downloads
$ sudo tar -C /usr/local -xzf ./downloads/go1.5.linux-amd64.tar.gz
```

Add `/usr/local/go/bin` to the `PATH` environment variable. Open your `~/.profile`

``` bash
$ sudo nano ~/.profile
```

and add the following line:

```
export PATH=$PATH:/usr/local/go/bin
```

To apply the changes to the current shell,

``` bash
$ source ~/.profile
```

To verify that Golang is working,

``` bash
$ golang version
```

Next, create a Golang workspace

``` bash
$ mkdir -p code/go
```

and update your `~/.profile`

``` bash
$ sudo nano ~./profile
```

to include

```
export GOPATH=$HOME/code/go
export PATH=$PATH:$GOPATH/bin
```

Reload your `.profile`:

``` bash
$ source ~/.profile
```

Verify that everything is working:

``` bash
$ echo $PATH
$ echo $GOPATH
```

Next, let's create a test package.

``` bash
$ mkdir -p $GOPATH/src/github.com/<your_github_username>/hello
$ cd $GOPATH/src/github.com/<your_github_username>/hello
$ touch hello.go
```

Open the file `./hello.go`

``` bash
$ nano ./hello.go
```

and paste

```
package main

import "fmt"

func main() {
	fmt.Printf("Hello, world.\n")
}
```

Save the file and install the program:

``` bash
$ go install
```

To run the program,

``` bash
$ hello
# => Hello, world.
```

#### Node.js

Install the [Node version manager][nvm] (NVM):

``` bash
$ wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
```

Reload your shell

``` bash
$ source ~/.profile
```

and verify that `nvm` is working

``` bash
$ nvm
```

To install the latest version of Node,

``` bash
$ nvm install v8
```

Check the installed Node version:

``` bash
$ node --version
```

#### Nginx

Install [Nginx][nginx], a high performance [web server][nginx-wikipedia] with a strong focus on concurrency:

``` bash
$ sudo apt-get install nginx
```

To start [Nginx][nginx],

``` bash
$ sudo service nginx start
```

To configure [Nginx][nginx], first create a backup copy of the default configuration file

``` bash
$ cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf.backup
```

Next, copy the template virtual domain configuration file

``` bash
$ cp /etc/nginx/sites-available/default /etc/nginx/sites-available/<your_domain>
```

where `<your_domain>` is the name of your domain; e.g., `example.com`. If you are hosting multiple domains, you should create a virtual domain configuration file for each domain. Once copied, we need to tailor the configuration file(s).

``` bash
$ sudo nano /etc/nginx/sites-available/<your_domain>
```

In the `server` block, change the `server_name` directive to your domain.

```
server_name <my_domain>;
server_name *.<my_domain>; # process requests for all subdomains
```

Beneath the `server_name` directive, specify an `access_log` location.

```
# Absolute path to a directory dedicated to your domain; e.g., /var/www/<your_domain>/logs/access.log
access_log /srv/www/<your_domain>/logs/access.log;
```

Next, create `location` directives to match requests with static assets. For example,

```
 # Define routes for static assets:
location / {
    # Absolute path to root directory containing static assets:
    root  /srv/www/<your_domain>/public;

    # Files to serve if none specified:
    index index.html index.htm;
}
```

In order for [Nginx][nginx] to __activate__ the virtual host configuration, create a symbolic link between the `sites-available` and `sites-enabled` directories.

``` bash
$ sudo ln -s /etc/nginx/sites-available/<your_domain> /etc/nginx/sites-enabled/<your_domain>
```

Remove the symbolic link for the `default` configuration file to prevent conflicts.

``` bash
$ sudo rm /etc/nginx/sites-enabled/default
```

Finally, reload [Nginx][nginx]

``` bash
$ sudo service nginx reload
```

For more information, see the Linode [guides][linode-nginx].

---

## Sites

The following outlines steps for hosting web assets based on the [Nginx][nginx] configuration above. First, create a directory to store files for all hosted domains.

``` bash
$ sudo mkdir /srv/www
```

Set permissions so that all `www` files may be read.

``` bash
$ sudo chmod 755 /srv/www
```

For each domain, create a directory to store site files.

``` bash
$ sudo mkdir /srv/www/<your_domain>
```

Create a directory to store access logs.

``` bash
$ sudo mkdir /srv/www/<your_domain>/logs
```

Next, grant ownership of each directory to the `user` specified in `nginx.conf`. By default, this `user` is `www-data`.

``` bash
$ sudo chown -R www-data:www-data /srv/www/<your_domain>/public
```

To test that everything is configured correctly, create an `index.html` file

``` bash
$ sudo touch /src/www/<your_domain>/public/index.html
$ sudo nano /src/www/<your_domain>/public/index.html
```

and paste the following content

``` html
<html>
  <head>
    <title>My Domain</title>
  </head>
  <body>
    <h1>Beep. Boop.</h1>
  </body>
</html>
```

Determine your `ip address`.

``` bash
$ ifconfig
```

Once determined, enter the `ip address` into your browser and you should see the following:

```
Beep. Boop.
```

If a site is a Git repository, clone the repo into a `www` domain directory

``` bash
$ cd /srv/www/<your_domain>

# Assuming an empty directory...
$ sudo git clone https://github.com/<owner>/<repo>
```

If the repository requires build steps, change the directory ownership and permissions. For example,

``` bash
$ sudo chown -R <user> ./<repo>/

# Allow a non-root user to read, write, and execute:
$ sudo chmod -R 775 ./<repo>
```

Supposing the `<repo>` is a Node.js application, the following should now be possible:

``` bash
$ cd <repo>

# Use a particular Node version:
$ nvm use 8

# Install Node dependencies:
$ npm install
```

---

## References

*	[Getting started][linode-getting-started]
*	[Securing your server][linode-securing-server]
*	[Hosting a website][linode-hosting-website]
*	[How to setup your linode][how-to-setup-your-linode]

<!-- links -->

[linode]: http://linode.com
[linode-getting-started]: https://www.linode.com/docs/getting-started
[linode-hosting-website]: https://www.linode.com/docs/websites/hosting-a-website/
[linode-nginx]: https://www.linode.com/docs/websites/nginx/how-to-configure-nginx
[linode-securing-server]: https://www.linode.com/docs/security/securing-your-server/

[fail2ban]: https://www.fail2ban.org/wiki/index.php/Main_Page

[git]: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
[github-git]: https://help.github.com/articles/set-up-git/
[github-ssh-keys]: https://help.github.com/articles/generating-ssh-keys/#platform-linux

[ssh-agent]: https://en.wikipedia.org/wiki/Ssh-agent

[nvm]: https://github.com/creationix/nvm

[nginx]: https://www.nginx.com/
[nginx-wikipedia]: https://en.wikipedia.org/wiki/Nginx

[golang-ubuntu]: https://github.com/golang/go/wiki/Ubuntu
[golang-downloads]: https://golang.org/dl/

[how-to-setup-your-linode]: http://feross.org/how-to-setup-your-linode/

<!-- /.links -->

repository: TheMidiBoss/linode-setup-notes

repo_name: TheMidiBoss/linode-setup-notes


text:
audio-offset-finder
===================

A simple tool and library for finding the offset of an audio file within another file.

The algorithm uses cross-correlation of standardised Mel-Frequency Cepstral Coefficients, so it should be relatively robust to noise (encoding, compression, etc).  The accuracy is typically to within about 0.01s.

The tool outputs the calculated offset in seconds, and a ["standard score"](https://en.wikipedia.org/wiki/Standard_score) indicating the prominence of the chosen correlation peak.  This can be used as a very rough estimate of the accuracy of the calculated offset - one with a score greater than ten is likely to be correct (at least for audio without similar repeated sections) within the accuracy of the tool; an offset with a score less than five is unlikely to be correct, and a manual check should be carried out.  Note that the value of the score depends on the length of the audio analysed.

The tool uses [FFmpeg](https://ffmpeg.org) for transcoding, so should work on all file formats supported by FFmpeg.  It is tested for compatibility with Python 3.8 and 3.9 on Linux, Windows and macOS.

The aim of this open source project is to provide a simple tool and library that do one job well, and that can be the basis of customisation for more complex use cases.  The [forks of the base respository](https://github.com/bbc/audio-offset-finder/network/members) are worth exploring if you need a feature that is not included here.  The maintainers welcome pull requests with bug fixes, new features and other improvements that fit this philosophy - please see [CONTRIBUTING.md](CONTRIBUTING.md) for details.

Installation
------------

To install from source once downloaded [from GitHub](https://github.com/bbc/audio-offset-finder/):

    $ pip install .

Or, to install the latest package from PyPi.org:

    $ pip install audio-offset-finder

You will need to [install FFmpeg](https://ffmpeg.org/download.html) to use the command-line tool, or to use the file-related functions in the library.

Usage
-----

To use the command-line tool:

    $ audio-offset-finder --help
    $ audio-offset-finder --find-offset-of file1.wav --within file2.wav
    Offset: 12.26 (seconds)
    Standard score: 28.99

    $ audio-offset-finder --find-offset-of file2.wav --within file1.wav
    Offset: -12.26 (seconds)
    Standard score: 28.99

To provide additional information about the accuracy of the result in addition to the standard score, the `--show-plot` option shows a plot of the cross-correlation curve, and the `--save-plot` option saves one to a file.  The two options can be used separately, or together if you want to both view the plot and save a copy of it:

    $ audio-offset-finder --find-offset-of file2.wav --within file1.wav --show-plot --save-plot example.png

A single well-defined peak such as the one shown in the image below is a good indication that the offset is correct.

Library Usage
-------------

To use the Python library:

```python
from audio_offset_finder.audio_offset_finder import find_offset_between_files

results = find_offset_between_files(filepath1, filepath2, trim=30)

print("Offset: %s (seconds)" % str(results["time_offset"]))
print("Standard score: %s" % str(results["standard_score"]))
```
A `find_offset_between_buffers()` function is also provided if you want to find offsets between audio buffers that you already
have in memory.

Testing
-------

    $ pytest

Licensing terms and authorship
------------------------------

See the [COPYING](COPYING) and [AUTHORS](AUTHORS) files.

For details of how to contribute changes, see [CONTRIBUTING.md](CONTRIBUTING.md).

The audio file used in the tests was downloaded from
[Wikimedia Commons](http://en.wikipedia.org/wiki/File:Tim_Berners-Lee_-_Today_-_9_July_2008.flac),
and was originally extracted from the 9 July 2008
episode of the BBC [Today programme](http://www.bbc.co.uk/programmes/b00cddwc).

repository: bbc/audio-offset-finder

repo_name: bbc/audio-offset-finder


text:
# Pseudothis subcoccodes (Speg.) Theiss., 1918 SPECIES

#### Status
SYNONYM

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

#### Published in
Annls mycol. 16: 181 (1918)

#### Original name
Roussoella subcoccodes Speg., 1889

### Remarks
null

path: /life/Fungi/Ascomycota/Sordariomycetes/Diaporthales/Pseudothis/Pseudothis coccodes/ Syn. Pseudothis subcoccodes/README.md


text:
# Linux-Server-Configuration
You will take a baseline installation of a Linux server and prepare it to host your web applications. You will secure your server from a number of attack vectors, install and configure a database server, and deploy one of your existing web applications onto it.

IP ADDRESS: 13-235-19-223

HTTP ADDRESS: http://ec2-13-235-19-223.ap-south-1.compute.amazonaws.com/

SSH PORT: 2200

## Table of Contents

- [Tasks](#tasks)
- [Open Issues](#open-issues)
- [References](#references)

## Tasks

### Update all currently installed packages.
```sh
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo reboot
```

#### Reference -
https://serverfault.com/questions/265410/ubuntu-server-message-says-packages-can-be-updated-but-apt-get-does-not-update

https://askubuntu.com/questions/94102/what-is-the-difference-between-apt-get-update-and-upgrade

#### Status -
After Performing all the commands the Update still does not work for me. it shows 17 packages can be updated.
2 updates are security updates. However in response it shows below logs.
```sh
eading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
grader@ip-172-26-15-157:~$ sudo apt-get update && sudo apt-get dist-upgrade
Hit:1 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu xenial InRelease
Hit:2 http://ap-south-1.ec2.archive.ubuntu.com/ubuntu xenial InRelease
Get:3 http://ap-south-1.ec2.archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]
Get:4 http://security.ubuntu.com/ubuntu xenial-security InRelease [109 kB]
Get:5 http://ap-south-1.ec2.archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB]
Fetched 325 kB in 1s (243 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
```
upgradable list shows nothing

```sh
grader@ip-172-26-15-157:~$ sudo apt list --upgradable
[sudo] password for grader:
Listing... Done

```
### Create User grader and provide sudo access to it.
```sh
sudo adduser grader
sudo touch /etc/sudoers.d/grader
sudo vim /etc/sudoers.d/grader
```
In sudoers file add - `grader ALL=(ALL:ALL) ALL`

Password for grader to access sudo commands - `grader`

### SSH key-pair for grader user.
Generate ssh key on local machine - `ssh-keygen -f ~/.ssh/<key-name>` (leave passphrase empty)
```sh
su - grader
mkdir .ssh
touch .ssh/authorized_keys
vim .ssh/authorized_keys  [Copy the key-name.pub content]
chmod 700 .ssh
chmod 644 .ssh/authorized_keys
ssh -i <key-name><EMAIL_ADDRESS>```

### Change the SSH port from 22 to 2200 and configure firewall
Reference -  https://knowledge.udacity.com/questions/83268
```sh
sudo vim /etc/ssh/sshd_config [change Port to 2200]
sudo service ssh restart
```
#### Configure firewall
```sh
sudo ufw status
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow 2200/tcp
sudo ufw allow 80/tcp
sudo ufw allow 123/udp
sudo ufw enable
ssh -i <key-name><EMAIL_ADDRESS>-p 2200
```
### Set local timezone to UTC

```sh
sudo dpkg-reconfigure tzdata
```
Select UTC in the list.

By default mod_wsgi works with python3.5, to run it with python 3.6 i used below commands -
#### Install python 3.6
```sh
sudo apt install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install python3.6
ls /usr/bin/python*
```
#### Install pip and packages for python 3.6
```sh
sudo curl https://bootstrap.pypa.io/get-pip.py | sudo -H python3.6
sudo python3.6 get-pip.py

sudo pip3 install flask
sudo pip3 install oauth2client
sudo pip3 install psycopg2
sudo pip3 install requests
sudo pip3 install sqlalchemy
sudo pip3 install psycopg2-binary
```
#### Install mod_wsgi with python 3.6
```sh
sudo apt install apache2-dev
sudo apt-get install python3.6-dev
sudo apt-get install libpython3.6-dev

python3.6 -m pip install mod_wsgi
```
#### Install apache2
```sh
sudo apt-get install apache2
```
#### Configure apache to run with mod_wsgi
Run below command -
```sh
mod_wsgi-express module-config
```
Result -
`LoadModule wsgi_module "/home/grader/.local/lib/python3.6/site-packages/mod_wsgi/server/mod_wsgi-py36.cpython-36m-x86_64-linux-gnu.so"
WSGIPythonHome "/usr"`

Put the above result config in /etc/apache2/apache.conf file.
Restart apache service
```sh
 sudo service apache2 restart
```

### Deploy application
### Install git and project repo
```sh
 sudo apt-get install git
 cd /var/www
 sudo git clone https://github.com/nikitachouhan/fsnd-item-catalog.git catalog
```
#### Configure db_setup.py, populate_db_data.py, and application.py for PostgreSQL.
```python
#replace existing engine config with below
engine = create_engine('postgresql://catalog:grader@localhost/catalog')
```
#### Run application files.
```sh
python3.6 db_setup.py
python3.6 populate_db_data.py
python3.6 application.py
```
#### Configure web server
Create a wsgi.py file
```sh
sudo touch /var/www/catalog/wsgi.py
```

Configure above file with below script
```python
# Provide application path
import sys
sys.path.insert(0, "/var/www/catalog")

# Import Flask instance
from application import app as application

if __name__ == '__main__':
    app.config['SESSION_TYPE'] = 'filesystem'
    app.run(host='<IP_ADDRESS>', port=8000)
```

Create a conf file
```sh
sudo touch /etc/apache2/sites-available/catalog.conf
```

Configure above file with below script
```sh
<VirtualHost *:80>
        ServerName <IP_ADDRESS>
        ServerAdmin<EMAIL_ADDRESS>        ServerAlias <IP_ADDRESS>.nip.io
        WSGIDaemonProcess application
        WSGIScriptAlias / /var/www/catalog/wsgi.py
        <Directory /var/www/catalog/>
                WSGIProcessGroup application
                WSGIApplicationGroup %{GLOBAL}
                Require all granted
        </Directory>
        ErrorLog ${APACHE_LOG_DIR}/error.log
        LogLevel warn
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
```

Enable virtual host
```sh
sudo a2ensite catalog
sudo service apache2 restart
```
At this point on http://13-235-19-223/ I am able to access my web application.

## Open Issues

### Issue with Google Sign-in
I changed "redirect_uris" and  "javascript_origins" to `http://13-235-19-223.nip.io,http://13-235-19-223` in client_secrets.json.

While clicking on Google-signin button i get this error - `Error 400: invalid_request Permission denied to generate login hint for target domain.`

I have similar issue mentioned in this thread - https://knowledge.udacity.com/questions/28323 .It is mentioned that Google OAuth working is not required for submission.
The issue still persists with my application.

#### Solution
- Get a Host name for the public IP address from [host2ip](https://www.hcidata.info/host2ip.cgi).
- In `/etc/apache2/sites-available/catalog.conf` add below config
  `ServerAlias ec2-13-235-19-223.ap-south-1.compute.amazonaws.com`
- Enable the virtual host
  ```sh
  $ sudo a2ensite catalog
  $ sudo service apache2 restart
  ```
- In Google Developer Console: https://console.developers.google.com/project
  1. Navigate to Credentials > Edit json
  2. Add the host name and public IP-address to Authorized JavaScript origins and host name to Authorized redirect URIs.
     e.g. http://ec2-13-235-19-223.ap-south-1.compute.amazonaws.com/

### Duplicated Categories
Categories are duplicated on home page. This is due to multiple runs of populate_db_data.py. Since category name is not a unique field the data was duplicated with new id.

![Home Page](info/home-page.PNG)

## References
[Mod Wsgi Installation command](https://titanwolf.org/Network/Articles/Article?AID=ca581545-474a-4aa0-83dc-c57c6c344d32#gsc.tab=0)

[Mod Wsgi from python 3.5 to 3.6](https://newbedev.com/change-mod-wsgi-from-python3-5-to-3-6)

[Issues with mod-wsgi](https://stackoverflow.com/questions/20627327/invalid-command-wsgiscriptalias-perhaps-misspelled-or-defined-by-a-module-not)

[DNS for any IP Address](https://nip.io/)

[PostgreSql configurations on ubuntu](https://www.digitalocean.com/community/tutorials/how-to-secure-postgresql-on-an-ubuntu-vps)

[Timezone configuration on ubuntu](https://help.ubuntu.com/community/UbuntuTime#Using_the_Command_Line_.28terminal.29)


text:
# Snitch

[![Build Status](https://semaphoreapp.com/api/v1/projects/58137b2271b9d863b5b7a65b0a195ef303ea09f0/27953/badge.png)](https://semaphoreapp.com/projects/1561/branches/27953)

A service to track reports of objectionable content and the corresponding moderator decisions

## Getting Started

    git clone git@github.com:bengler/snitch.git
    cd snitch

    rake db:bootstrap

repository: bengler/snitch

gha_language: Ruby

repo_name: bengler/snitch


text:
WoWRoster
=========
WoWRoster is a web application to build a World of Warcraft raid roster from the official armory. Can be used to check which raid buffs and cooldowns are available in your roster.

I am *not* affiliated with WoWRoster.net (http://www.wowroster.net/), sorry for the confusion :)

## Changelog :
[CHANGELOG.md](https://github.com/KyneSilverhide/WoWRoster/blob/master/CHANGELOG.md#changelog-)

# Demo
There is a live demo available here : [WoWRoster](http://ns352915.ovh.net/kyne/WoWRoster/)

# Installation
I'm not planning on hosting the application for now. But you can actually run it on your computer very easily :
* Download the full project
* Open the index.html in your browser
* *You are done* :)

# Features
* Access to any guild on EU, US, KR and TW regions.
* Display all your members, or only the one at lvl 100
* Search by name, class, specialization or level
* Filter by ranks
* Add or remove your members to the roster with a single click
* Display which buffs will be available based on the current roster (handle exclusive buffs sur as a warrior cry)
* Display the ratio of plate/armor/leather/cloth and the class distribution
* Save rosters (by guild)
* Import them directly from the WoW calendar, by using a very small addon

# Add on
I've created a small WoW addon (called WoWRosterExport) that will generate an export of any guild calendar event, so you can directly import the member list into a new roster in this web application.
To download the addon, simply go to Curse : http://www.curse.com/addons/wow/wowrosterexport.
You'll find instructions on how to use (and install) this addon.

# Planned Features
* Search by role?
* Export?
* ...

repository: KyneSilverhide/WoWRoster

gha_language: JavaScript

repo_name: KyneSilverhide/WoWRoster


text:
# State

## What is a state?

The word "state" can mean a lot of different things in computer science.
In the case of amethyst, it is used to represent the "game state".

A game state is a *general* and *global* section of the game.

## Example

As an example, let's say you are making a pong game.

- When the user opens up the game, it first loads all the assets and shows a loading screen.
- Then, the main menu shows up, asking you if you want to start a game in single or multiplayer.
- Once you select an option, the game displays the paddles and the ball and starts playing.
- By pressing escape, you can toggle the "pause" menu.
- Once the score limit is reached, a result screen is shown with a button to go back to the main menu.

The game can be divided into different states:

- LoadingState
- MainMenuState
- GameplayState
- PauseState
- ResultState

While you could effectively insert all the game's logic into a single state `GameState`,
dividing it into multiple parts makes it much easier to reason about and maintain.

## State Manager

Amethyst has a built-in state manager, which allows easily switching between different `State`s.
It is based on the concept of a pushdown-automaton, which is a combination of a Stack and a State Machine.

### Stack

The stack concept makes it so you can "push" `State`s on top of each other.

If we take the pong example of earlier, you can push the `PauseState` over the `GameplayState`.

When you want to go out of pause, you pop the `PauseState` out of the stack and you are back into the `GameplayState`, just as you left it.

### State Machine

The concept of State Machine can be pretty complex, but here we will only explain the basics of it.
The State Machine is usually composed of two elements: Transitions and Events.

Transitions are simply the "switching" between two states.

For example, from `LoadingState`, go to state `MainMenuState`.

Amethyst has multiple types of transitions.

- You can Push a `State` over another.
- You can also Switch a `State`, which replaces the current `State` with a new one.

Events are what trigger the transitions. In the case of amethyst, it is the different methods called on the `State`. Continue reading to learn about them.

## Life Cycle

`State`s are only valid for a certain period of time, during which a lot of things can occur.
A `State` contains methods that reflect the most common of those events:

- on\_start: When a `State` is added to the stack, this method is called on it.
- on\_stop: When a `State` is removed from the stack, this method is called on it.
- on\_pause: When a `State` is pushed over the current one, the current one is paused, and this method is called on it.
- on\_resume: When the `State` that was pushed over the current `State` is popped, the current one resumes, and this method is called on the now-current `State`.
- handle\_event: Allows easily handling events, like the window closing or a key being pressed.
- fixed\_update: This method is called on the active `State` at a fixed time interval (1/60th second by default).
- update: This method is called on the active `State` as often as possible by the engine.
- shadow\_update: This method is called as often as possible by the engine on all `State`s which are on the `StateMachines` stack, including the active `State`. Unlike `update`, this does not return a `Trans`.
- shadow\_fixed\_update: This method is called at a fixed time interval (1/60th second by default) on all `State`s which are on the `StateMachines` stack, including the active `State`. Unlike `fixed_update`, this does not return a `Trans`.

If you aren't using `SimpleState` or `EmptyState`, you *must* implement the `update` method to call `data.data.update(&mut data.world)`.

## Game Data

`State`s can have arbitrary data associated with them.
If you need to store data that is tightly coupled to your `State`, the classic way is to put it in the `State`'s struct.

`State`s also have internal data, which is any type T.
In most cases, the two following are the most used: `()` and `GameData`.

`()` means that there is no data associated with this `State`. This is usually used for tests and not for actual games.
`GameData` is the de-facto standard. It is a struct containing a `Dispatcher`. This will be discussed later.

When calling your `State`'s methods, the engine will pass a `StateData` struct which contains both the `World` (which will also be discussed later) and the Game Data type that you chose.

## Code

Yes! It's finally time to get some code in here!

Here will be a small code snippet that shows the basics of `State`'s usage.
For more advanced examples, see the following pong tutorial.

### Creating a State

```rust
use amethyst::prelude::*;

struct GameplayState {
    /// The `State`-local data. Usually you will not have anything.
    /// In this case, we have the number of players here.
    player_count: u8,
}

impl SimpleState for GameplayState {
    fn on_start(&mut self, _data: StateData<'_, GameData>) {
        println!("Number of players: {}", self.player_count);
    }
}
```

That's a lot of code, indeed!

We first declare the `State`'s struct `GameplayState`.

In this case, we give it some data: `player_count`, a byte.

Then, we implement the `SimpleState` trait for our `GameplayState`.
`SimpleState` is a shorthand for `State<GameData, StateEvent>` where `GameData` is the shared data between states and `StateEvent` is
an enum of events that can be received by the `State` on its `handle_event` method.

### Switching State

Now, if we want to change to a second state, how do we do it?

Well, we'll need to use one of the methods that return the `Trans` type.

Those are:

- `handle_event`
- `fixed_update`
- `update`

Let's use `handle_event` to go to the `PausedState` and come back by pressing the "Escape" key.

```rust
use amethyst::{
    input::{is_key_down, VirtualKeyCode},
    prelude::*,
};

struct GameplayState;

struct PausedState;

// This time around, we are using () instead of GameData, because we don't have any `System`s that need to be updated.
// (They are covered in the dedicated section of the book.)
// Instead of writing `State<(), StateEvent>`, we can instead use `EmptyState`.
impl EmptyState for GameplayState {
    fn handle_event(&mut self, _data: StateData<()>, event: StateEvent) -> EmptyTrans {
        if let StateEvent::Window(event) = &event {
            if is_key_down(&event, VirtualKeyCode::Escape) {
                // Pause the game by going to the `PausedState`.
                return Trans::Push(Box::new(PausedState));
            }
        }

        // Escape isn't pressed, so we stay in this `State`.
        Trans::None
    }
}

impl EmptyState for PausedState {
    fn handle_event(&mut self, _data: StateData<()>, event: StateEvent) -> EmptyTrans {
        if let StateEvent::Window(event) = &event {
            if is_key_down(&event, VirtualKeyCode::Escape) {
                // Go back to the `GameplayState`.
                return Trans::Pop;
            }
        }

        // Escape isn't pressed, so we stay in this `State`.
        Trans::None
    }
}
```

### Event Handling

As you already saw, we can handle events from the `handle_event` method.
But what is this weird `StateEvent` all about?

Well, it is simply an enum. It regroups multiple types of events that are emitted throughout the engine by default.
To change the set of events that the state receives, you create a new event enum and derive `EventReader` for that type.

```rust
// These imports are required for the #[derive(EventReader)] code to build
use amethyst::{
    core::{
        ecs::World,
        shrev::{EventChannel, ReaderId},
        EventReader,
    },
    input::{is_key_down, VirtualKeyCode},
    prelude::*,
    ui::UiEvent,
    winit::Event,
};

#[derive(Clone, Debug)]
pub struct AppEvent {
    data: i32,
}

#[derive(Debug, EventReader, Clone)]
#[reader(MyEventReader)]
pub enum MyEvent {
    Window(Event),
    Ui(UiEvent),
    App(AppEvent),
}

struct GameplayState;

impl State<(), MyEvent> for GameplayState {
    fn handle_event(&mut self, _data: StateData<()>, event: MyEvent) -> Trans<(), MyEvent> {
        match event {
            MyEvent::Window(_) => {} // Events related to the window and inputs.
            MyEvent::Ui(_) => {}     // Ui event. Button presses, mouse hover, etc...
            MyEvent::App(ev) => println!("Got an app event: {:?}", ev),
        };

        Trans::None
    }
}
```

To make `Application` aware of the change to which events to send to the state, you also need to supply both the
event type, and the `EventReader` type (the name you give in the `#[reader(SomeReader)]` derive attribute) when
the `Application` is created. This is done by replacing `Application::build` (or `Application::new`) with
`CoreApplication::<_, MyEvent, MyEventReader>::build()` (or `CoreApplication::<_, MyEvent, MyEventReader>::new()`).

*Note: Events are gathered from `EventChannel`s. `EventChannel`s are covered in the dedicated book section.*

repository: MirecIT/amethyst

repo_name: MirecIT/amethyst


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

# colabtweak
Tweaks for Google Colab.

## Installation
The `colabtweak` [git repo](http://github.com/kmedian/colabtweak) is available as [PyPi package](https://pypi.org/project/colabtweak)

```
pip install colabtweak
```

In Colab use this

```
! pip install colabtweak
```

## Commands
* Check syntax: `flake8 --ignore=F401`
* Remove `.pyc` files: `find . -type f -name "*.pyc" | xargs rm`
* Remove `__pycache__` folders: `find . -type d -name "__pycache__" | xargs rm -rf`
* Upload to PyPi with twine: `python setup.py sdist && twine upload -r pypi dist/*`

## Support
Please [open an issue](https://github.com/kmedian/colabtweak/issues/new) for support.

## Contributing
Please contribute using [Github Flow](https://guides.github.com/introduction/flow/). Create a branch, add commits, and [open a pull request](https://github.com/kmedian/colabtweak/compare/).

repository: kmedian/colabtweak

repo_name: kmedian/colabtweak


text:
# Buffers #

 Buffers store and operate on sequences of samples.

 Include the following code to use the classes below:

 ```c++
 #include "buffers.h"
 using namespace CSynth;
 ```

 Some common flags are defined to specify the behavior of operations on
 buffers. These are generally passed as the `SampleFlags` type, which
 specifies a combination of the following enumerations:

 The `SampleUnit` enumeration defines how a location in a buffer is
 specified, and has the following possible values:
 * `SampleUnitPhase` specifies that the location is given as a fraction
   of the total buffer length.
 * `SampleUnitSeconds` specifies that the location is given in seconds
   from the beginning of the buffer.
 * `SampleUnitSamples` specifies that the location is given as an actual
   sample index, which need not be a whole number.

 The `SampleMode` enumeration defines how a location in a buffer will be
 resolved to a sample or samples, and has the following possible values:
 * `SampleModeInterpolated` specifies that if the location falls between
   two samples, it will be interpolated to an intermediate value.
 * `SampleModeAligned` specifies that the location will always resolve to
   the single closest sample.

 The `SampleOperation` enumeration defines how a location in a buffer will
 be modified by a new value, and has the following possible values:
 * `SampleOperationSet` specifies that the new value will replace the
   existing value.
 * `SampleOperationAdd` specifies that the new value will be added to the
   existing value.
 * `SampleOperationMultiply` specifies that the new value will be
   multiplied by the existing value.

 # Delay #

 ```
 INPUT:
    /\      /\      /\      /\      /\      /\      /\      /\      /\
   /  \    /  \    /  \    /  \    /  \    /  \    /  \    /  \    /  \
       \  /    \  /    \  /    \  /    \  /    \  /    \  /    \  /
        \/      \/      \/      \/      \/      \/      \/      \/

 OUTPUT:
      /\      /\      /\      /\      /\      /\      /\      /\      /
     /  \    /  \    /  \    /  \    /  \    /  \    /  \    /  \    /
    /    \  /    \  /    \  /    \  /    \  /    \  /    \  /    \  /
   /      \/      \/      \/      \/      \/      \/      \/      \/
 ```

 The `Delay` class implements a delay line that outputs a version of the
 input delayed by a certain amount of time. Interpolation is used to provide
 accurate delay even when the delay period is not an integer number of
 samples.

 ## Properties ##

 The `feedback` property controls how much of the signal coming out of the
 delay line is fed back to its source. This defaults to 0.0, meaning no
 feedback. A value of 1.0 would feed the signal back at full volume,
 but watch out for the resulting sound! Intermediate values will cause the
 input signal to gradually decay at a corresponding rate.

 The `feedbackOperation` property changes the operation performed on the
 signal being fed back into the delay line. It can be set to anything that
 maps to a std::function, e.g. a function pointer or a lambda function.
 The function must accept a float and return a float to feed back. The
 default operation is to multiply by the value of the `feedback` property.

 ## Methods ##

 The `setDelay` method adjusts the amount of delay to a given number
 of seconds. This can be called at any time. When increasing or decreasing
 the delay quickly, there will be some inevitable artifacts because the
 signal already in the buffer is too long or short to fit into the new
 buffer. This algorithm reduces such artifacts by cross-fading the signal
 in the buffer into a shifted copy of itself.

 Flags may also be passed to the second parameter to get other behaviors.
 Passing `SampleUnitSamples` allows you to specify the delay length as a
 number of samples, and passing `SampleModeAligned` will force the
 buffer length to be an exact number of samples. The flags may be combined
 with the bitwise OR operator (`flagA | flagB`).

 The `getDelay` method returns the length of the delay line. By default,
 this is returned in seconds, but passing the `SampleUnitSamples` flag
 will return it in samples.

 The `tapIn` method allows signals to be inserted anywhere in the delay
 line. It takes two required parameters, a location and the value to
 insert at that point in the buffer.

 Flags can be passed to control how the location is specified and how to
 modify the buffer. Possible flags are descibed below, and these can be
 combined using the bitwise OR operator (`flagA | flagB`).

 By default, the location is a fraction of the buffer's length, with 0.0
 being the oldest point in the buffer and 1.0 being the newest, but a
 value of the `SampleUnit` enumeration can be passed as a flag to specify
 a different meaning for the location, either `SampleUnitSeconds` or
 `SampleUnitSamples`.

 An optional `SampleMode` may be passed to control how to map the given
 location onto the buffer. Passing `SampleModeInterpolated`, which is the
 default, will use linear interpolation to distribute the value between
 two samples if it doesn't fall exactly on a sample. Note that this
 distribution is lossy, i.e. if you call `tapOut` for the same location,
 you probably won't get the same result. Passing `SampleModeAligned`
 will affect only the single nearest sample.

 By default, the value will be added to the existing value in the buffer,
 but an optional `SampleOperation` may be passed as a flag, either
 `SampleOperationSet` or `SampleOperationMultiply`.

 Some examples:

 ```c++
 Delay delay();
 delay.setDelay(0.200); // make a 200ms delay line
 // halve the sample closest to 100ms into the buffer
 delay.tapIn(0.100, 0.5,
   SampleUnitSeconds | SampleModeAligned | SampleOperationMultiply);
 // add 1.0 to the third sample in the buffer
 delay.tapIn(2.0, 1.0, SampleUnitSamples | SampleOperationAdd);
 ```

 The `tapOut` method samples the value of the delay buffer at any point.
 The point to sample at is given as a fraction of the delay's length,
 where 0.0 returns the value at the oldest point in the buffer and 1.0
 returns the value at the newest point.

 Flags can be passed to control the meaning of the location. All flags
 accepted by the `tapIn` method above are valid, except those from the
 `SampleOperation` enumeration, which don't apply here.

 ## Constructors ##

 The default constructor produces a delay line with no sources connected,
 which will produce silence. A delay line can also be constructed by
 passing a source and delay to the constructor:

 ```c++
 Sine a(440.0);
 Delay delay(a, 1.0); // delays the wave by 1 second
 ```

license: Unlicense

repository: jessecrossen/csynth

repo_name: jessecrossen/csynth


text:
# OBSOLETED IN FAVOR OF THE FMA LARGE DATASET

# Generator
This is the script that generates the sample combined WAV files for pre-training the model.

## Functionality
1.  Pick a random combintion of 10 of the present wav files.
2.  Check if the combination exists in `combinations.txt` - if so, pick another one.
3.  Use `sox` to generate the combined wav file
4.  Write to `combinations.txt`

repository: amunchet/cormorant

gha_language: Jupyter Notebook

repo_name: amunchet/cormorant


text:
# telldus-local
Simple small Java Spring Boot library to communicate with Telldus TellStick ZNet local server API

# Supported commands
## Devices
* Get list of devices
* Get device info
* Turn device off
* Turn device on

## Sensors
* Get list of sensors
* Get sensor info

# Configuration
You will need to get a valid token yourself for now. Read how to do it here: http://api.telldus.net/localapi/api.html

In application.properties and add the following properties:
```
telldus.bearer-token=[token from telldus]
telldus.url=[ip-to-your-telldus]/api
```

repository: eirikandre/telldus-local

repo_name: eirikandre/telldus-local