text:
---
schema: default
title: Water Quality - Ocean Monitoring Program
department: Public Utilities
category:
  - Energy & Environment
resources:
  - name: Parameter Results, 2011 - 2019
    url: >-
      https://seshat.datasd.org/pud/omp/water_quality_2011_2019_datasd.csv
    format: csv
  - name: Parameter Results, 2000 - 2010
    url: >-
      https://seshat.datasd.org/pud/omp/water_quality_2000_2010_datasd.csv
    format: csv
  - name: Parameter Results, 1990 - 1999
    url: >-
      https://seshat.datasd.org/pud/omp/water_quality_1990_1999_datasd.csv
    format: csv
  - name: Parameter Testing Station Locations
    url: >-
      https://seshat.datasd.org/pud/omp/reference_stations_water_quality.csv
    format: csv
  - name: Dictionary
    url: >-
      https://seshat.datasd.org/pud/omp/water_quality_dictionary_datasd.csv
    format: csv
license: 'http://www.opendefinition.org/licenses/odc-pddl'
date_issued: '2020-07-02'
date_modified: '2020-07-02'
maintainer: City of San Diego
maintainer_email<EMAIL_ADDRESS>---
Ocean water quality data, including bacteriological sampling for fecal indicator bacteria as well as physical, chemical, and biological parameters observed throughout the region.
<!--more-->
Samples are collected as part of The City's Ocean Monitoring Program, which monitors the effects of treated wastewater effluent on the local marine environment. The OMP extends 340 square miles total from northern San Diego to northern Baja California, Mexico, and encompasses the shoreline seaward approximately 10 miles, to depths of over 500 meters.


text:
---
title: XKCD PowerShell password generator
date: 2017-08-11T13:04:45+00:00
author: Janik von Rotz
slug: xkcd-powershell-password-generator
images:
  - /wp-content/uploads/2015/06/PowerShell-logo-e1433137513315.png
categories:
  - scripting
tags:
  - password
  - powershell
---
> Through 20 ears of effort, we've successfully trained everyone to use passwords that are hard for humans to remember, but easy for computers to guess.

This article reminded my of how stupid current password guidelines are and that we need to change that. A few months ago I wrote a random [password generator function](https://janikvonrotz.ch/2015/09/07/password-generator-with-powershell/) and decided that it needs an update to make the generated passwords more memorable.
<!--more-->
Inspiration for the new random password was the following XKCD comic:

![Untitled](/wp-content/uploads/2017/08/password_strength.png)

So instead of using any kind of character for the password, simply put four random words together.
To create this kind of password we need a word list with common nouns. I've created a german and english word list for you to download:

[wordlist.de.txt](/wp-content/uploads/2017/08/wordlist.de_.txt)
[wordlist.en.txt](/wp-content/uploads/2017/08/wordlist.en_.txt)

**Get-XKCDPassword.ps1**

And here is the PowerShell function:

```powershell
function Get-XKCDPassword {

    Param(
        [int]$words = 4,

        [string]$delimiter = "-",

        [ValidateSet("en","de")]
        [string]$lang = "en",

        [switch]$FirstLetterUpperCase
    )

    $password = ""
    $wordlist = @{
        de = "/wp-content/uploads/2017/08/wordlist.de_.txt"
        en = "/wp-content/uploads/2017/08/wordlist.en_.txt"
    }

    switch($words) {
        {$_ -ge 6 } { throw "Word parameter cannot be greater or equal 6." }
        5 { $range = (3,4) }
        4 { $range = (4,5) }
        3 { $range = (5,6) }
        2 { $range = (7,8) }
        {$_ -le 1 } { throw "Word parameter cannot be less or equal 1." }
    }

    $list = (((Invoke-WebRequest $wordlist[$lang]).Content -split "`n" | ForEach-Object{
        New-Object PSObject -Property @{
            Value = $_.ToLower()
            Length=$_.length
        }
    }) | Where-Object { ($_.Length -eq ($range[0] + 1)) -or ($_.Length -eq ($range[1] + 1)) })

    1..$words | ForEach-Object {
        $part =  (Get-Random $list).Value.Trim()

        if($FirstLetterUpperCase ) {
             $password += ((Get-Culture).TextInfo).ToTitleCase($part)
        } else {
            $password += $part
        }

        if($_ -lt $words){
            $password += $delimiter
        }
    }

    return $password
}

Get-XKCDPassword -words 4 -delimiter "-" -lang "de" -FirstLetterUpperCase
```

Here are some results:
```
bite-bomb-pupil-basis
crime-wedge-alley-roll
side-filly-bloom-fairy
read-tribe-mouth-jail
knot-make-child-moth
```

And a few more in german:
```
Seite-Sorge-Saft-Nadel
Fluss-Glas-Alter-Rand
Nord-Maul-Wert-Nabel
Sand-Schal-Anruf-Rand
Sahne-Post-Name-Park
```

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
---
layout: post
title: "INNOVATIONS IN THE DRONE INDUSTRY"
author_github: KushagraRawat
date: 2019-01-26 10:00:30
image: '/assets/img/'
description: 'An Introdution to innovations happening in the drone Industry'
tags:
- Drones
categories:
- Piston
github_username: 'KushagraRawat'
---

> "Do you think drones are just four rotor-legged flying machines?"
> "Have you ever thought how we can modify these machines to get maximum out of it?"
> Multiple innovations are happening currently in this very industry and here are some of them!

## GOING BLADELESS : THE FUTURE OF DRONES ?

As much crazy as it might sound , bladeless drone are becoming a reality . Bladeless ? You ask me , well , it might be a bit of misnomer . Bladeless isn’t actually bladeless in the fact the it still relies on a bladed propeller , to force the pressurised air generating thrust . So then what’s new here . The propeller here is ducted from the main body all the way to a nozzle to guide the air through . Something like this:

![img1](/blog/assets/img/innovations-in-drone-industry/1.png)

And here is some takeaways from this awesome new technology
* Reduces the risk of blade related injuries to the controller as well as other bystanders
* Reduces blade damage to the drone by meshing the inlet of the duct
* Increases the maneuverability of the drone by providing the nozzles to guide the air

[The Bladeless Drone]( https://www.youtube.com/watch?v=5L6FSdUmEpg)

## THE FOLDABLE DRONE

![img2](/blog/assets/img/innovations-in-drone-industry/2.png)

The foldable drones are now a reality !
These drone have the ability to fold the rotor arms to various configurations , enabling the drones to cross low opening passages and places which would have been inaccessible otherwise .The first foldable drone was developed by students from the University of Zurich (UTZ) and EPFL .
Each of its four arms has a servo motor at the base that can rotate one propeller independently.There are several morphologies that can be adopted by the drone, like completely unfolded (“X” morphology), completely folded (“O”), straight line (“H”), and partly folded (“T”).However the drone can also acquire highly asymmetric morphologies whilst maintaining excellent stability thanks to its to its adaptive on board computing system (OBCs).

![img3](/blog/assets/img/innovations-in-drone-industry/3.png)

![img4](/blog/assets/img/innovations-in-drone-industry/4.png)

![img5](/blog/assets/img/innovations-in-drone-industry/5.png)

### Key advantages of this technology

* Allows the drone to reach inaccessible places which could further its capabilities. (for eg: rubble from an earthquake , landslides , etc.)
* Enhances the stability of the drone by making use of the adaptive algorithms in the OBC
* Increases the compactness of the drone and hence portability
* Allows physical inspection of structures
* Easy transportation of items

[SHAPE CHANGING DRONE](https://spectrum.ieee.org/automaton/robotics/drones/foldable-drone-changes-its-shape-in-mid-air)

## UNDERWATER DRONES

If blades drones and shape changing drones weren't enough , here’s the underwater drone. Underwater drones have the capability to dive mid flight into water , stay submerged , navigate , perform functions underwater , resurface and fly back . These type of drones require to be waterproof at high pressures and temperature , however have lesser payload carrying capacity than owing to a heavy watertight structures around the frame . However these drones can be very versatile since they can easily operate in heavy rains.

### Key advantages
* Can operate in underwater missions like inspection of bridges , pipelines , knowing the extent of damage done by oil spills , etc.
* Can operate in unforgiving weather conditions

[UNDERWATER DRONE](https://www.youtube.com/watch?v=FC9EJhs0pc0)

![img6](/blog/assets/img/innovations-in-drone-industry/6.png)

![img7](/blog/assets/img/innovations-in-drone-industry/7.png)

### References

* https://airdronecraze.com/quick-reference-guide-of-drone-terminology/
* https://www.youtube.com/watch?v=FC9EJhs0pc0
* https://www.red-dot.org/project/bladeless-drone-26825/
* https://www.youtube.com/watch?v=5L6FSdUmEpg

license: MIT

gha_license_id: MIT


text:
# styleTransfer
Implementation of Universal Style Transfer via Feature Transforms, `Yi et al. (2017)`, with Keras (upcoming)

#### Auto encoder
* CNN Auto encoder
* Trained on `<insert-dataset-name>` (upcoming)
* Increasing Batch Size on Epoch begin as described in `Smith, Kindermans, Le (2017)`

#### Dependencies

* Python 3.6.3
* tensorflow==1.4.1
* Keras==2.1.1
* h5py==2.7.1
* numpy==1.13.3
* tqdm==4.19.4
* pandas==0.21.0

repository: fortin-alex/styleTransfer

repo_name: fortin-alex/styleTransfer


text:
---
layout: post
title: "August 2016 Meetup - CouchBase and Node.js"
description: ""
tags: [node.js, javascript, couchbase]
---
{% include JB/setup %}

The Seattle Node.js Meetup is pleased to announce our
[meetup](http://www.meetup.com/Seattle-Node-js/events/233099175/)
on **Wednesday, August 31st,** CouchBase and Node.js

As always, you can find all things Seattle Node.js-related at the group website:
[http://seanode.github.io/](http://seanode.github.io/). And you can reach out to
us via email at [{{site.author.email}}](mailto:{{site.author.email}}) or Twitter
at [@{{site.author.twitter}}](https://twitter.com/{{ site.author.twitter }}).

See you soon!

## Agenda

* **6:30pm - 7:00pm**: Start with appetizers and mingling, courtesy of General Assembly.

* **7:00pm - 8:00pm**: Listen and learn about why CouchBase is perfect for Node.js

* **8:30pm - on**: Mingle, mix, chat things Node.js-related and more as we wind down.

<!-- more start -->

## Talks

### Developing with Node.js, NoSQL, and Angular 2

**[Nic Raboy](https://github.com/nraboy)** - Developer Advocate [CouchBase](http://www.couchbase.com/)

In this session, we'll talk about what's different about this generation of web
applications and how a solid development approach must consider the latency,
throughput, and interactivity demand by users across mobile devices, web browsers,
and Internet of Things (IoT). We'll demonstrate how to include Couchbase in such
applications to support a flexible data model and the easy scalability required for
modern development. We'll demonstrate how to create an application composed of
Couchbase, Express Framework, Angular 2, and Node.js. Bring your laptop and follow
along!

Nic is a Developer Advocate for Couchbase in the San Francisco Bay Area. He speaks
at developer conferences, meetups, and community events in addition to mainting a
blog and writing tutorials and example applications. The core of his work is making
sure developers and users of Couchbase are successful in whatever it is they're
working on. On the side, he develops mobile applications for Android and iOS. His
most successful mobile application is SQLTool, a database editor for Android based
devices.

## Venue / Sponsor

**[General Assembly](https://generalassemb.ly/seattle)** has graciously agreed to host the event and
**[TEKSystems](https://www.teksystems.com/en)** has generously volunteered to provide sustenance!
General Assembly is located on the third floor at 1218 3rd Avenue, Seattle, WA, 98101

[Please RSVP with General Assembly for this event!](https://generalassemb.ly/education/seattle-nodejs-meetup-developing-with-nodejs-nosql-and-angular-2/seattle/28045)

<!-- more end -->

gha_language: JavaScript


text:
# Gradle project templaye

## Gradle tips

### Gradle wrapper

You don't need to install Gradle in your system, only Java.
Gradle wrapper self-downloads the same version that the project needs.

### Multi-module tasks execution

Being in root folder (this one) and executing `./gradlew module_name:task` means
basically the same than being in module folder and execute `../gradlew task`.

Commands executed in root folder, without module name, will apply to all modules.

You can also combine modules and root `./gradlew clean module1:taskA module2:taskB`,
tasks are reordered using internal Gradle DAG reordering.

### Overriding variables

Gradle allows variable overriding by using parameters `-Pname=value` and using
user's local gradle configuration `~/.gradle/gradle.properties`.

### Knowing your options

`./gradlew tasks` will tell you what tasks are available.

## Features

### Independent Swagger contract

Module `contract`

Contract version editable in `contract/gradle.properties`

Push it to bintray (some names are hardcoded yet) using `./gradle contract:build contract:publish`.
In order to achieve a successful publish, you need to override `repositoryUser`
and `repositoryPass` (ideally) locally.

Once it has been pushed to `bintray` (preconfigured-hardcoded), it will be usable
from springboot module.

Bintray typically fails `push` if an artifact with same name and version exists,
it doesn't allow overriding by default.

### Flyway

This project comes with a working in-mem database Flyway example.

Goal is to publish a migrator configuration alongside the main project artifact.

More info about flyway commands: `https://flywaydb.org/getstarted/firststeps/gradle`

### Mapstruct

Mapstruct example used in rest controller.

### Springboot Java8 application

Module `springboot`

Run springboot application from gradle using `./gradlew springboot:swagger springboot:bootRun`

Springboot uses Swagger to create Controller classes, using the api version in
`springboot/gradle.properties`, property `supported_api_version`.

Useful links:

- http://localhost:8080/info.json -> info endpoint with commit, branch and version,
information is merged from properties file and CI environment variables.
- http://localhost:8080/health.json -> health endpoint
- http://localhost:8080/static/ -> delivers files under resources/public-resources. e.g. .empty
- http://localhost:8080/web/login/welcome -> Freemarker templates through Spring MVC
- http://localhost:8080/organizations -> Rest endpoint declared in Swagger

### Dockerized Springboot

Module `springboot`, file `docker.gradle`

By running `./gradlew springboot:distDocker` it builds a docker image locally, edit
configuration `push` to true to publish your image to your docker repo. In order to
do this, ensure your user is logged in your docker hub previously.

### Unit tests

Module `springboot`, folder `src/test/groovy`

This project uses Spock for unit test.

### Component tests

Module `springboot`, folder `src/component-test/java`

This project uses Java for component tests

### Integration tests

Module `integration-tests`

This project uses CucumberJVM + Groovy for integration tests

### Code quality

#### Checkstyle

Configuration in `code_quality` folder, any violation would break the build.

#### Code coverage

This project uses jacoco to calculate test coverage (test + component tests)
Thresholds are configurable in `springboot/build.gradle`

repository: albertonavarro/project-templates

repo_name: albertonavarro/project-templates


text:
# TargetCLI

TargetCLI is an administration tool for managing the LIO Linux SCSI Target,
and its third-party target fabric modules and backend storage objects.

Based on RTSLib, it allows direct manipulation of all SCSI Target objects like
storage objects, SCSI targets, TPGs, LUNs and ACLs, as well as manage startup
system configuration for the SCSI Target subsystem.

TargetCLI can be used either as a regular CLI tool, one command at a time, or
as an interactive shell based on the python configshell CLI framework, with
full auto-complete support and inline documentation.

TargetCLI is part of the Linux Kernel's SCSI Target's userspace management
tools.

## Installation

TargetCLI is currently part of several Linux distributions. In most cases,
simply installing the version packaged by your favorite Linux distribution is
the best way to get it running.

## Building from source

The packages are very easy to build and install from source as long as
you're familiar with your Linux Distribution's package manager:

1.  Clone the github repository for TargetCLI using `git clone
    https://github.com/Datera/targetcli.git`.

2.  Make sure build dependencies are installed. To build TargetCLI, you will need:

	* GNU Make.
	* python 2.6 or 2.7
	* A few python libraries: rtslib, configshell, lio-utils
	* Your favorite distribution's package developement tools, like rpm for
	  Redhat-based systems or dpkg-dev and debhelper for Debian systems.

3.  From the cloned git repository, run `make deb` to generate a Debian
    package, or `make rpm` for a Redhat package.

4.  The newly built packages will be generated in the `dist/` directory.

5.  To cleanup the repository, use `make clean` or `make cleanall` which also
    removes `dist/*` files.

## Documentation

A manpage is provided with this packages, simply use `man targetcli` to get
more information.

An other good source of information is the http://linux-iscsi.org wiki,
offering many resources such as a the TargetCLI User's Guide, online at
http://linux-iscsi.org/wiki/targetcli.

## Mailing-list

All contributions, suggestions and bugfixes are welcome!

To report a bug, submit a patch or simply stay up-to-date on the Linux SCSI
Target developments, you can subscribe to the Linux Kernel SCSI Target
development mailing-list by sending an email message containing only
`subscribe target-devel` to<EMAIL_ADDRESS>
The archives of this mailing-list can be found online at
http://dir.gmane.org/gmane.linux.scsi.target.devel

## Author

TargetCLI was developed by Datera, Inc.
http://www.datera.io

The original author and current maintainer is
Jerome Martin, at<EMAIL_ADDRESS>

repository: Thingee/targetcli

repo_name: Thingee/targetcli


text:
# CS410_AI_Project1
**SJTU 2020Fall CS410 人工智能（B类）课程大作业**

**Project1: Drug Molecular Toxicity Prediction**

Environment: Tensorflow-gpu 1.15.0

Data: Tox21

Model: CNN (mixed)

AUC score: 0.86727 (with the weights in the folder)

branch_name: refs/heads/main


text:
Changelog
=========

### [1.0.2](https://github.com/VeliovGroup/ostrio-neo4jdriver/releases/tag/v1.0.2) *2015-09-24*
 - New core npm lib [neo4j-fiber](https://www.npmjs.com/package/neo4j-fiber)
 - [Demo app](https://github.com/VeliovGroup/ostrio-neo4jdriver/tree/master/demo)

### [0.2.15](https://github.com/VeliovGroup/ostrio-neo4jdriver/releases/tag/v0.2.15)

 - Trying to fix issue described [here](https://github.com/VeliovGroup/ostrio-neo4jdriver/issues/11)
 - Remove colon from file names, to avoid Windows compilation issues
 - Support for `audit-argument-checks` package

### [0.2.14](https://github.com/VeliovGroup/ostrio-neo4jdriver/releases/tag/v0.2.14)

 - Add check for parameters on all functions

### [0.2.13](https://github.com/VeliovGroup/ostrio-neo4jdriver/releases/tag/v0.2.13)

 - Better auth error

### [0.2.12](https://github.com/VeliovGroup/ostrio-neo4jdriver/releases/tag/v0.2.12)

 - Solve issue with standard Neo4j Authorisation

### [0.2.11](https://github.com/VeliovGroup/ostrio-neo4jdriver/releases/tag/v0.2.11)

 - Add known issues to docs

### [0.2.10](https://github.com/VeliovGroup/ostrio-neo4jdriver/releases/tag/v0.2.10)

 - Switch from Meteor.npmRequire to Npm.require

### [0.2.5](https://github.com/VeliovGroup/ostrio-neo4jdriver/releases/tag/v0.2.5)

 - Some minor updates
 - Add missed dependencies

### [0.2.1](https://github.com/VeliovGroup/ostrio-neo4jdriver/releases/tag/v0.2.1)

 - [Added] Catchall callbacks functionality: `this.N4JDB = new Neo4j(); N4JDB.listen(function(query, opts){...});`


text:
ua_parser Pig Library
======================

This is the Pig implementation of [ua-parser](https://github.com/tobie/ua-parser).
The implementation uses the shared regex patterns and overrides from regexes.yaml.

Build:
------

First download the sources for uap-core, uap-java and uap-pig into the same directory

    mkdir ua-parser
    git clone https://github.com/ua-parser/uap-core
    git clone https://github.com/ua-parser/uap-java
    git clone https://github.com/ua-parser/uap-pig

Now build and install the java version:

    cd uap-java
    mvn install

NOTE: You may have to skip the testing in case there is a problem

    mvn install -DskipTests=true

Now you can build the PIG udfs:

    cd ../uap-pig
    mvn package

Usage:
--------
```pig
REGISTER ua-parser-pig-0.1-SNAPSHOT-job.jar

DEFINE DeviceFamily     ua_parser.pig.device.Family;
DEFINE OsFamily         ua_parser.pig.os.Family;
DEFINE OsMajor          ua_parser.pig.os.Major;
DEFINE OsMinor          ua_parser.pig.os.Minor;
DEFINE OsPatch          ua_parser.pig.os.Patch;
DEFINE OsPatchMinor     ua_parser.pig.os.PatchMinor;
DEFINE UseragentFamily  ua_parser.pig.useragent.Family;
DEFINE UseragentMajor   ua_parser.pig.useragent.Major;
DEFINE UseragentMinor   ua_parser.pig.useragent.Minor;
DEFINE UseragentPatch   ua_parser.pig.useragent.Patch;

UserAgents =
    Load 'useragents.txt' AS (useragent:chararray);

AgentSpecs =
    FOREACH  UserAgents
    GENERATE DeviceFamily(useragent)    AS DeviceFamily:chararray,

             OsFamily(useragent)        AS OsFamily:chararray,
             OsMajor(useragent)         AS OsMajor:chararray,
             OsMinor(useragent)         AS OsMinor:chararray,
             OsPatch(useragent)         AS OsPatch:chararray,
             OsPatchMinor(useragent)    AS OsPatchMinor:chararray,

             UseragentFamily(useragent) AS UseragentFamily:chararray,
             UseragentMajor(useragent)  AS UseragentMajor:chararray,
             UseragentMinor(useragent)  AS UseragentMinor:chararray,
             UseragentPatch(useragent)  AS UseragentPatch:chararray,

             useragent                  AS Useragent;

DUMP AgentSpecs;
```

Author:
-------

  * Niels Basjes [@nielsbasjes](https://twitter.com/nielsbasjes)

  This is a trivial interface on top of the Java API created by Steve Jiang [@sjiang](https://twitter.com/sjiang)

repository: ua-parser/uap-pig

repo_name: ua-parser/uap-pig


text:
---
time: 2-4pm
location: 1025 SSW
presenter: Adji Dieng
scribe: Andrew Davison
---

Johnson, Matthew J., et al. "Composing graphical models with neural networks for structured representations and fast inference." Advances in Neural Information Processing Systems (2016). [link](http://arxiv.org/pdf/1603.06277)

Gao, Yuanjun, et al. "Linear dynamical neural population models through nonlinear embeddings." Advances in Neural Information Processing Systems (2016). [link](http://arxiv.org/pdf/1605.08454)

(optional) Krishnan, Rahul G., Uri Shalit, and David Sontag. "Deep Kalman Filters."_arXiv preprint arXiv:1511.05121_ (2015). [link](http://arxiv.org/pdf/1511.05121)

branch_name: refs/heads/staging


text:
# Loyalty Account Expiring Point Deadline

Represents a set of points for a loyalty account that are scheduled to expire on a specific date.

## Structure

`Loyalty Account Expiring Point Deadline`

## Fields

| Name | Type | Tags | Description |
|  --- | --- | --- | --- |
| `points` | `int` | Required | The number of points scheduled to expire at the `expires_at` timestamp. |
| `expires_at` | `str` | Required | The timestamp of when the points are scheduled to expire, in RFC 3339 format.<br>**Constraints**: *Minimum Length*: `1` |

## Example (as JSON)

```json
{
  "points": 236,
  "expires_at": "expires_at6"
}
```

repository: square/square-python-sdk

gha_language: Python

gha_license_id: NOASSERTION

repo_name: square/square-python-sdk


text:
# MSDN Samples Archive for ggailey777

This is the archive of samples that I personally created and published to MSDN Code Gallery over the years to support the following Microsoft technologies:

+ WCF Data Services
+ OData
+ Azure Mobile Services
+ Windows Phone
+ Notification Hubs
+ Windows apps

Most of these projects are very out of date and most of the technologies are no longer supported. Many were created to support posts on my old [Writing Data Services](http://blogs.msdn.com/b/writingdata_services/) blog, so I just wanted to keep these around for posterity's sake. (Thanks [GitHub](https://github.com/ggailey777).)

![The old MSDN Code Gallery page for my samples](code-gallery-screenshot.png)


text:
# Go
[Go](https://github.com/golang/go) (also known as Golang) is an open source programming language maintained by Google.

## Installation

    $ brew install golang

When installed, try to run `go version` to see the installed version of Go.

## Setup your workspace
### Add environment variables
Go has a unique approach of managing code where you have a single workspace for all your Go projects. For more information see the [documentation](https://golang.org/doc/code.html#Workspaces).

First, you'll need to tell Go the location of your workspace. We'll do this by adding some environment variables in your shell config file (usually `.bash_profile`, `.bashrc` or `.zshrc`).

Or I used this while my installation

```sh
export GOROOT=/usr/local/go
export GOPATH=YOUR FOLDER LOCATION (run command *pwd* + the folder name)
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin

```
OR

```sh
export GOPATH=$HOME/go
export GOROOT=/usr/local/opt/go/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
```

### Create your workspace
Create the workspace directories tree:

    $ mkdir -p $GOPATH $GOPATH/src $GOPATH/pkg $GOPATH/bin

`$GOPATH/src` This is where your Go projects are located
`$GOPATH/pkg` A folder that contains every package objects
`$GOPATH/bin` The compiled binaries home

## Write your first program
Create a file in your `$GOPATH/src`, for example `hello.go`, and input the following code

```go
package main
import "fmt"

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

Run the program by running:

    $ go run hello.go

If you wish to compile it and move it to `$GOPATH/bin`, then run:

    $ go install hello.go

Since we have `$GOPATH/bin` added to our `$PATH`, you can run your program from anywhere:

    $ hello

## Import a Go package
Besides creating your own packages you can import and use other packages in your Go code. To do so you'll use the `go get` command:

    $ go get -u github.com/gorilla/mux

The command above will import the package `mux` into this directory `$GOPATH/src/github.com/gorilla/mux`.

You can then use this package in your Go programs like this:
```go
package main

import (
    "net/http"
    "log"
    "github.com/gorilla/mux" // Your imported package
)

func YourHandler(w http.ResponseWriter, r *http.Request) {
    w.Write([]byte("Gorilla!\n"))
}

func main() {
    r := mux.NewRouter()
    // Routes consist of a path and a handler function.
    r.HandleFunc("/", YourHandler)

    // Bind to a port and pass our router in
    log.Fatal(http.ListenAndServe(":8000", r))
}
```

## Format your code
Go has a built-in tool that automatically formats Go source code.

To format a single file run:

    $ gofmt -w yourcode.go

You can also format an entire package (**Note that the command is different from formatting a single file**):

    $ go fmt path/to/your/package

## Generate documentation
With the `godoc` command you can generate documentation from your code and read documentation from other packages.

    $ godoc fmt                # documentation for package fmt
    $ godoc fmt Printf         # documentation for fmt.Printf
    $ godoc -src fmt           # fmt package interface in Go source form

You need to respect some spec in order to document using `godoc`. More information in the [Godoc documentation](https://blog.golang.org/godoc-documenting-go-code).

## Learn more
This [interactive tutorial](https://tour.golang.org/) will let you learn more about Go.

## This is a Copied Documentation
This ReadMe file was copied from from [Sourabh Bajaj](https://github.com/sb2nov/mac-setup/edit/master/Go/).

repository: beingfranklin/Go-Algorithms

path: /Go Lang Info.md

filename: Go Lang Info.md

repo_name: beingfranklin/Go-Algorithms


text:
<!-- markdownlint-disable MD041 -->
<!-- markdownlint-disable MD002 -->
## v5.0.1 (August 2023)

* Update python dependencies

## v5.0.0 (June 2023)

* Add repo best practices
* Structure terraform files in separate folder
* Add script test cases
* Add repo controls into workflows
* Bump major version due to module reference

## v4.3.9 (May 2023)

* Refactor GitHub Actions and script structure
* Enhancements to GitHub Actions Workflow
* Documentation Updates

## v4.3.8 (May 2023)

* Simplify Contribution Workflow
* Fix GitHub Actions

## v4.3.7 (May 2023)

* Update `version.tf` to support aws provider >= 3.41

## v4.3.6 (February 2023)

* Update `default_cache_behavior` and `dynamic_ordered_cache_behavior` with ability to accept `response_headers_policy_id`(UUID) parameter.

* Move from Travis CI to GitHub Actions

## v4.3.5 (June 2021)

* Update to add Cloudfront Function support.  PLEASE NOTE: Logging must be enabled for the function to be attached.

## v4.3.4 (May 2021)

* Update `origin_path` variables to default to `""` as opposed to `null`.  This will solve issue #36

## v4.3.3 (April 2021)

* Add enhancement to support `cache_policy_id` and `origin_request_policy_id`.  When in use, forwarded values cannot be used.  You are now able to set `use_forwarded_values` in the cache behavior blocks.

* General Code clean-up

## v4.3.2 (October 2020)

* fix `dynamic_s3_origin_config` variable, to match the configuration of `dynamic_custom_origin_config`. This fixes a bug where `custom_headers` couldn't be set.

## v4.3.1 (September 2020)

* refactored the `dynamic_custom_error_response` variable, specifying all the fields is not needed anymore

## v4.3.0 (August 2020)

* Updated the module to support AWS Provider 3.0.0, this is now minimum version required
* `active_trusted_signers` variable has been renamed to `trusted_signers` to accomodate the change in the provider
* Supports now `TLSv1.2_2019` for SSL in Cloudfront, under the `minimum_protocol_version` variable

## v4.2.1 (March 2020)

* fixed a bug that was previously allowing to apply a security policy when no certificate is specified
* default root object now set as null

## v4.2.0 (February 2020)

* Added ability to disable the creation of the resource with variable `create_cf`, defaults to `true`
* Adding possibility to add additional tags
* Inside `ordered_cache_behavior` & `default_cache_behavior` made these variables optional: `compress`, `headers`, `min_ttl`, `max_ttl`, `default_ttl`, also made `lambda_function_association` optional, now possible not to specify it at all
* Inside `lambda_function_association`, made the variable `include_body` optional
* Inside `logging_config`, the variables `include_cookies` & `prefix` are now optional
* `origin_group` is now optional
* `logging_config` & `default_cache_behavior` are not iterating anymore (as there can be only max one of these configs)
* remove `provider.tf` as this should be defined per implementation.  Also removed `region` variable as this was only used for the provider.
* certificates - `cloudfront_default_certificate` & `ssl_support_method` are not required anymore, they default to `true` & `sni-only` if a certificate acm or iam is specified, configuration will auto modify them

## v4.1.1 (February 2020)

* Adding in the ability to Test
* Adding ability to bump version
* Files created: `CONTRIBUTING.md` `VERSION` `bump.py` `.travis.yml`

## v4.1.0 (February 2020)

* Add all CloudFront outputs
* Made `s3_origin_config` dynamic and `origin_access_identity` optional

## v4.0.0 (February 2020)

* Update the `viewer_certificate` block to include `acme_certificate_arn` and `cloudfront_default_certificate`
* Update the name of `ssl_certificate` to `iam_certificate_id` to align with the resource
* Made `iam_certificate_id` optional

## v3.0.0 (February 2020)

* Update to Terraform version 12 syntax
* Add `custom_header` to both `dynamic_custom_origin_config` and `dynamic_s3_origin_config`
* Update the way origin group members are assigned.  Fixes [Issue #1](https://github.com/jmgreg31/terraform-aws-cloudfront/issues/1)
* Remove the dependancy to always have `origin_path` defined
* Add `lambda_function_assocation` to all cache behaviors.  Fixes [Issue #3](https://github.com/jmgreg31/terraform-aws-cloudfront/issues/3)

## v2.0.0 (June 2019)

* Update to `dynamic_custom_origin_config` variable to include `origin_path`
* Breaking change as you will now need to include this in your variable block
* Fixes [Issue #5](https://github.com/jmgreg31/terraform-aws-cloudfront/issues/5)

## v1.0.0 (June 2019)

* Initial Release
* Supports Terraform Version 12 only

gha_language: HCL


text:
# Proxy Pattern

## Intent
Provide a surrogate or placeholder for another object to control access to it.

## Applicability
Proxy is applicable whenever there is a need for a more versatile or sophisticated
reference to an object than a simple pointer. Here are several common situations
in which the Proxy pattern is applicable:
1. A remote proxy provides a local representative for an object in a different address space.
2. A virtual proxy creates expensive objects on demand.
3. A protection proxy controls access to the original object. Protection proxies are useful when objects should have different access rights.
4. A smart reference is a replacement for a bare pointer that performs additional actions when an object is accessed. Typical uses include
    - counting the number of references to the real object so that it can be freed automatically when there are no more references.
    - loading a persistent object into memory when it's first referenced.
    - checking that the real object is locked before it's accessed to ensure that no other object can change it.

## Structure
![proxy](./etc/proxy.png)

## Participants
* **Proxy**
    - maintains a reference that lets the proxy access the real subject. Proxy may refer to a Subject if the RealSubject and Subject interfaces are the same.
    - provides an interface identical to Subject's so that a proxy can by substituted for the real subject.
    - controls access to the real subject and may be responsible for creating and deleting it.
    - other responsibilities depend on the kind of proxy:
        - remote proxies are responsible for encoding a request and its arguments and for sending the encoded request to the real subject in a different address space.
        - virtual proxies may cache additional information about the real subject so that they can postpone accessing it. For example, the ImageProxy from the Motivation caches the real image's extent.
        - protection proxies check that the caller has the access permissions required to perform a request.
* **Subject**
    - defines the common interface for RealSubject and Proxy so that a Proxy can be used anywhere a RealSubject is expected.
* **RealSubject**
    - defines the real object that the proxy represents.

## Example
There is a computer running linux. We can SSH to the computer and feel like we are operating the real computer. SSH is the proxy.

Participants in this example:
* Computer is the **Subject**.
* LinuxComputer is the **RealSubject**.
* SecurityShell is the **Proxy**.

## Scala Tips
None

## Reference
* Design Patterns: Elements of Reusable Object-Oriented Software

repository: Luka-Abey/scala-design-patterns

repo_name: Luka-Abey/scala-design-patterns


text:
# Boxed value

A _boxed value_ is a type representing a constant value. It has a public static
`const` or `constexpr` member called `value`. The class represents that value as
a type, so it can be manipulated by [template metafunction](metafunction.html)s.
It has to be a [template metaprogramming value](metaprogramming_value.html).

For example the following `struct` represents the `true` value of type `bool`:

```cpp
struct true_type
{
  static constexpr bool value = true;
  using type = true_type;
};
```

The `value` member is the wrapped value. `true_type::type` is an alias of
`true_type` which makes it a template metaprogramming value.

<p class="copyright">
Copyright Abel Sinkovics (abel at elte dot hu) 2014.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
[http://www.boost.org/LICENSE_1_0.txt](http://www.boost.org/LICENSE_1_0.txt)
</p>

[[up]](reference.html)


text:
---
title: "Face Recognition"
draft: false
weight: 14
katex: true
---

### Differentiating between Face Verification and Recognition
- Face verification
	- We input an image and a name ID
	- A face verification method outputs if the image belongs to that claimed name ID
	- Face verification is typically easier than face recognition
	- This is because we only need to verify a single face to one ID
	- Specifically, the accuracy needs to be around $99%$
- Face recognition
	- We input an image
	- A face recognition method outputs if the image belongs to any name IDs
	- Face recognition is typically harder than face verification
	- This is because we need to verify a single face to many IDs
	- Specifically, the accuracy needs to be around $99.99%$

### Motivating One-Shot Learning
- Typically, we'll only have a single image associated with a name ID in our database
- Most face recognition systems need to learn from this one image
- Consequently, the learning algorithm trains on a small sample
- This problem is called the *one-shot learning* problem
- The one-shot learning problem is one of the main challenges for most face recognition systems

### Describing One-Shot Learning
- Instead of learning the weights from a convolutional network, we want to learn a similarity function
- This similarity function measures the difference between two images
- Specifically, the similarity function is defined as the following:

$$
d(x_{1}, x_{2}) = \Vert f(x_{1}) - f(x_{2}) \Vert_{2}^{2}
$$

- Where $x_{1}$ and $x_{2}$ are two different images
- Where $f(x_{1})$ and $f(x_{2})$ are the activations of a fully-connected output layer from a siamese network
	- We will talk about the siamese network in the next section
- The similarity function returns:
	- A small number if the two images are similar
	- A large number if the two images are different
- This is defined as the following:

$$
d(img_{1}, img_{2}) \le \tau \implies \text{similar}
$$

$$
d(img_{1}, img_{2}) > \tau \implies \text{different}
$$

- Here, $\tau$ represents some threshold hyperparameter
- This is the root of all face verification problems
- For face recognition, we would need to calculate this similarity function on the input image and each image in our database

### Introducing Siamese Network
- A siamese network is a convolutional network found in face recognition problems
- Roughly, a siamese network encodes an input image into a $128$-digit vector
- Specifically, a siamese network architecture refers to running two different images on an identical network
- A siamese network is trained such that the similarity function ensures encodings (or output layer) of the same person return a small value
- In other words, a siamese network learns parameters such that:
	- If $x_{i}$ and $x_{j}$ are the same person, then $\Vert f(x_{i}) - f(x_{j}) \Vert_{2}^{2}$ is small
	- If $x_{i}$ and $x_{j}$ are different people, then $\Vert f(x_{i}) - f(x_{j}) \Vert_{2}^{2}$ is large
- Formally, parameters of a siamese network define an encoding $f(x_{i})$
- Formally, an input image $x_{i}$ will be encoded into a $128$-digit vector $f(x_{i})$

![siamesenetwork](../../../img/siamese_network.jpg)

### Defining the Triplet Loss Function
- A siamese network uses a triplet loss function
- The triplet loss function is defined as the following:

$$
tp = \Vert f(x^{a}) - f(x^{p}) \Vert_{2}^{2} - \Vert f(x^{a}) - f(x^{n}) \Vert_{2}^{2} + \alpha
$$

$$
\mathcal{L}(x^{a}, x^{p}, x^{n}) = \max(tp, 0)
$$

- Here, $f(x^{a})$ refers to the encoded activations of an anchor image
- Here, $f(x^{p})$ refers to the encoded activations of a positive image
- Here, $f(x^{a})$ refers to the encoded activations of a negative image
- An anchor image refers to an input image we want to test
- A positive image refers to a saved image that is the same person from the anchor image
- A negative image refers to a saved image that is not the same person from the anchor image

### Describing the Triplet Loss Function
- The term *triplet* loss comes from always needing to train on three images at a time
- Therefore, we will need multiple pictures of the same person
- For example, we may need $10$ pictures for each person
- We want the encodings of the anchor image to be very similar to the positive image and very different from the negative image
- Formally, we want the following:

$$
\Vert f(x_{i}^{a}) - f(x_{i}^{p}) \Vert_{2}^{2} \quad \le \quad \Vert f(x_{i}^{a}) - f(x_{i}^{n}) \Vert_{2}^{2}
$$

- This can also be written as the following:

$$
\Vert f(x_{i}^{a}) - f(x_{i}^{p}) \Vert_{2}^{2} - \Vert f(x_{i}^{a}) - f(x_{i}^{n}) \Vert_{2}^{2} \quad \le \quad 0
$$

- We can satisfy this equation by setting each term to $0$:

$$
\Vert \underbrace{f(x_{i}^{a}) - f(x_{i}^{p})}_{0} \Vert_{2}^{2} - \Vert \underbrace{f(x_{i}^{a}) - f(x_{i}^{n})}_{0} \Vert_{2}^{2} \quad \le \quad 0
$$

- Obviously, we don't want our network to train our images such that our encodings become equal to $0$
- Meaning, the encoding would be equal to the encoding of every other image
- Therefore, we need to modify the objective such that our terms are smaller than $0$:

$$
\Vert f(x_{i}^{a}) - f(x_{i}^{p}) \Vert_{2}^{2} - \Vert f(x_{i}^{a}) - f(x_{i}^{n}) \Vert_{2}^{2} \quad \le \quad 0 - \alpha
$$

- We need to tune the hyperparameter $\alpha$ to find the right threshold
- The hyperparameter $\alpha$ is referred to as a *margin*
- Including $\alpha$ will prevent our network from learning those trivial solutions
- We can reformulate the formula to be the following:

$$
\Vert f(x_{i}^{a}) - f(x_{i}^{p}) \Vert_{2}^{2} - \Vert f(x_{i}^{a}) - f(x_{i}^{n}) \Vert_{2}^{2} + \alpha \quad \le \quad 0
$$

### Example of the Triplet Loss Function
- Let's say we set $\alpha=0.2$
- Then, our output could be the following:

$$
\Vert f(x_{i}^{a}) - f(x_{i}^{p}) \Vert_{2}^{2} + \underbrace{\alpha}_{0.2} = 0.5
$$

$$
\Vert f(x_{i}^{a}) - f(x_{i}^{n}) \Vert_{2}^{2} = 0.51
$$

$$
\underbrace{\Vert f(x_{i}^{a}) - f(x_{i}^{p}) \Vert_{2}^{2} + \alpha}_{0.5} \quad \le \quad \underbrace{\Vert f(x_{i}^{a}) - f(x_{i}^{n}) \Vert_{2}^{2}}_{0.51}
$$

- We can see that these terms satisfy our triplet loss condition
- Obviously, we would prefer for the gap to be larger between our positive and negative images
- For example, we'd prefer the following at the very least:

$$
\underbrace{\Vert f(x_{i}^{a}) - f(x_{i}^{p}) \Vert_{2}^{2} + \alpha}_{0.5} \quad \le \quad \underbrace{\Vert f(x_{i}^{a}) - f(x_{i}^{n}) \Vert_{2}^{2}}_{0.7}
$$

- Alternatively, we could push the $d(a,n)$ up or $d(a,p)$ down
- However, we'd obviously prefer to satisfy both conditions

### Choosing the Triplets $x^{a}$, $x^{p}$, and $x^{n}$
- We don't want to randomly choose $x^{a}$, $x^{p}$, and $x^{n}$
- If we randomly choose these images, then $d(x^{a}, x^{p}) + \alpha \le d(x^{a}, x^{n})$ is easily satisfied
- Therefore, we'll want to choose triplets that are *hard* to train on when construction our training set
- Meaning, we want to choose $x^{a}$, $x^{p}$, and $x^{n}$ so that this is initially true early on in training:

$$
d(x^{a}, x^{p}) \approx d(x^{a}, x^{n})
$$

---

### tldr
- One-shot learning is a training algorithm
- Specifically, one-shot learning involves training on two images such that the similarity between the two images is minimized
- This similarity function is defined as the following:

$$
d(x_{1}, x_{2}) = \Vert f(x_{1}) - f(x_{2}) \Vert_{2}^{2}
$$

- A siamese network is a convolutional network found in face recognition problems
- Roughly, a siamese network encodes an input image into a $128$-digit vector
- A siamese network learns parameters such that:
	- If $x_{i}$ and $x_{j}$ are the same person, then $\Vert f(x_{i}) - f(x_{j}) \Vert_{2}^{2}$ is small
	- If $x_{i}$ and $x_{j}$ are different people, then $\Vert f(x_{i}) - f(x_{j}) \Vert_{2}^{2}$ is large
- A siamese network uses a triplet loss function
- The triplet loss function is defined as the following:

$$
tp = \Vert f(x^{a}) - f(x^{p}) \Vert_{2}^{2} - \Vert f(x^{a}) - f(x^{n}) \Vert_{2}^{2} + \alpha
$$

$$
\mathcal{L}(x^{a}, x^{p}, x^{n}) = \max(tp, 0)
$$

- The term *triplet* loss comes from always needing to train on three images at a time
- Therefore, we will need multiple pictures of the same person
- We want the encodings of the anchor image to be very similar to the positive image and very different from the negative image
- We want to choose triplets that are *hard* to train on when construction our training set

---

### References
- [Difference between Face Recognition and Verification](https://www.youtube.com/watch?v=-FfMVnwXrZ0&list=PLkDaE6sCZn6Gl29AoE31iwdVwSG-KnDzF&index=32)
- [One-Shot Learning](https://www.youtube.com/watch?v=96b_weTZb2w&list=PLkDaE6sCZn6Gl29AoE31iwdVwSG-KnDzF&index=33)
- [Siamese Network](https://www.youtube.com/watch?v=6jfw8MuKwpI&list=PLkDaE6sCZn6Gl29AoE31iwdVwSG-KnDzF&index=34)
- [Triplet Loss Function](https://www.youtube.com/watch?v=d2XB5-tuCWU&list=PLkDaE6sCZn6Gl29AoE31iwdVwSG-KnDzF&index=35)


text:
# Kubernetes in the Google Cloud
  * [Introduction to Docker](#introduction-to-docker)
  * [Kubernetes Engine: Qwik Start](#kubernetes-engine--qwik-start)
    + [Setting a default compute zone](#setting-a-default-compute-zone)
    + [Create cluster](#create-cluster)
    + [Get authentication credentials for the cluster](#get-authentication-credentials-for-the-cluster)
    + [Deploying an application to the cluster](#deploying-an-application-to-the-cluster)
  * [Orchestrating the Cloud with Kubernetes](#orchestrating-the-cloud-with-kubernetes)
    + [Pods](#pods)
    + [Interacting with Pods](#interacting-with-pods)
    + [Services](#services)
    + [Adding Labels to Pods](#adding-labels-to-pods)
    + [Deploying Applications with Kubernetes](#deploying-applications-with-kubernetes)
  * [Managing Deployments Using Kubernetes Engine](#managing-deployments-using-kubernetes-engine)
    + [Scale a Deployment](#scale-a-deployment)
    + [Rolling update](#rolling-update)
    + [Rollback an update](#rollback-an-update)
    + [Canary deployments](#canary-deployments)
    + [Canary deployments in production - session affinity](#canary-deployments-in-production---session-affinity)
    + [Blue-green deployments](#blue-green-deployments)
      - [Blue-Green Rollback](#blue-green-rollback)
  * [Continuous Delivery with Jenkins in Kubernetes Engine](#continuous-delivery-with-jenkins-in-kubernetes-engine)
    + [What is Kubernetes Engine?](#what-is-kubernetes-engine-)
    + [What is Jenkins?](#what-is-jenkins-)
    + [Install Helm](#install-helm)
    + [Configure and Install Jenkins](#configure-and-install-jenkins)
      - [Connect to Jenkins](#connect-to-jenkins)
      - [Understanding the Application](#understanding-the-application)
      - [Deploying the Application](#deploying-the-application)
    + [Creating the Jenkins Pipeline](#creating-the-jenkins-pipeline)
      - [Adding your service account credentials](#adding-your-service-account-credentials)
      - [Creating the Jenkins job](#creating-the-jenkins-job)
    + [Creating the Development Environment](#creating-the-development-environment)
      - [Creating a development branch](#creating-a-development-branch)
      - [Modify the site](#modify-the-site)
    + [Deploying to production](#deploying-to-production)

## Introduction to Docker
```
$ docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
9db2ca6ccae0: Pull complete
Digest: sha256:4b8ff392a12ed9ea17784bd3c9a8b1fa3299cac44aca35a85c90c5e3c7afacdc
Status: Downloaded newer image for hello-world:latest

Hello from Docker!
This message shows that your installation appears to be working correctly.
...

$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
hello-world         latest              fce289e99eb9        6 months ago        1.84kB

$ docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED              STATUS                          PORTS               NA
MES
d2ac9eaf5345        hello-world         "/hello"            19 seconds ago       Exited (0) 18 seconds ago                           sa
d_yonath
d4166a5d66b2        hello-world         "/hello"            About a minute ago   Exited (0) About a minute ago                       di
stracted_knuth
```
Add DockerFile
```
$ mkdir test && cd test
$ cat > Dockerfile <<EOF
# Use an official Node runtime as the parent image
FROM node:6

# Set the working directory in the container to /app
WORKDIR /app

# Copy the current directory contents into the container at /app
ADD . /app

# Make the container's port 80 available to the outside world
EXPOSE 80

# Run app.js using node when the container launches
CMD ["node", "app.js"]
```
App details
```
cat > app.js <<EOF
const http = require('http');

const hostname = '<IP_ADDRESS>';
const port = 80;

const server = http.createServer((req, res) => {
    res.statusCode = 200;
      res.setHeader('Content-Type', 'text/plain');
        res.end('Hello World\n');
});

server.listen(port, hostname, () => {
    console.log('Server running at http://%s:%s/', hostname, port);
});

process.on('SIGINT', function() {
    console.log('Caught interrupt signal and will exit');
    process.exit();
});
EOF
EOF
```

**Build it**
```
docker build -t node-app:0.1 .
```
It might take a couple of minutes for this command to finish executing.

List it
```
$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
node-app            0.1                 9abd86ddd1eb        6 seconds ago       884MB
node                6                   ab290b853066        2 months ago        884MB
hello-world         latest              fce289e99eb9        6 months ago        1.84kB
```

```
$ docker run -p 4000:80 --name my-app node-app:0.1
Server running at http://<IP_ADDRESS>:80/
```

On another terminal:
```
$ curl http://localhost:4000
Hello World
```

The container will run as long as the initial terminal is running. If you want the container to run in the background (not tied to the terminal's session), you need to specify the -d flag.
```
$ docker run -p 4000:80 --name my-app -d node-app:0.1
3ef42db03f10920c8fa2645e4d3d3e58f03e4d28892bd66730885dcf62911d81

$ docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS                  NAMES
3ef42db03f10        node-app:0.1        "node app.js"       19 seconds ago      Up 18 seconds       <IP_ADDRESS>:4000->80/tcp   my-app
```
Edit app.js
```
....
const server = http.createServer((req, res) => {
    res.statusCode = 200;
      res.setHeader('Content-Type', 'text/plain');
        res.end('Welcome to Cloud\n');
});
....
```
and Docker build

Tag project and push
```
$ docker tag node-app:0.2 gcr.io/qwiklabs-gcp-gcpd-5a0d22780ec3/node-
app:0.2

$ docker images
REPOSITORY                                       TAG                 IMAGE ID            CREATED             SIZE
node-app                                         0.2                 a459ec7b7ffa        2 minutes ago       884MB
gcr.io/qwiklabs-gcp-gcpd-5a0d22780ec3/node-app   0.2                 a459ec7b7ffa        2 minutes ago       884MB
node-app                                         0.1                 9abd86ddd1eb        6 minutes ago       884MB
node                                             6                   ab290b853066        2 months ago        884MB
hello-world                                      latest              fce289e99eb9        6 months ago        1.84kB

$ docker push gcr.io/qwiklabs-gcp-gcpd-5a0d22780ec3/node-app:0.2
```

Test it by removing all items from current space
```
docker stop $(docker ps -q)
docker rm $(docker ps -aq)

docker rmi node-app:0.2 gcr.io/[project-id]/node-app node-app:0.1
docker rmi node:6
docker rmi $(docker images -aq) # remove remaining images
docker images
```
Now pull from registry
```
docker pull gcr.io/[project-id]/node-app:0.2
docker run -p 4000:80 -d gcr.io/[project-id]/node-app:0.2
curl http://localhost:4000
```

## Kubernetes Engine: Qwik Start
```
$ gcloud config list project
[core]
project = qwiklabs-gcp-gcpd-5a0d22780ec3
Your active configuration is: [cloudshell-5386]
```

### Setting a default compute zone
```
gcloud config set compute/zone us-central1-a
```

### Create cluster
```
gcloud container clusters create mykube01
```

### Get authentication credentials for the cluster
```
$ gcloud container clusters get-credentials mykube01
Fetching cluster endpoint and auth data.
kubeconfig entry generated for mykube01.
```

### Deploying an application to the cluster
```
$ kubectl run hello-server --image=gcr.io/google-samples/hello-app:1.0 --port 8080
```
Expose it
kubectl expose deployment hello-server --type="LoadBalancer"

get details
kubectl get service hello-server
NAME           TYPE           CLUSTER-IP   EXTERNAL-IP      PORT(S)          AGE
hello-server   LoadBalancer   <IP_ADDRESS>    <IP_ADDRESS>   8080:31523/TCP   82s

Test with IP

## Orchestrating the Cloud with Kubernetes
Set Region
```
gcloud config set compute/zone us-central1-b
```
create a cluster
```
gcloud container clusters create io
```

Get the sample code
```
git clone https://github.com/googlecodelabs/orchestrate-with-kubernetes.git
cd orchestrate-with-kubernetes/kubernetes
ls
```

Create Deployment
```
kubectl create deployment nginx --image=nginx:1.10.0
```

Check pod status
```
kubectl get pods
```
Expose the service
```
kubectl expose deployment nginx --port 80 --type LoadBalancer
```
Behind the scenes Kubernetes created an external Load Balancer with a public IP address attached to it. Any client who hits that public IP address will be routed to the pods behind the service. In this case that would be the nginx pod.

Check services
```
$ kubectl get services
NAME         TYPE           CLUSTER-IP   EXTERNAL-IP   PORT(S)        AGE
kubernetes   ClusterIP      <IP_ADDRESS>     <none>        443/TCP        8m41s
nginx        LoadBalancer   <IP_ADDRESS>   <pending>     80:32594/TCP   40s
```

Check access using curl

### Pods
At the core of Kubernetes is the Pod.

Pods represent and hold a collection of one or more containers. Generally, if you have multiple containers with a hard dependency on each other, you package the containers inside a single pod.
```
$ cat pods/monolith.yaml
apiVersion: v1
kind: Pod
metadata:
  name: monolith
  labels:
    app: monolith
spec:
  containers:
    - name: monolith
      image: kelseyhightower/monolith:1.0.0
      args:
        - "-http=<IP_ADDRESS>:80"
        - "-health=<IP_ADDRESS>:81"
        - "-secret=secret"
      ports:
        - name: http
          containerPort: 80
        - name: health
          containerPort: 81
      resources:
        limits:
          cpu: 0.2
          memory: "10Mi"
```
Create a pod
```
kubectl create -f pods/monolith.yaml
```
Describe pod
```
kubectl describe pods monolith
```

### Interacting with Pods
By default, pods are allocated a private IP address and cannot be reached outside of the cluster. Use the kubectl port-forward command to map a local port to a port inside the monolith pod.

on the 2nd terminal, run this command to set up port-forwarding:
```
kubectl port-forward monolith 10080:80
```

Now in the 1st terminal start talking to your pod using curl:
```
curl http://<IP_ADDRESS>:10080
```

curl -u user http://<IP_ADDRESS>:10080/login

At the login prompt, use the super-secret password "password" to login.
 Services provide stable endpoints for Pods.
The level of access a service provides to a set of pods depends on the Service's type. Currently there are three types:
ClusterIP (internal) -- the default type means that this Service is only visible inside of the cluster,
NodePort gives each node in the cluster an externally accessible IP and
LoadBalancer adds a load balancer from the cloud provider which forwards traffic from the service to Nodes within it.

Create Service
```
cd ~/orchestrate-with-kubernetes/kubernetes
kubectl create secret generic tls-certs --from-file tls/
kubectl create configmap nginx-proxy-conf --from-file nginx/proxy.conf
kubectl create -f pods/secure-monolith.yaml

cat services/monolith.yaml
kind: Service
apiVersion: v1
metadata:
  name: "monolith"
spec:
  selector:
    app: "monolith"
    secure: "enabled"
  ports:
    - protocol: "TCP"
      port: 443
      targetPort: 443
      nodePort: 31000
  type: NodePort
 ```

 Enable port in GCP
 ```
 gcloud compute firewall-rules create allow-monolith-nodeport \
  --allow=tcp:31000
  ```

First, get an external IP address for one of the nodes.
  ```
  $ gcloud compute instances list
NAME                               ZONE           MACHINE_TYPE   PREEMPTIBLE  INTERNAL_IP  EXTERNAL_IP     STATUS
gke-io-default-pool-b58e5577-3vs4  us-central1-b  n1-standard-1               <IP_ADDRESS>   <IP_ADDRESS>   RUNNING
gke-io-default-pool-b58e5577-rkmj  us-central1-b  n1-standard-1               <IP_ADDRESS>   <IP_ADDRESS>   RUNNING
```
And try curl.

### Adding Labels to Pods

```
kubectl get pods -l "app=monolith"
kubectl get pods -l "app=monolith,secure=enabled"
kubectl label pods secure-monolith 'secure=enabled'
kubectl get pods secure-monolith --show-labels
kubectl describe services monolith | grep Endpoints

gcloud compute instances list
```

### Deploying Applications with Kubernetes
We're going to break the monolith app into three separate pieces:

auth - Generates JWT tokens for authenticated users.
hello - Greet authenticated users.
frontend - Routes traffic to the auth and hello services.

```
$ cat deployments/auth.yaml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: auth
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: auth
        track: stable
    spec:
      containers:
        - name: auth
          image: "kelseyhightower/auth:1.0.0"
          ports:
            - name: http
              containerPort: 80
            - name: health
              containerPort: 81

```

Create Deployment
```
kubectl create -f deployments/auth.yaml

Create service
kubectl create -f services/auth.yaml
```
Now do the same thing to create and expose the hello deployment:
```
kubectl create -f deployments/hello.yaml
kubectl create -f services/hello.yaml
```
And one more time to create and expose the frontend Deployment.

kubectl create configmap nginx-frontend-conf --from-file=nginx/frontend.conf
kubectl create -f deployments/frontend.yaml
kubectl create -f deployments/frontend.yaml

kubectl get services frontend
curl -k https://<EXTERNAL-IP>

## Managing Deployments Using Kubernetes Engine
Set zone
gcloud config set compute/zone us-central1-a

clone repo
```
git clone https://github.com/googlecodelabs/orchestrate-with-kubernetes.git
cd orchestrate-with-kubernetes/kubernetes
```
Create Cluster
```
gcloud container clusters create bootcamp --num-nodes 5 --scopes "https://www.googleapis.com/auth/projecthosting,storage-rw"
```

Learn about deployment
```
kubectl explain deployment
kubectl explain deployment.metadata.name
```

Edit vi deployments/auth.yaml
...
containers:
- name: auth
  image: kelseyhightower/auth:1.0.0
...

 You can now verify that the new version is always being used.
```
curl -ks https://`kubectl get svc frontend -o=jsonpath="{.status.loadBalancer.ingress[0].ip}"`/version
```
#### Blue-Green Rollback
```
kubectl apply -f services/hello-blue.yaml
```
Once you have updated the service, your rollback will have been successful. Again, verify that the right version is now being used:
```
curl -ks https://`kubectl get svc frontend -o=jsonpath="{.status.loadBalancer.ingress[0].ip}"`/version
```

## Continuous Delivery with Jenkins in Kubernetes Engine
https://cdn.qwiklabs.com/1b%2B9D20QnfRjAF8c6xlXmexot7TDcOsYzsRwp%2FH4ErE%3D
https://cloud.google.com/solutions/jenkins-on-container-engine

### What is Kubernetes Engine?
Kubernetes Engine is GCP's hosted version of Kubernetes - a powerful cluster manager and orchestration system for containers. Kubernetes is an open source project that can run on many different environments—from laptops to high-availability multi-node clusters; from virtual machines to bare metal. As mentioned before, Kubernetes apps are built on containers - these are lightweight applications bundled with all the necessary dependencies and libraries to run them. This underlying structure makes Kubernetes applications highly available, secure, and quick to deploy—an ideal framework for cloud developers.

### What is Jenkins?
Jenkins is an open-source automation server that lets you flexibly orchestrate your build, test, and deployment pipelines. Jenkins allows developers to iterate quickly on projects without worrying about overhead issues that can stem from continuous delivery.

Set location
gcloud config set compute/zone us-central1-f

Then clone the lab's sample code into your Cloud Shell:

git clone https://github.com/GoogleCloudPlatform/continuous-deployment-on-kubernetes.git

Now change to the correct directory:

cd continuous-deployment-on-kubernetes

Create a Kubernetes Cluster
```
gcloud container clusters create jenkins-cd \
--num-nodes 2 \
--machine-type n1-standard-2 \
--scopes "https://www.googleapis.com/auth/projecthosting,cloud-platform"
```
Check cluter
```
$ gcloud container clusters list
NAME        LOCATION       MASTER_VERSION  MASTER_IP      MACHINE_TYPE   NODE_VERSION   NUM_NODES  STATUS
jenkins-cd  us-central1-f  1.12.8-gke.10   <IP_ADDRESS>  n1-standard-2  1.12.8-gke.10  2          RUNNING
```

Get Credentials
```
$ gcloud container clusters get-credentials jenkins-cd

Fetching cluster endpoint and auth data.
kubeconfig entry generated for jenkins-cd.

$ kubectl cluster-info
Kubernetes master is running at https://<IP_ADDRESS>
GLBCDefaultBackend is running at https://<IP_ADDRESS>/api/v1/namespaces/kube-system/services/default-http-backend:http/proxy
Heapster is running at https://<IP_ADDRESS>/api/v1/namespaces/kube-system/services/heapster/proxy
KubeDNS is running at https://<IP_ADDRESS>/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
Metrics-server is running at https://<IP_ADDRESS>/api/v1/namespaces/kube-system/services/https:metrics-server:/proxy

To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.

```

### Install Helm
```
wget https://storage.googleapis.com/kubernetes-helm/helm-v2.14.1-linux-amd64.tar.gz
tar zxfv helm-v2.14.1-linux-amd64.tar.gz
cp linux-amd64/helm .
```

Add yourself as a cluster administrator in the cluster's RBAC so that you can give Jenkins permissions in the cluster:
```
kubectl create clusterrolebinding cluster-admin-binding --clusterrole=cluster-admin --user=$(gcloud config get-value account)
```
Grant Tiller, the server side of Helm, the cluster-admin role in your cluster:
```
kubectl create serviceaccount tiller --namespace kube-system
kubectl create clusterrolebinding tiller-admin-binding --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
```
Initialize Helm. This ensures that the server side of Helm (Tiller) is properly installed in your cluster.
```
./helm init --service-account=tiller
./helm update

./helm version
```

### Configure and Install Jenkins
Use the Helm CLI to deploy the chart with your configuration settings.
```
./helm install -n cd stable/jenkins -f jenkins/values.yaml --version 1.2.2 --wait
```
Check pods
```
$ kubectl get pods
NAME                          READY   STATUS    RESTARTS   AGE
cd-jenkins-546f5559b4-cxb4c   1/1     Running   0          2m14s
```
Configure the Jenkins service account to be able to deploy to the cluster.
```
kubectl create clusterrolebinding jenkins-deploy --clusterrole=cluster-admin --serviceaccount=default:cd-jenkins
```
Setup port forwarding
```
export POD_NAME=$(kubectl get pods --namespace default -l "app.kubernetes.io/component=jenkins-master" -l "app.kubernetes.io/instance=cd" -o jsonpath="{.items[0].metadata.name}")
kubectl port-forward $POD_NAME 8080:8080 >> /dev/null &
```
Check services
```
$ kubectl get svc
NAME               TYPE        CLUSTER-IP    EXTERNAL-IP   PORT(S)     AGE
cd-jenkins         ClusterIP   <IP_ADDRESS>   <none>        8080/TCP    3m51s
cd-jenkins-agent   ClusterIP   <IP_ADDRESS>     <none>        50000/TCP   3m51s
kubernetes         ClusterIP   <IP_ADDRESS>      <none>        443/TCP     24m
```
*Notice that this service exposes ports 8080 and 50000 for any pods that match the selector. This will expose the Jenkins web UI and builder/agent registration ports within the Kubernetes cluster. Additionally, the jenkins-ui services is exposed using a ClusterIP so that it is not accessible from outside the cluster.*

#### Connect to Jenkins
Get the token
```
printf $(kubectl get secret cd-jenkins -o jsonpath="{.data.jenkins-admin-password}" | base64 --decode);echo
```

To get to the Jenkins user interface, click on the Web Preview button in cloud shell, then click “Preview on port 8080”:

#### Understanding the Application
https://cdn.qwiklabs.com/P1T5JBWWprA4iLf%2FB5%2BO6as7otLE25YBde57gzZwSz4%3D

#### Deploying the Application
- Production: The live site that your users access.
- Canary: A smaller-capacity site that receives only a percentage of your user traffic. Use this environment to validate your software with live traffic before it's released to all of your users.

```
$ cd sample-app
$ kubectl create ns production
$ kubectl apply -f k8s/production -n production
$ kubectl apply -f k8s/canary -n production
$ kubectl apply -f k8s/services -n production
```

Scale up the production environment frontends by running the following command:
```
$ kubectl scale deployment gceme-frontend-production -n production --replicas 4
$ kubectl get pods -n production -l app=gceme -l role=frontend
NAME                                         READY   STATUS    RESTARTS   AGE
gceme-frontend-canary-84cc88cccf-sx6lw       1/1     Running   0          64s
gceme-frontend-production-5df96c664d-ldqgd   1/1     Running   0          10s
gceme-frontend-production-5df96c664d-r4mfl   1/1     Running   0          10s
gceme-frontend-production-5df96c664d-vp7g6   1/1     Running   0          77s
gceme-frontend-production-5df96c664d-xv55j   1/1     Running   0          10s

$ kubectl get pods -n production -l app=gceme -l role=backend
NAME                                       READY   STATUS    RESTARTS   AGE
gceme-backend-canary-688b9c69d9-rc6m6      1/1     Running   0          84s
gceme-backend-production-d6559978d-cpkvg   1/1     Running   0          97s

$ kubectl get service gceme-frontend -n production
NAME             TYPE           CLUSTER-IP   EXTERNAL-IP     PORT(S)        AGE
gceme-frontend   LoadBalancer   <IP_ADDRESS>   <IP_ADDRESS>   80:31024/TCP   74s
```
Paste External IP into a browser to see the info card displayed on a card—you should get a similar page:
https://cdn.qwiklabs.com/dfXfZfxRk0UMSTZm8FyIaLFsHla7AlUmxHO70UTOFjk%3D

Now, store the frontend service load balancer IP in an environment variable for use later:
```
export FRONTEND_SERVICE_IP=$(kubectl get -o jsonpath="{.status.loadBalancer.ingress[0].ip}" --namespace=production services gceme-frontend)

curl http://$FRONTEND_SERVICE_IP/version
```

### Creating the Jenkins Pipeline
Create a copy of the gceme sample app and push it to a Cloud Source Repository:
```
gcloud source repos create default
git init
git config credential.helper gcloud.sh
git remote add origin https://source.developers.google.com/p/$DEVSHELL_PROJECT_ID/r/default

git config --global user.email "[EMAIL_ADDRESS]"
git config --global user.name "[USERNAME]"

git add .
git commit -m "Initial commit"
git push origin master
```
#### Adding your service account credentials
Step 1: In the Jenkins user interface, click Credentials in the left navigation.

Step 2: Click Jenkins stored_scoped_cred.png

Step 3: Click Global credentials (unrestricted).

Step 4: Click Add Credentials in the left navigation.

Step 5: Select Google Service Account from metadata from the Kind drop-down and click OK.

The global credentials has been added. The name of the credential is the GCP Project ID found in the CONNECTION DETAILS section of the lab.

global_cred.png
#### Creating the Jenkins job

Navigate to your Jenkins user interface and follow these steps to configure a Pipeline job.

Step 1: Click Jenkins > New Item in the left navigation:

86e92964a4599231.png

Step 2: Name the project sample-app, then choose the Multibranch Pipeline option and click OK.

Step 3: On the next page, in the Branch Sources section, click Add Source and select git.

Step 4: Paste the HTTPS clone URL of your sample-app repo in Cloud Source Repositories into the Project Repository field. Replace [PROJECT_ID] with your GCP Project ID:

https://source.developers.google.com/p/[PROJECT_ID]/r/default

Step 5: From the Credentials drop-down, select the name of the credentials you created when adding your service account in the previous steps.

Step 6: Under Scan Multibranch Pipeline Triggers section, check the Periodically if not otherwise run box and set the Interval value to 1 minute.

 This meta-job identifies the branches in your repository and ensures changes haven't occurred in existing branches. If you click sample-app in the top left, the master job should be seen.

Note: The first run of the master job might fail until you make a few code changes in the next step.

You have successfully created a Jenkins pipeline! Next, you'll create the development environment for continuous integration.

### Creating the Development Environment

#### Creating a development branch
```
git checkout -b new-feature
```
Edit Jenkinsfile and add project ID.

#### Modify the site
o demonstrate changing the application, you will change the gceme cards from blue to orange.

Open html.go:
```
vi html.go
```
Change the two instances of <div class="card blue"> with following:
```
<div class="card orange">
```
Open main.go and change version
```
### Kick off Deployment
Commit and push your changes:
```
git add Jenkinsfile html.go main.go

git commit -m "Version 2.0.0"

git push origin new-feature
```
kubectl proxy &
curl \
http://localhost:8001/api/v1/namespaces/new-feature/services/gceme-frontend:80/proxy/version

### Deploying a Canary Release
Create a canary branch and push it to the Git server:

git checkout -b canary

git push origin canary

In Jenkins, you should see the canary pipeline has kicked off. Once complete, you can check the service URL to ensure that some of the traffic is being served by your new version.  Once complete, you can check the service URL to ensure that all of the traffic is being served by your new version, 2.0.0.
```
export FRONTEND_SERVICE_IP=$(kubectl get -o \
jsonpath="{.status.loadBalancer.ingress[0].ip}" --namespace=production services gceme-frontend)

while true; do curl http://$FRONTEND_SERVICE_IP/version; sleep 1; done
```
```
$ kubectl get service gceme-frontend -n production
NAME             TYPE           CLUSTER-IP   EXTERNAL-IP     PORT(S)        AGE
gceme-frontend   LoadBalancer   <IP_ADDRESS>   <IP_ADDRESS>   80:31024/TCP   31m

```

repository: Premkumarcandy/devops-playground

repo_name: Premkumarcandy/devops-playground


text:
# Koine::GoogleMapsClient

Google maps client for ruby

[![Build Status](https://travis-ci.org/mjacobus/koine-google_maps_client.svg?branch=master)](https://travis-ci.org/mjacobus/koine-google_maps_client)
[![Code Climate](https://codeclimate.com/github/mjacobus/koine-google_maps_client/badges/gpa.svg)](https://codeclimate.com/github/mjacobus/koine-google_maps_client)
[![Issue Count](https://codeclimate.com/github/mjacobus/koine-google_maps_client/badges/issue_count.svg)](https://codeclimate.com/github/mjacobus/koine-google_maps_client)
[![Coverage Status](https://coveralls.io/repos/github/mjacobus/koine-google_maps_client/badge.svg)](https://coveralls.io/github/mjacobus/koine-google_maps_client)

[![Gem Version](https://badge.fury.io/rb/koine-google_maps_client.svg)](https://badge.fury.io/rb/koine-google_maps_client)
[![Dependency Status](https://gemnasium.com/badges/github.com/mjacobus/koine-google_maps_client.svg)](https://gemnasium.com/github.com/mjacobus/koine-google_maps_client)

## Installation

Add this line to your application's Gemfile:

```ruby
# Gemfile
gem 'koine-google_maps_client'
```

## Usage

```ruby
require 'koine-google_maps_client'

client = Koine::GoogleMapsClient.new(api_key: 'your-key')

hash_response = client.geolocation(address: 'Dammtorstraße 30, Hamburg')
```

The response will be the hash representation of [this url](https://maps.googleapis.com/maps/api/geocode/json?address=Dammtorstra%C3%9Fe%2030,%2020354%20Hamburg&key=).

## Development

After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/mjacobus/koine-google_maps_client. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.

## License

The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).

## Resources

- [Docs](https://developers.google.com/maps/documentation/)
- [Geocoding](https://developers.google.com/maps/documentation/geocoding/start)


text:
# Server plugin: NodeAttestor "sshpop"

*Must be used in conjunction with the agent-side sshpop plugin*

The `sshpop` plugin attests nodes that have been provisioned with an ssh
identity through an out-of-band mechanism. It verifies that the certificate is
rooted to a trusted set of CAs and issues a signature based proof-of-possession
challenge to the agent plugin to verify that the node is in possession of the
private key.

The SPIFFE ID produced by the plugin is based on the certificate fingerprint,
which is an unpadded url-safe base64 encoded sha256 hash of the certificate in openssh format.

```xml
spiffe://<trust_domain>/spire/agent/sshpop/<fingerprint>
```

| Configuration           | Description                                                                                | Default                                 |
|-------------------------|--------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------|
| `cert_authorities`      | A list of trusted CAs in ssh `authorized_keys` format.                                                                         |                                         |
| `cert_authorities_path` | A file that contains a list of trusted CAs in ssh `authorized_keys` format.                                                    |                                         |
| `canonical_domain`      | A domain suffix for validating the hostname against the certificate's valid principals. See CanonicalDomains in ssh_config(5). |
| `agent_path_template`   | A URL path portion format of Agent's SPIFFE ID. Describe in text/template format.                                              | `"{{ .PluginName}}/{{ .Fingerprint }}"` |

If both `cert_authorities` and `cert_authorities_path` are configured, the resulting set of authorized keys is the union of both sets.

## Example Config

### agent.conf

```hcl
    NodeAttestor "sshpop" {
        plugin_data {
            host_cert_path = "./conf/agent/dummy_agent_ssh_key-cert.pub"
            host_key_path = "./conf/agent/dummy_agent_ssh_key"
        }
    }
```

### server.conf

```hcl
    NodeAttestor "sshpop" {
        plugin_data {
            cert_authorities = ["ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEAWPAsKJ/qMYUIBeH7BLMRCE/bkUvMHX+7OZhANk45S"]
            cert_authorities_path = "./conf/server/dummy_ssh_cert_authority.pub"

            # Sensibly check the FQDN set in the certificate principals.
            # canonical_domain = "example.com"

            # Change the agent's SPIFFE ID format
            # agent_path_template = "static/{{ index .ValidPrincipals 0 }}"
        }
    }
```

repository: spiffe/spire

gha_language: Go

repo_name: spiffe/spire


text:
# Exercise 2
Using the text-edit of your choice (e.g., Atom), create a new file called `README.md`. Alternatively, you may clone this repository and edit this file.

In your `README.md` document, make a three column table of the current courses you are taking, with separate columns for course number (in **bold**), course title (in _italics_), and instructor name.

| Course number | Course title | Instructor name |
|---|---|---|
|**ACCTG 302**|_Intermediate Accounting II_| D. Shores|
|**FIN 350**|_Business Finance_|Ran Duchin|
|**INFO 201**|_Technical Foundations of Informatics_| Michael Freeman|
|**ITAL 127**|_Survival Italian_| Sabrina Tatta

Note that you can preview this Markdown in Atom to make sure it works correctly.


text:
---
name: Feature request
about: Request a new feature

---

<!--
DELETE ME

Make sure you are using the latest version of AntennaPod. Perhaps the feature you are looking for has already been implemented.

Use the search function to see if someone else has already submitted the same feature request. If there is another request already, please upvote the first post instead of commenting something like "I also want this".

To make it easier for us to keep track of requests, please only make one feature request per issue.

Give a brief explanation about the problem that may currently exist and how your requested feature solves this problem.

Try to be as specific as possible. Please not only explain what the feature does, but also how. If your request is about (or includes) changing or extending the UI, describe what the UI would look like and how the user would interact with it.
-->

<!-- READ THIS: The latest version may be different depending on your device. You can find the version in AntennaPod's settings. -->
**App version**: x.y.z (state whether from Google Play/F-Droid/Custom built APK)

**Problem you may be having, or feature you want**:

**Suggested solution**:

**Screenshots / Drawings / Technical details**:

repository: vishchi/AntennaPod

repo_name: vishchi/AntennaPod


text:
# Chapter 2 : Types

<dialog character="mechanics">Welcome onboard captain, I'm the ship's mechanic. The first thing to do before departing is to define your ship's parameters. Go ahead!</dialog>

LIGO is a strongly and statically typed language. This means that the compiler checks how your contract processes data. If it passes the test, your contract will not fail at run-time due to inconsistent assumptions on your data. This is called type checking.

## Built-in types

LIGO comes with all basic types built-in like _string_, _int_ or _tez_ for account balance or monetary transactions. You can find all built-in types on the LIGO gitlab.

## Type aliases

Type aliasing consists in renaming a given type, when the context calls for a more precise name. This increases readability and maintainability of your smart contracts. For example we can choose to alias a string type as an animal breed - this will allow us to comunicate our intent with added clarity.

```
type breed = string
let dog_breed : breed = "Saluki"
```

## Simple types

The type account_balances denotes a map from addresses to tez

```
type account_balances = map (address, tez);

let ledger: account_balances =
  Map.literal
    ([("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" : address, 10mutez)]);
```

ℹWe will look more deeply into the _map_ construct in the following chapters.

## Structured types

Often contracts require complex data structures, which in turn require well-typed storage or functions to work with. LIGO offers a simple way to compose simple types into structured types.
The first of those structured types is the record, which aggregates types as fields and index them with a field name. In the example below we define an account type whick keeps the balance and number of previous transactions for a given account.

```
type account = {
  balance : tez,
  transactions : nat
}

let my_account : account = {
    balance : 10mutez,
    transactions : 5n
}
```

ℹWe will look more deeply into the _record_ construct in the following chapters.

## Your mission

1- There is an online editor in the top right corner of this page. In the editor, define *ship\_code* as a string type.

2- Then define the constant *my\_ship* as a *ship\_code* of value _"020433"_.

3- Then go ahead and validate your mission for a comparative view with the solution.

repository: octo-technology/tezos-academy

gha_language: TypeScript

repo_name: octo-technology/tezos-academy


text:
# Forms Flow.AI
`Forms Flow.AI` is an open source solution framework that is being developed by [AOT Technologies](https://www.aot-technologies.com/) that helps organizations to configure and deploy electronic forms along with related role based access, workflows and analytics in a short period of time.  This containerized devOps friendly solution can be easily deployed on-prem or on the public cloud secured with existing identity and access management systems owned by organizations. Solution uses an open source forms engine which allows staff users to self-create forms and attach to predefined or custom workflows. Solution includes capabilities to extract data for analytics, SLA tracking and lifecycle management of application submissions.

## Table of contents
* [Technologies Used](#technologies-used)
* [Running the application in Docker Environment](#running-the-application-in-docker-environment)
    * [Prerequisites](#prerequisites)
    * [Environment Variables Setup](#environment-variables-setup)
    * [Running the Application](#running-the-application)
* [Managing forms](#managing-forms)
* [Additional Configurations](#additional-configurations)
    * [SSL Nginx configurations](#ssl-nginx-configurations)

Technologies Used
------------------
- [form.io](https://www.form.io/opensource) (included under forms-flow-ai/forms-flow-forms)
- [Camunda](https://camunda.com/) (included under forms-flow-ai/forms-flow-bpm)
- [Keycloak](https://www.keycloak.org/) (existing Keycloak server required)

Running the application in Docker Environment
---------------------------------------------
The fastest way to run this library locally is to use [Docker](https://docker.com)

 [Install Docker](https://docs.docker.com/v17.12/install/), clone this github repository and follow the instructions below

   - Prerequisites
     -------------
      - Keycloak Configuration
         - [forms-flow-web](https://github.com/AOT-Technologies/forms-flow-ai/tree/master/forms-flow-web#keycloak-configuration)
         - [forms-flow-idm](https://github.com/AOT-Technologies/forms-flow-ai/tree/master/forms-flow-idm#keycloak-configuration)
      - Camunda Keystore Setup - [Refer](https://github.com/AOT-Technologies/forms-flow-ai/tree/master/forms-flow-bpm#http-https-setup)
         - Camunda should be started securely and keystore.ks configurations should be configured in the config yml: /forms-flow-bpm/src/main/resources/application.yaml

   - Environment Variables Setup
     ---------------------------
     - Set the appropriate environment variables given in the sample.env file and create a .env file in the projects root folder
      - postgres db is used for camunda server
      - mongo db is used for forms-flow-forms server
      - Keycloak configuraions has to be done prior and the secrets has to be configured in the **Environment Variables for KEYCLOAK** section
      - Roles names from Keycloak has to be configured in the **Environment Variables for forms-flow-web** section
      - Role Id's and URL from forms-flow-forms has to be configured in the **Environment Variables for forms-flow-web** section - [Refer section](https://github.com/AOT-Technologies/forms-flow-ai/tree/master/forms-flow-web#environment-configuration) for setup
      - Camunda UserId's from Keycloak URLs has to be configured in the **Environment Variables for forms-flow-bpm** section
      - Default username and password for admin has to be configured in the **Environment Variables for forms-flow-forms** section
      - Change the REACT_APP_API_PROJECT_URL and REACT_APP_API_SERVER_URL with http://localhost:3001
      - Change the REACT_APP_BPM_API_BASE with https://localhost:8000

   - Running the Application
     -----------------------
      - Open up your terminal and navigate to the root folder of this project
      - Start the application using the command
            ```docker-compose up --build
            ```
       - The following applications will be started and can be accessed in your browser.
         - http://localhost:3000 - forms-flow-web
         - http://localhost:3001 - forms-flow-forms
         - https://localhost:8000 - forms-flow-bpm

Managing forms
--------------
- Refer [forms-flow-web](https://github.com/AOT-Technologies/forms-flow-ai/tree/master/forms-flow-web#forms-flow-web)

Additional Configurations
-------------------------
- SSL Nginx configurations
  ------------------------
   - Create hostnames and secure them using the appropriate certificates
     - Generate certificates as below and place in the appropriate server paths
         - forms-flow-web hostname fullchain.pem
         - forms-flow-web hostname privkey.pem
         - forms-flow-forms hostname fullchain.pem
         - forms-flow-forms hostname privkey.pem
         - forms-flow-bpm hostname fullchain.pem
         - forms-flow-bpm hostname privkey.pem
  - Open /nginx/conf.d/app.conf
  - Update the paths accordingly in the app.conf
     - Update the localhost to the server IP address for the below URLs
         - http://localhost:3000
         - http://localhost:3001
         - https://localhost:8000
           - NOTE: 'https' for localhost:8000
  - Once applied change the hostnames in the Keycloak server for forms-flow-web and forms-flow-bpm
  - Also change values for REACT_APP_API_SERVER_URL and REACT_APP_API_PROJECT_URL with the hostname in .env file

repository: saravankumarpa/forms-flow-ai

repo_name: saravankumarpa/forms-flow-ai


text:
### [CVE-2021-43851](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-43851)
![](https://img.shields.io/static/v1?label=Product&message=timetracker&color=blue)
![](https://img.shields.io/static/v1?label=Version&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Vulnerability&message=CWE-89%3A%20Improper%20Neutralization%20of%20Special%20Elements%20used%20in%20an%20SQL%20Command%20('SQL%20Injection')&color=brighgreen)

### Description

Anuko Time Tracker is an open source, web-based time tracking application written in PHP. SQL injection vulnerability exist in multiple files in Time Tracker version <IP_ADDRESS>06 and prior due to not properly checking of the "group" and "status" parameters in POST requests. Group parameter is posted along when navigating between organizational subgroups (groups.php file). Status parameter is used in multiple files to change a status of an entity such as making a project, task, or user inactive. This issue has been patched in version <IP_ADDRESS>07. An upgrade is highly recommended. If an upgrade is not practical, introduce ttValidStatus function as in the latest version and start using it user input check blocks wherever status field is used. For groups.php fix, introduce ttValidInteger function as in the latest version and use it in the access check block in the file.

### POC

#### Reference
No PoCs from references.

#### Github
- https://github.com/ARPSyndicate/cvemon
- https://github.com/indevi0us/indevi0us

repository: trickest/cve

gha_language: HTML

repo_name: trickest/cve


text:
---
layout: project
handle: factuality
search_omit: true
---

A central function of natural language is to convey information about the properties of events. Perhaps the most fundamental of these properties is factuality: whether an event happened or not.

In this line of work, we develop a factuality annotation that incorporates a notion of confidence. This allows us to handle a wide variety of cases where the factuality of an event is unclear.

For a detailed description of the datasets and the item construction and collection methods as well as models of these data, please see the following papers:

> White, A.S., D. Reisinger, K. Sakaguchi, T. Vieira, S. Zhang, R. Rudinger, K. Rawlins, & B. Van Durme. 2016. [Universal Decompositional Semantics on Universal Dependencies](https://aclweb.org/anthology/D16-1177). Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pages 1713–1723, Austin, Texas, November 1-5, 2016.

> Rudinger, R., White, A.S., & B. Van Durme. 2018. [Neural models of factuality](http://www.aclweb.org/anthology/N18-1067). Proceedings of NAACL-HLT 2018, pages 731–744. New Orleans, Louisiana, June 1-6, 2018.

If you make use of these datasets in a presentation or publication, we ask that you please cite both of these papers.


text:
# HugeGraph Stanford Analyzer

HugeGraph Stanford Analyzer is a text analyzer that can be loaded as a plugin. This analyzer is developed by Stanford University and integrated by hugegraph organization.

## License

HugeGraph Stanford Analyzer is licensed under Apache 2.0 License.

## Usage

For detailed usage, please refer to the [custom plugin](https://hugegraph.github.io/hugegraph-doc/guides/custom-plugin.html) page of the hugegraph homepage.


text:
# __PROJECT_NAME__

## Install

```sh
npm i
```

After NPM finishes installing, you can build and run it:

```sh
create-composi-app "Project Name" "~/My Folder"
```

repository: composi/examples

repo_name: composi/examples


text:
# jQuery Footnote Links
This plugin builds a list with all the links of a page. The list is visible only in browser's print preview window. It's inspired from the [Footnote links script](http://v2.easy-designs.net/code/footnoteLinks).

## How To Use
In order to use this plugin you must insert into the page the followings:

- The jQuery script file;
- The plugin file;

You can initialize the plugin by calling footnoteLinks function on any jQuery collection.

**Example:**
``$('body').footnoteLinks();``.

**Demo:**
You can see a demo [here](http://dompuiu.github.com/jquery-footnote-links/demo/index.html).

## Config Options
The following config options can be sent when calling the plugin:

- ignoreCls: a class name that will make the link on which is found to be skipped from the list (default: '');
- listCnt: the container where the footnote list will be appended (default: '');
- listCls: the CSS class that will be appended to the footnote list (default: 'footnote-links');
- noteCls: the CSS class that will be appened to the footnotes references (default: 'footnote');
- deploy: automaticall add styles tag that will make the list visible only in print preview (default: true);

## Supported Browsers
- Internet Explorer 7, 8 and 9
- Google Chrome
- Firefox
- Opera
- Safari

## License
Licensed under the [MIT license](http://www.opensource.org/licenses/mit-license.php).


text:
# Introduction
Network Automation on Catalyst 9000 series switches using Python for features released with Cisco IOS XE 16.12.1.
These scripts are intended to leverage features introduced in this release by using YANG data models and provide solutions to real world use cases.

# Additional Resources
* [Cisco IOS XE Fuji 16.12.1 release notes](https://www.cisco.com/c/en/us/support/ios-nx-os-software/ios-xe-16/products-release-notes-list.html)
* [Cisco IOS XE Fuji 16.12.1 configuration guide](https://www.cisco.com/c/en/us/support/ios-nx-os-software/ios-xe-16/products-installation-and-configuration-guides-list.html)