text:
# CHANGELOG

## 2.0.0 - NG4
- Updated to Angular 4.0 (use version 1.0.0 for Angular 2.x)

## 1.0.0 - Live!
- Added @types/applicationinsights-js types

## rc.1

- ** BREAKING ** Refactor to implement Microsoft.ApplicationInsights.IConfig and Microsoft.ApplicationInsights.IAppInsights
- Refactor config into service and expose full config
- Add call to init to module

## rc.0

- Implemented remaining methods

## 0.3

- ** BREAKING ** Re-released to NPM package via `@markpieszak/ng-application-insights`, remove the `x` from `ngx`. (According to latest Angular naming guidelines)
  - Old npm unpublshed/removed.
- Updated to use applicationinsights-js SDK.

## 0.2

- Released to npm with `@markpieszak/ng-application-insights`


text:
# ozeki
a logger that sends json logs to sumologic and allows for adding contextual fields to those json messages.
written in typescript and includes typescript definitions.

## installation

```bash
npm install ozeki
```

## usage

To log to sumo (and still console) and include contextual fields on json log messages:
```node
var ozeki = require('ozeki');

function userId() {
  return /* current userId, probably from continuation-local-storage */;
}

function txnId() {
  return /* current transaction id, probably from continuation-local-storage */;
}

ozeki.initLogging('https://endpoint1.collection.us2.sumologic.com/receiver/v1/http/[YOUR SUMO RECEIVER CODE HERE]', 'prod', () => ({
        _u: userId(),
        _x: txnId()
    }))

console.log('testing 123');
console.warn({foo: 'bar', baz: 'blah'});
console.error(new Error('sad trombone'));

```

And you will get output like:
```
replacing console.log (+context +sumo)
{"_t":"2016-06-28T17:22:22.513Z","_l":"INFO","userId":1, "txnId":"fjoauhg3" ,"msg":"replaced console log fns"}
{"_t":"2016-06-28T17:22:32.936Z","_l":"INFO","userId":1, "txnId":"fjoauhg3" ,"msg":"testing 123"}
{"_t":"2016-06-28T17:23:31.755Z","_l":"WARN","userId":1, "txnId":"fjoauhg3" ,"foo":"bar","baz":"blah"}
{ Error: sad trombone
    at repl:1:15
    at REPLServer.defaultEval (repl.js:272:27)
    at bound (domain.js:280:14)
    at REPLServer.runBound [as eval] (domain.js:293:12)
    at REPLServer.<anonymous> (repl.js:441:10)
    at emitOne (events.js:101:20)
    at REPLServer.emit (events.js:188:7)
    at REPLServer.Interface._onLine (readline.js:224:10)
    at REPLServer.Interface._line (readline.js:566:8)
    at REPLServer.Interface._ttyWrite (readline.js:843:14) _t: '2016-06-28T17:27:02.972Z', _l: 'ERROR', x: 1 }
```

repository: StrideSpark/ozeki

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: StrideSpark/ozeki


text:
/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

WELCOME TO THE SERVICEMIX EXAMPLES
==================================

Camel Examples
==============

- camel-osgi
  Deploys a Camel EIP route as an OSGi bundle. Configuration makes use
  of the OSGi Configuration Admin service and Spring property placeholders,
  and the example demonstrates how to deploy the properties file from the
  ServiceMix console.

- camel-blueprint
  Deploys a Camel EIP route as an OSGi bundle. Configuration makes use
  of the OSGi Configuration Admin service and uses a Blueprint XML file to
  start the Camel routes.

CXF examples
============

- cxf-jaxrs
  Creates a RESTful JAX-RS web service using CXF and exposes it using
  the OSGi HTTP service.

- cxf-osgi
  Creates a web service using CXF and Spring-DM, and exposes it through
  the OSGi HTTP service.

- cxf-ws-addressing
  Uses CXF to create a web service enabled for WS-Addressing, and exposes
  it through the OSGi HTTP service.

- cxf-ws-rm
  Uses CXF to create a web service enabled for WS-ReliableMessaging, and exposes
  it through the OSGi HTTP service.

- cxf-ws-security
  Uses CXF to create a web service enabled for WS-Security, and exposes
  it through the OSGi HTTP service.  It includes a custom CallbackHandler implementation
  to show you how to implement your own authentication logic.

ActiveMQ Examples
=================

- activemq-camel-blueprint
  Deploys Camel EIP routes as an OSGi bundle using Blueprint. These routes
  make use of an ActiveMQ queue hosted on the local broker deployed in ServiceMix.

Karaf examples
==============

- branding
  Builds the artifacts that allow you to re-brand Apache Karaf
  (as e.g. we did in Apache ServiceMix).

- dump
  Demo that deploys a simple service into the OSGi Service Registry
  using a Blueprint XML file.

- web
  Embeds Apache Karaf in a web application.

Prerequisites for Running the Examples
=========================================

Java Development Kit (JDK)
--------------------------
You must have JDK 1.6 or higher installed on your machine to
run the ServiceMix examples.

Apache Maven
------------
The examples use Apache Maven for building code. You must install
Maven 2.2.1 or higher and add the Maven bin/ directory to your PATH
if you want to build any of the examples.

If you have not used Maven before, the first time you use it to
build one of the examples, it downloads a lot of JARs to a local
repository on your machine. The next time you run Maven it uses the
locally stored JARs where possible.

To download and find out more about Maven, visit:
  http://maven.apache.org

ServiceMix Container
--------------------
You must have ServiceMix up and running. To start the ServiceMix
container, run the following command:

  <servicemix_home>/bin/servicemix          (on UNIX)
  <servicemix_home>\bin\servicemix          (on Windows)

ServiceMix Features Facility
============================
Several of the examples make use of the ServiceMix features facility.
A feature is a named, versioned collection of OSGi bundles that work
together to provide some functionality. The details of what makes up
a feature are contained in a features definition file. The ServiceMix
console includes a features subshell that provides commands to enable
you to add and remove features, and to point to feature repositories.
If you add a feature, ServiceMix uses the details provided in
the features definition file to load and activate all of the
required bundles that are not already present in the container.

ServiceMix includes a number of features that make the running of
the examples quick and easy. Each feature enables you to use a single
command to install the example bundle and any bundles that the example
depends on.

To view a list of the features that are already installed, enter
the following command in the ServiceMix console:

  features:list

To view a list of the features that are used by the examples, enter
the following command in the ServiceMix console:

  features:list | grep examples

To view the repository URLs currently associated with the features
facility, enter the following command in the ServiceMix console:

  features:listUrl

To view the contents of the features definition file that includes
definitions for each of the features used by the examples, enter the
following command in the ServiceMix console:

  cat mvn:org.apache.servicemix/apache-servicemix/5.1.2/xml/features

For more information about the features facility, see the ServiceMix
documentation.


text:
---
layout: post
date: 2014-11-17 07:13:00 GMT
title: "My first Go program"
---
# My first Go program

First off: [installing Go](http://golang.org/doc/install) looks complicated, but blindly following the instructions is easy! No pets will be harmed (I hope!)

I want to convert hex to [base64](http://en.wikipedia.org/wiki/Base64). [Gobyexample.com](https://gobyexample.com/) explains how to [grab command line arguments](https://gobyexample.com/command-line-arguments). The first thing I noticed was that you can create a variable and assign it a value using `:=`

    hex := os.Args[1] // zero is the path to the program

To get the hex values from the string as bytes I tried the [`Sscan` function](http://golang.org/pkg/fmt/) and got nothing. So the second thing I learnt was that functions can return <s>tuples</s> [multiple values](https://golang.org/doc/effective_go.html#multiple-returns)

    var b string
    n, err := fmt.Sscan(hex, "%x", b) // number of items successfully scanned

I got `0`, and `type is not a pointer: string`. Googling took me to a [go cheat sheet](https://github.com/basti1302/go-lang-cheat-sheet) so I tried `&b` as an argument to `Sscan`. I've also switched from

    $ go build program.go
    $ ./program "hex string"

to just

    $ go run program.go "hex string"

Looking over [golang.org/pkg/fmt](http://golang.org/pkg/fmt/) again I realised I wanted `Sscanf`, but was typing `Sscan` (here as well!). Finally, Go conveniently [supports base64 encoding](https://gobyexample.com/base64-encoding) and that page says the encoder requires a `[]byte` so I've changed `var b string` to `var b []byte` and used

    sEnc := b64.StdEncoding.EncodeToString(b)

Of course, I've imported `"encoding/base64"` as `b64` not to save space (as the page suggests) but because pasting is more fun than typing.

Seems to work!

license: MIT

repository: arpith/blog

gha_language: CSS

gha_license_id: MIT

repo_name: arpith/blog


text:
# Changelog
Documentation of changes to this project.

## [Unreleased]

- Support for Homeassistant Users
- Fix folder permissions
- add fix version of homegear
- get addon working in the sidebar
- access only from Hass (<IP_ADDRESS>)
- adding apparmor

## [0.72.1] - 2021-03-17

### Added
- Logo to the Addon
- Portsettings are now marked as Deprecated

### Remove

* remove the aarch64 architecture becouse there is no support from homegear for this

### Fixed
- Fix faile nodeBlueCredentialKey.txt
- Fix wrong Ingress Port

### Remove Port settings

## [0.72.0] - 2021-03-10

### Added
- Add support for Raspberry Pi 4 (64bit)

### Fixed
- Fix deprecated "auto-uart"
- Fix changelog

## Version 0.71.0

- Add native sidebare integration
- Add Port-description
- Add i386 support
- Change container to Debian

## Version 0.70.4

- Fix permission issues

## Version 0.70.3

- Adding Webui link
- Changing hard coded device to auto_uart

repository: kreativmonkey/hassio-addons

gha_language: Shell

repo_name: kreativmonkey/hassio-addons


text:
# Welcome to Code & Boba

## Objective

A site to organize and document projects, notes and plans.

## Background

I started the site when I found myself looking around the interet for the same information again and again during development wastig a ton of time.

After experimenting with various methods, I concluded that the solution is a notebook that is:

- Asscesible
- Organized
- Detailed

```html
<my_day>
  <code />
  <boba />
</my_day>
```

<Disqus/>


text:
# Project Lynla

#About
Lynla is a beer scanning app which allows you to record the great beers you have tasted by scanning a barcode and taking a picture of the beer product. Instead of specifying the beer's type or ingredients with professional terms - simply rate and choose the feeling you have of its flavor and taste intuitively.

#Function
* Beer barcode and image scanning
* Personal taste recording and analyzing

#Screenshot
![](https://github.com/shhuangtwn/ProjectLynla/blob/master/Screenshots/Lynla01.png)
![](https://github.com/shhuangtwn/ProjectLynla/blob/master/Screenshots/Lynla02.png)
![](https://github.com/shhuangtwn/ProjectLynla/blob/master/Screenshots/Lynla03.png)
![](https://github.com/shhuangtwn/ProjectLynla/blob/master/Screenshots/Lynla04.png)

#Requirement
* iOS 9.3+
* Xcode 7.3+
* Cocoapods

#Library
* Firebase
  * Authentication
  * Database
  * Storage
  * Analytics
* Facebook SDK
* Google cloud vision
* SwiftyJSON
* Charts
* Haneke
* Crashlytics

#Contact
Shao-Hang Huang
<br>https://tw.linkedin.com/in/shao-hang-steven-huang-69268416
<EMAIL_ADDRESS>

repository: shhuangtwn/ProjectLynla

gha_language: Objective-C

repo_name: shhuangtwn/ProjectLynla


text:
---
layout: post
title: Classroom Audio Analysis
date: 2016-06-23
categories: uq
tags: null
image: "/assets/article_images/2016-06-23-classroom-audio-analysis/classroom_audio.jpg"
published: true
---

*When I was working at UQx one of the big buzzwords was 'active learning'. When polled, 78% of lecturers said their courses involved active learning. However, only 43% of students agreed.*

*The Institute for Teaching and Learning Innovation wanted a way to quantify the active learning occurring at UQ. This project aimed to monitor the sound in UQ classrooms and automatically determine whether they were being used for active learning or not.*

*At the time, I failed to meet this objective. I was at the end of first year and had a serious lack of signal processing skills.  A year and a half later, I return to the problem with much greater success.*

Based on the given objectives, I decided to break down the types of classroom activity into three groups:

* no activity (no one speaking)
* traditional lecture (one person speaking)
* tutorial/practical/collaborative learning (many people speaking)

Rather than trying to analyse the entire 50 minutes of audio at once, I break it down into 30 second segments. I then classify each of the segments into one of the three categories. Next I look at the relative occurrence of each category, and use this to decide on a final overall classification.This has two advantages:

1. The processing is more robust. If there are sections with odd noises or unrepresentative activity, they only effect a small part of the classification, and don't change the end result.

2. It is more applicable to real time processing. The end goal is to have an IoT network of these devices that can monitor rooms in real time. This breakdown method means the device can report preliminary results every 30 seconds.

## The Breakdown

Each recording gets broken down into the 30 second segments. After processing, the result is a timeline of classifications over the length of the recording. Below is an example timeline from a lecture.

![Segment classification over time, example from lecture.]({{site.baseurl}}/assets/images/classroom_timeline.png)

The percentage breakdown is used to determine which activity was occurring over the duration of the recording. Sometimes this is easy (if every segment has the same activity) however this never happens in practice. For example, in most practicals there is a fair amount of instruction from the instructor (which sounds like a lecture) before the class starts talking (which sounds like a prac). Or lecturers can take breaks, class can finish early, etc.

![Sample lecture segment classification breakdown.]({{site.baseurl}}/assets/images/classroom_pie.png)

The solution to this is to have a percentage threshold for each activity. While the range of recording data I have is limited (all of the recordings come from engineering classes) this breakdown generates the best overall classification so far:

* Traditional lecture:               *single speaker >60% of segments*
* Active learning:                    *many speakers >40% of segments*
* No activity:         					*no speakers >50% of segments*

Once these breakdowns are tuned with more data from across faculties, the problem then becomes classifying each segment of audio.

## Classifying Segments

This is where I had particular difficulty in 2014, and have recently had more success ([this new paper](https://arxiv.org/ftp/arxiv/papers/1602/1602.08507.pdf) in particular helped a lot - they're trying to achieve something similar, counting the number of people with audio for efficient use of HVAC). Processing was completed in MATLAB primarily using the Signal Processing Toolbox.

![Signals, man.]({{site.baseurl}}/assets/images/classroom_spectogram.jpg)

As it turns out, since we have ~100 segments per class, and fairly generous thresholds, we don't actually have to classify each segment perfectly to achieve excellent accuracy overall. In fact, even with the best algorithms there is likely to be some confusion when unusual activities occur (for example applause can throw the algorithms off). As such, breaking into more, shorter segments is advantageous.

The first step when classifying a segment is determining whether there is activity or no activity. I use a combination of the signal’s average magnitude, the autocorrelation, and the zero crossing rate, a classic voice detection approach.

If there is activity, I then look at the distribution of short term energy of the signal. Short term energy is a clear indicator of speech. See the figure below for a comparison of speech waveform and short term energy.

![Short term energy of speech signal.]({{site.baseurl}}/assets/images/ste_example.png)

When a single person is speaking, there are large spaces in the signal between words, which means a lot of the time the energy is low. This creates a fairly pointy distribution of energy over each segment. When more people are speaking, the level of speech starts to become more constant, resulting in a distribution with far lower kurtosis. The figure below shows the distribution of short term energy across three segments: a lecturer speaking, a small (<10) group of students talking, and a large (>20) class of students talking in a tute.

![Distribution of short time energy. Audio is normalised so loudest sound has energy equal to 1.]({{site.baseurl}}/assets/images/ste_distribution.png)

The paper I linked above fitted a curve to this distribution and used the resulting probability density function to estimate the number of people in the room. From my analysis to date, my opinion is that this would give a ballpark estimate, but would need fine tuning for each room it is employed in. However, by looking at the mode of the distribution it is fairly simple to find a threshold that accurately separates a single voice from a group of voices.

When all of this is combined and automated I believe it is a good solution to the problem. In order to truly test the robustness of the algorithms I need a lot more data across a wider range of scenarios. This is fairly easy to obtain, it simply requires collaboration with a team across faculties. And likely another round of ethics approval. The algorithms could then be loaded onto embedded devices that sit in classrooms and automatically classify the activity.

While the purpose of this test was limited in scope, it is not hard to see how this technology could be employed more broadly. In fact, with the proliferation of IoT, it would not be surprising if universities soon employ activity measurement devices in all rooms. At growing institutions such as UQ, efficient utilisation of teaching spaces is critical. Currently UQ sends around staff with clickers to determine whether actual use reflects the booking of spaces. With networked microphones in every classroom, universities could soon see usage in real time and automatically detect under-utilised spaces.


text:
By delaying when a Javascript file is loaded and parsed pages can be loaded and content shown, with the Javascript then following to provide extra functionality.

After loading, the parsing of Javascript is a heavy operation. Keeping the Javascript code of a web page small and only loading what's needed is a great way to reduce the performance hit browsers (and mostly mobile devices) take when hitting your page to render a basic layout.

# How do I fix this ?

Move Javascript files to the end of your `<body>` tag, just before closing it `</body>` or mark Javascript files (that are not needed immediately to show the content of the page) with the attribute `async` as such:

```
<script src="/app.js" async></script>
```

# Resources

* [Put Scripts at the Bottom](https://developer.yahoo.com/performance/rules.html)
* [High Performance Web Sites: Rule 6  Move Scripts to the Bottom](https://developer.yahoo.com/blogs/ydn/high-performance-sites-rule-6-move-scripts-bottom-7200.html)
* [Put JavaScript at bottom](https://gtmetrix.com/put-javascript-at-bottom.html)

repository: passmarked/inspect

branch_name: refs/heads/develop

gha_language: JavaScript

repo_name: passmarked/inspect


text:
# vimplugins
My vim plugins (in addition to Janus)

## How to use

```
% cd
% git --version
(make sure that you have git 1.6.5 or later)
% gcc --version
(make sure that you have a C compiler)
% rake --version
(make sure that you have rake on your system)
% git clone --recursive https://github.com/mkasa/vimplugins.git .janus
% cd .janus
% make init
% make link
```

## For RHEL 7 users
To prepare the requisites:

```
% sudo yum install -y gvim ruby gcc make git
% gem install rake
```

Note that if you install vim by `sudo yum install vim`,
the installed vim is not compatible to this set of modules
because clientserver option is not set when the package is
compiled. Use `gvim` package and do

```
alias vi=vimx
```

# Additional dependencies
There are additional dependencies when you use modules.

## When editing C source files
You need to install cscope.

## When editing Haskell source files

## WHen editing YAML files with a Kwalify schema
You need to install Kwalify.

# License
Individual submodules have different licenses.
Other materials can be distributed under MIT License.

repository: mkasa/vimplugins

repo_name: mkasa/vimplugins


text:
# Gluster module for Puppet

[![Build Status](https://travis-ci.org/voxpupuli/puppet-gluster.png?branch=master)](https://travis-ci.org/voxpupuli/puppet-gluster)
[![Code Coverage](https://coveralls.io/repos/github/voxpupuli/puppet-gluster/badge.svg?branch=master)](https://coveralls.io/github/voxpupuli/puppet-gluster)
[![Puppet Forge](https://img.shields.io/puppetforge/v/puppet/gluster.svg)](https://forge.puppetlabs.com/puppet/gluster)
[![Puppet Forge - downloads](https://img.shields.io/puppetforge/dt/puppet/gluster.svg)](https://forge.puppetlabs.com/puppet/gluster)
[![Puppet Forge - endorsement](https://img.shields.io/puppetforge/e/puppet/gluster.svg)](https://forge.puppetlabs.com/puppet/gluster)
[![Puppet Forge - scores](https://img.shields.io/puppetforge/f/puppet/gluster.svg)](https://forge.puppetlabs.com/puppet/gluster)

## Moved to Vox Pupuli
This module has been moved to the [Vox Pupuli](https://github.com/voxpupuli/) organization.  Please update all bookmarks and Puppetfile references.

## Table of Contents

1. [Overview](#overview)
2. [Custom Facts](#custom-facts)
3. [Classes](#classes)
4. [Resources](#resources)
5. [Examples](#examples)
6. [Contributing](#contributing)
7. [Copyright](#copyright)

## Overview

This module installs and configures servers to participate in a [Gluster](http://www.gluster.org/) Trusted Storage Pool, create or modify one or more Gluster volumes, and mount Gluster volumes.

Also provided with this module are a number of custom Gluster-related facts.

## Custom Facts

* `gluster_binary`: the full pathname of the Gluster CLI command
* `gluster_peer_count`: the number of peers to which this server is connected in the pool.
* `gluster_peer_list`: a comma-separated list of peer hostnames
* `gluster_volume_list`: a comma-separated list of volumes being served by this server
* `gluster_volume_#{vol}_bricks`: a comma-separated list of bricks in each volume being served by this server
* `gluster_volume_#{vol}_options`: a comma-separared list of options enabled on each volume
* `gluster_volume_#{vol}_ports`: a comma-separated list of ports used by the bricks in the specified volume.

The `gluster_binary` fact will look for an [external fact](http://docs.puppetlabs.com/guides/custom_facts.html#external-facts) named `gluster_custom_binary`. If this fact is defined, `gluster_binary` will use that value. Otherwise the path will be searched until the gluster command is found.

## Classes

### params.pp
This class establishes a number of default values used by the other classes.

You should not need to include or reference this class directly.

### repo.pp
This class enables the GlusterFS repository. Either [Gluster.org](http://download.gluster.org/pub/) for APT or [CentOS](https://wiki.centos.org/SpecialInterestGroup/Storage) managed YUM for EL.

Fedora users can get GlusterFS packages directly from Fedora's repository. Red Hat users with a Gluster Storage subscription should set the appropriate subscription/repo for their OS. Therefore for both Fedora and Red Hat Gluster Storage users, the default upstream community repo should be off:

```puppet
gluster::repo => false
```

For Debian, the latest packages of the latest release will be installed by default. Otherwise, specify a version:

```puppet
class { ::gluster::repo:
  version => '3.5.2',
}
```

For Ubuntu, the [Gluster PPA](https://launchpad.net/~gluster) repositories only contain the latest version of each release.
Therefore specify the release to install:

```puppet
class { ::gluster::repo:
  release => '10',
}
```

For systems using YUM, the latest package from the 3.8 release branch will be installed. You can specify a specific version and release:

```puppet
class { ::gluster::repo:
  release => '3.7',
}
class { ::gluster:
  version => '3.7.12',
}
```

Package priorities are supported, but not activated by default.

Yum: If a `priority` parameter is passed to this class, the `yum-plugin-priorities` package will be installed, and a priority will be set on the Gluster repository.

Apt: If a `priority` parameter is passed to this class, it will be passed as is to the Apt::Source resource. See Puppetlabs [apt](https://forge.puppetlabs.com/puppetlabs/apt) module for details.

This is [useful](http://blog.gluster.org/2014/11/installing-glusterfs-3-4-x-3-5-x-or-3-6-0-on-rhel-or-centos-6-6-2/) in the event that you want to install a version from the upstream repos that is older than that provided by your distribution's repositories.

### install.pp
This class handles the installation of the Gluster packages (both server and client).

If the upstream Gluster repo is enabled (default), this class will install packages from there. Otherwise it will attempt to use native OS packages.

Currently, RHEL 6, RHEL 7, Debian 8, Raspbian and Ubuntu provide native Gluster packages (at least client).

    class { gluster::install:
      server  => true,
      client  => true,
      repo    => true,
      version => 3.5.1-1.el6,
    }

Note that on Red Hat (and derivative) systems, the `version` parameter should match the version number used by yum for the RPM package.
Beware that Red Hat provides its own build of the GlusterFS FUSE client on RHEL but its minor version doesn't match the upstream. Therefore if you run a community GlusterFS server, you should try to match the version on your RHEL clients by running the community FUSE client.
On Debian-based systems, only the first two version places are significant ("x.y"). The latest minor version from that release will be installed unless the "priority" parameter is used.

### client.pp
This class installs **only** the Gluster client package(s). If you need to install both the server and client, please use the `install.pp` (or `init.pp`) classes.

    class { ::gluster::client:
      repo    => true,
      version => '3.5.2',
    }

Use of `gluster::client` is not supported with either `gluster::install` or `gluster::init`.

### service.pp
This class manages the `glusterd` service.

    class { ::gluster::service:
      ensure => running,
    }

### init.pp
This class implements a basic Gluster server.

In the default configuration, this class exports a `gluster::peer` defined type for itself, and then collects any other exported `gluster::peer` resources for the same pool for instantiation.

This default configuration makes it easy to implement a Gluster storage pool by simply assigning the `gluster` class to your Gluster servers: they'll each export their `gluster::peer` resources, and then instantiate the other servers' `gluster::peer` resources.

The use of exported resources assume you're using PuppetDB, or some other backing mechanism to support exported resources.

If a `volumes` parameter is passed, the defined Gluster volume(s) can be created at the same time as the storage pool. See the volume defined type below for more details.

    class { ::gluster:
      repo    => true,
      client  => false,
      pool    => 'production',
      version => '3.5',
      volumes => {
        'data1' => {
          replica => 2,
          bricks  => [ 'srv1.local:/export/brick1/brick',
                       'srv2.local:/export/brick1/brick',
                       'srv1.local:/export/brick2/brick',
                       'srv2.local:/export/brick2/brick', ],
          options => [ 'server.allow-insecure: on',
                       'nfs.disable: true', ],
                   }
                 }
    }

## Resources

### gluster::peer
This defined type creates a Gluster peering relationship.  The name of the resource should be the fully-qualified domain name of a peer to which to connect. An optional `pool` parameter permits you to configure different storage pools built from different hosts.

With the exported resource implementation in `init.pp`, the first server to be defined in the pool will find no peers, and therefore not do anything.  The second server to execute this module will collect the first server's exported resource and initiate the `gluster peer probe`, thus creating the storage pool.

Note that the server being probed does not perform any DNS resolution on the server doing the probing. This means that the probed server will report only the IP address of the probing server.  The next time the probed client runs this module, it will execute a `gluster peer probe` against the originally-probing server, thereby updating its list of peers to use the FQDN of the other server.

See [this mailing list post](http://supercolony.gluster.org/pipermail/gluster-users/2013-December/015365.html) for more information.

    gluster::peer { 'srv1.domain:
      pool => 'production',
    }

### gluster::volume
This defined type creates a Gluster volume. You can specify a stripe count, a replica count, the transport type, a list of bricks to use, and an optional set of volume options to enforce.

Note that creating brick filesystems is up to you. May I recommend the [Puppet Labs LVM module](https://forge.puppetlabs.com/puppetlabs/lvm) ?

If using [arbiter](https://gluster.readthedocs.io/en/latest/Administrator%20Guide/arbiter-volumes-and-quorum/) volumes, you must conform to the replica count that will work with them, at the time of writing this, Gluster 3.12 only supports a configuration of `replica => 3, arbiter => 1`.

When creating a new volume, this defined type will ensure that all of the servers hosting bricks in the volume are members of the storage pool. In this way, you can define the volume at the time you create servers, and once the last peer joins the pool the volume will be created.

Any volume options defined will be applied after the volume is created but before the volume is started.

In the event that the list of volume options active on a volume does not match the list of options passed to this defined type, no options will be removed by default. You must set the `$remove_options` parameter to `true` in order for this defined type to remove options.

Note that adding or removing options does not (currently) restart the volume.

    gluster::volume { 'data1':
      replica => 2,
      bricks  => [
                   'srv1.local:/export/brick1/brick',
                   'srv2.local:/export/brick1/brick',
                   'srv1.local:/export/brick2/brick',
                   'srv2.local:/export/brick2/brick',
                 ],
      options => [
                   'server.allow-insecure: on',
                   'nfs.ports-insecure: on',
                 ],
    }

### gluster::volume::option
This defined type applies [Gluster options](https://github.com/gluster/glusterfs/blob/master/doc/admin-guide/en-US/markdown/admin_managing_volumes.md#tuning-options) to a volume.

In order to ensure uniqueness across multiple volumes, the title of each `gluster::volume::option` must include the name of the volume to which it applies.  The format for these titles is `volume:option_name`:

    gluster::volume::option{ 'g0:nfs.disable':
      value => 'on',
    }

To remove an option, set the `ensure` parameter to `absent`:

    gluster::volume::option{ 'g0:server.allow-insecure':
      ensure => absent,
    }

### gluster::mount
This defined type mounts a Gluster volume.  Most of the parameters to this defined type match either the gluster FUSE options or the [Puppet mount](http://docs.puppetlabs.com/references/3.4.stable/type.html#mount) options.

    gluster::mount { '/gluster/data1':
      ensure    => present,
      volume    => 'srv1.local:/data1',
      transport => 'tcp',
      atboot    => true,
      dump      => 0,
      pass      => 0,
    }

## Examples

Please see the examples directory.

## Contributing

Pull requests are warmly welcomed!

## Copyright

Copyright 2014 [CoverMyMeds](https://www.covermymeds.com/) and released under the terms of the [MIT License](http://opensource.org/licenses/MIT).

repository: voxpupuli/puppet-gluster

gha_language: Ruby

repo_name: voxpupuli/puppet-gluster


text:
---
title: "Intelligent Dashboards"
slug: "intelligent-dashboards"
hidden: false
createdAt: "2019-09-20T23:08:03.903Z"
updatedAt: "2020-10-09T22:50:51.069Z"
---
Intelligent Dashboards measure the impact of real-time work on teams and business objectives, promoting continuous improvement in digital operations towards greater success. Digital business leaders can use flexible data visualizations to compare key metrics to industry benchmarks or teams to company averages. After making improvements in training, processes and technology investments, leaders can then monitor the performance of Teams and Services and ensure they are trending in the right direction.
[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/1cc4483-intelligent-dashboards-full-screen.png",
        "intelligent-dashboards-full-screen.png",
        1319,
        1055,
        "#ebf2f0"
      ]
    }
  ]
}
[/block]

[block:callout]
{
  "type": "info",
  "title": "Note",
  "body": "Intelligent Dashboards is a feature of [PagerDuty Analytics](https://support.pagerduty.com/docs/pagerduty-analytics) which is included on our Digital Operations plan. Please contact our [Sales Team](https://www.pagerduty.com/contact-sales/) for information on adding PagerDuty Analytics to your subscription.
</Callout>

#Product Capabilities

##Spotlight Recommendations
Spotlight uses the Digital Operations Maturity Model to surface insights and recommended actions throughout the product. Spotlight recommendations offer insight into how organizations can improve their process and use of PagerDuty for measurable business outcomes.  At present, the dashboard generates three types of recommendations to help you strategize around High Escalations, Unactionable Incidents and Repeat Incidents. Spotlight Recommendations can be found at **Analytics** :fa-arrow-right: **Intelligent Dashboards**.
[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/1532a1a-intelligent-dashboards-spotlight.png",
        "intelligent-dashboards-spotlight.png",
        2558,
        666,
        "#dae8dd"
      ]
    }
  ]
}
[/block]
###High Escalations

**Definition**: If your account had any teams (sorted by highest escalation count) that had services that were causing more than 40% of the team’s escalations (with a minimum of at least 10 escalations).

**Use Case**: Promote a culture of accountability and ownership during incident response. Ensure that the right teams are on call for the correct services and highlight potential knowledge silos.

**Sample Messages**:

[block:parameters]
{
  "data": {
    "h-1": "Condition(s) Not Met",
    "h-2": "Condition(s) Not Met",
    "0-1": "*\"None of your teams had a service that caused more than 40% of that team’s escalations. Great work!\"*",
    "0-2": "*None of your teams had a service that caused more than 40% of that team’s escalations. Great work!*",
    "0-0": "*\"98% of escalations (184) for team Hammerhead came from the service named Tiger. Make sure you are leveraging low urgency incident types and adjust the escalation policy accordingly.\"*",
    "h-0": "Condition(s) Met"
  },
  "cols": 2,
  "rows": 1
}
[/block]
###Unactionable incidents

**Definition**: If your account had any teams (sorted by highest incident count) that had more than 20% of their incidents deemed unactionable (resolved within 2 minutes).

**Use Case**: Prevent responder burnout by reducing unnecessary interruptions. Ensure that interruptions are trustworthy and meaningful, allowing teams to focus on the work and incidents that truly matter.

**Sample Messages**:
[block:parameters]
{
  "data": {
    "0-0": "*\"90% of recent incidents (totaling 564 response hours) on team Hammerhead may not have been actionable. Consider adjusting your monitoring thresholds or the associated escalation policy.\"*",
    "h-0": "Condition(s) Met",
    "h-1": "Condition(s) Not Met",
    "0-1": "*\"None of your teams had more than 20% unactionable incidents.  Great work!\"*"
  },
  "cols": 2,
  "rows": 1
}
[/block]
###Repeat Incidents

**Definition**: If your account had any teams (sorted by highest response hours) that had the same incident descriptions take up more than 30% of the team’s response hours (with a minimum of 3 incidents).

**Use Case**: Help teams focus on improving services and areas that are impacting them the most.

**Sample Messages**:
[block:parameters]
{
  "data": {
    "0-0": "*\"Recently, 37% of response hours (637) for team Hammerhead came from incidents with the description “ElasticSearch failure thr....” Resolving this issue could save 58 interruptions to oncall responders in the next few weeks.\"*",
    "h-0": "Condition(s) Met",
    "h-1": "Condition(s) Not Met",
    "0-1": "*\"None of your teams spent more than 30% of response hours on Repeated Incidents. Great work! \"*"
  },
  "cols": 2,
  "rows": 1
}
[/block]
##Team Performance Dashboard

The Team Performance Dashboard provides key insights and highlights trends that impact performance of your Teams and their Services. Managers using the Team Performance dashboard will be able to select either their industry benchmark or the company average as a reference line to compare their teams to. Data points that make up each metric, such as each individual team, can be drilled down by clicking into each heading. To access the Team Performance Dashboard, navigate to **Analytics** :fa-arrow-right: **Intelligent Dashboards** :fa-arrow-right: **Team Performance** tab.

###Parameters

Filter by:
* **team_scope**: My Teams or All Teams
* **time_range**: Last 7 days, Last 30 days or Last 90 days. **Note**: These time ranges are not currently adjustable.
* **Urgency**: High Urgency, Low Urgency or All Incidents
* **Major**:  Major Only or All Incidents

###Team Performance Metrics
[block:parameters]
{
  "data": {
    "0-0": "***Response Effort in Hours***",
    "1-0": "***Response Effort in Hours by Team***",
    "2-0": "***Incident Volume***",
    "3-0": "***Incident Volume by Team***",
    "4-0": "***Escalations***",
    "5-0": "***Escalations by Team***",
    "6-0": "***Interruption Volume***",
    "7-0": "***Interruption Volume by Team***",
    "0-1": "Total time in hours that all involved responders have spent resolving each incident from their acknowledgement to resolution.",
    "1-1": "Response Effort in Hours (defined above) broken out by team.",
    "2-1": "Total count of incidents.",
    "3-1": "Total count of incidents broken out by team. In cases where responders across multiple teams are involved, the count is not distinct  (e.g., if Roger from Team A and John from Team B are involved in responding to an incident, it will be counted for Team A and for Team B as well).",
    "4-1": "Total count of instances where an incident is escalated between responders assigned to an escalation policy.",
    "5-1": "Total count of escalations (defined above) broken out by team.",
    "6-1": "Total count of phone, SMS or push incident notifications sent to responders. Interruptions are grouped by Business Hours, Off Hours and Sleep Hours:\n\n- **Business Hours**: 8am-6pm Mon-Fri, based on the *user’s time zone*. \n- **Off Hours**: 6pm-10pm Mon-Fri and all day Sat-Sun, based on the *user’s time zone*.\n- **Sleep Hours**: 10pm-8am every day, based on the *user’s time zone*.\n\n*Time Zone Note*: If the user has not set their local time zone in their PagerDuty account, then account’s time zone is used.",
    "7-1": "Interruption volume (defined above) broken out by team.",
    "h-0": "Metric",
    "h-1": "Definition"
  },
  "cols": 2,
  "rows": 8
}
[/block]
###Team Details Metrics
For the Response Effort in Hours by Team, Incident Volume by Team, Escalations by Team and Interruption Volume by Team metrics, one can drill down into data for each team by clicking on the team’s name. Each Team Details page will have Incident Response and Incident Impact metrics.  Any filters applied to the Team Performance dashboard will carry over to the Team Details view as well.

####Incident Response
[block:parameters]
{
  "data": {
    "0-0": "***MTTA***",
    "1-0": "***MTTR***",
    "2-0": "***Escalations***",
    "3-0": "***Reassignments***",
    "4-0": "***MTTR vs. Incident Volume***",
    "0-1": "Mean Time to Acknowledge",
    "1-1": "Mean Time to Resolve",
    "2-1": "Total count of instances where an incident is escalated between responders assigned to an escalation policy.",
    "3-1": "Total count of instances where an additional responder, who was not on-call for the incident, is added.",
    "4-1": "A bar chart of Incident Count with the Mean Time to Resolve in minutes transposed for comparison.",
    "h-0": "Metric",
    "h-1": "Definition"
  },
  "cols": 2,
  "rows": 5
}
[/block]
####Incident Impact
[block:parameters]
{
  "data": {
    "0-0": "***Interruption Volume***",
    "0-1": "Month-over-month trend report in volume of phone, SMS or push incident notifications sent to responders. Interruptions are grouped by Business Hours, Off Hours and Sleep Hours:\n\n- **Business Hours**: 8am-6pm Mon-Fri, based on the *user’s time zone*. \n- **Off Hours**: 6pm-10pm Mon-Fri and all day Sat-Sun, based on the *user’s time zone*.\n- **Sleep Hours**: 10pm-8am every day, based on the *user’s time zone*.\n\n*Time Zone Note*: If the user has not set their local time zone in their PagerDuty account, then account’s time zone is used.",
    "1-0": "***Response Hours Cost***",
    "1-1": "Month-over-month bar chart with the amount of response hours. Hover over each bar to see the cost of response hours.",
    "2-0": "***Incidents List***",
    "2-1": "A list of all incidents and their details for the time range parameter specified.",
    "h-0": "Metric",
    "h-1": "Definition",
    "3-0": "***MTTE***",
    "3-1": "Mean Time to Engage: A measurement of people response time, similar to MTTA, but used only for 2nd, 3rd, and nth responders.\n\nIt measures the time from the first user engagement (acknowledgement or responder request acceptance) to the last user engagement. This metric is null for incidents with a single engaged user.",
    "4-0": "***MTTM***",
    "4-1": "Mean Time to Mobilize: A measurement of the time from incident creation to the last user engagement (acknowledgement or responder request acceptance). This metric is null for incidents with a single engaged user."
  },
  "cols": 2,
  "rows": 5
}
[/block]
## Service Health Dashboard
The Service Health dashboard allows for the discovery of services that drive incidents and cause increased team response effort. Detailed performance views for each service are provided to show impact of interruptions, how teams respond to incidents, and performance details by incidents and team metrics. This feature allows service owners to make key decisions on where to allocate resources, make investments and drive continual service health improvement. To access the Service Health Dashboard, navigate to **Analytics** :fa-arrow-right: **Intelligent Dashboards** :fa-arrow-right: **Service Health** tab.

###Parameters
Filter by:
* **Team**: My Teams or All Teams
* **Major**:  Major Only or All Incidents
* **time_range**: Last 7 days, Last 30 days or Last 90 days. **Note**: These time ranges are not currently adjustable.
* **Urgency**: High Urgency, Low Urgency or All Incidents

###Service Health Metrics

[block:parameters]
{
  "data": {
    "0-0": "***Response Effort in Hours***",
    "0-1": "Total time in hours that all involved responders have spent resolving each incident from their acknowledgement to resolution.",
    "1-0": "***Response Effort in Hours by Service***",
    "1-1": "Response Effort in Hours (defined above) broken out by service.",
    "2-0": "***Incident Volume***",
    "2-1": "Total count of incidents.",
    "3-0": "***Incident Volume by Service***",
    "3-1": "Total count of incidents broken out by service.",
    "4-0": "***Escalations***",
    "4-1": "Total count of instances where an incident is escalated between responders assigned to an escalation policy.",
    "5-0": "***Escalations by Service***",
    "5-1": "Total count of escalations (defined above) broken out by service.",
    "6-0": "***Interruption Volume***",
    "6-1": "Total count of phone, SMS or push incident notifications sent to responders. Interruptions are grouped by Business Hours, Off Hours and Sleep Hours:\n\n- **Business Hours**: 8am-6pm Mon-Fri, based on the *user’s time zone*. \n- **Off Hours**: 6pm-10pm Mon-Fri and all day Sat-Sun, based on the *user’s time zone*.\n- **Sleep Hours**: 10pm-8am every day, based on the *user’s time zone*.\n\n*Time Zone Note*: If the user has not set their local time zone in their PagerDuty account, then account’s time zone is used.",
    "7-0": "***Interruption Volume by Service***",
    "7-1": "Interruption volume (defined above) broken out by service.",
    "h-0": "Metric",
    "h-1": "Definition"
  },
  "cols": 2,
  "rows": 8
}
[/block]
###Service Details Metrics
For the Response Effort in Hours by Service, Incident Volume by Service, Escalations by Service and Interruption Volume by Service metrics, one can drill down into data for each service by clicking on the service’s name. Each Service Details page will have Incident Response and Incident Impact metrics. Any filters applied to the Service Health dashboard will carry over to the Service Details view as well.

####Incident Response

See [definitions above](https://support.pagerduty.com/docs/intelligent-dashboards#section--incident-response-).

####Incident Impact

See [definitions above](https://support.pagerduty.com/docs/intelligent-dashboards#section--incident-impact-).

#### Incidents List
A list of all incidents and their details for the time range parameter specified.

#### Teams List
List of this service’s incidents specific to each team that included a responder. Service owners can see if their services have impacted other teams in the last week or month. If the number of the incidents impacting an external team increases over time, this may indicate a service ownership issue.

## Edit or Download Data

At the upper right of each data module you will see the :fa-bars: **More Actions** menu. Here you may **Download Image** on graphs, and on lists you may **Edit Pivot**, **Search** and **Download Data**.

#FAQ
##How far back can I look at my data?
At moment 90 days, but longer time frames and custom date ranges are on the road map.

repository: tpgaviria/pd-kb

branch_name: refs/heads/main

repo_name: tpgaviria/pd-kb


text:
# Superoperator representations

## `vec` and `unvec`

$$ A = [a_{ij}] = \begin{pmatrix}
a_{11} & a_{12} & \ldots & a_{1m} \\\\
a_{21} & a_{22} & \ldots & a_{2m}\\\\
\vdots &   & \ddots & \vdots\\\\
a_{m1} & a_{m2} & \ldots & a_{mm}
\end{pmatrix}$$
where $i$ is a row and $j$ is a column index.

We define `vec` to be column stacking

$ {\rm vec}(A) = (a_{11},a_{21},\ldots,a_{m1},a_{12},\ldots,a_{mm})^T$

were $T$ denotes a transpose. Clearly an inverse operation, `unvec` can be defined so that

$ {\rm unvec}\big ( {\rm vec}(A) \big ) = A$.

Similarly we can define a row vectorization to be row stacking

$|A\rangle \rangle := {\rm vec_r}(A) = (a_{11}, a_{12}, \ldots, a_{1m}, a_{21},\ldots, a_{mm})^T.$

Note that ${\rm vec}(A) = {\rm vec_r}(A^T)$. In any case we will **not** use this row convention.

For matricies $A,B,C$ some useful results related to vectorization are

${\rm vec}(ABC) = (C^T\otimes A) {\rm vec}(B)\quad$ [Eq.1]

$ {\rm vec}([A,X])= (I\otimes A - A^T\otimes I) {\rm vec}(X)$

${\rm vec}(ABC) = (I\otimes AB) {\rm vec}( C ) = (C^T B^T\otimes I) {\rm vec}(A)$

${\rm vec}(AB) = (I\otimes A) {\rm vec}(B) = (B^T\otimes I) {\rm vec}(A)$

## Kraus to Superoperator

Consider the set of Kraus operators $\{ M_k \}$. The corresponding quantum operation is $\mathcal E (\rho) = \sum_k M_k \rho M_k^\dagger $.

Using the vec operato (see Eq. 1) this implies a superoperator

$\mathcal E = \sum_k (M_k^\dagger)^T \otimes M_k = \sum_k M_k^* \otimes M_k$

## Kraus to Choi

Define $ | \eta \rangle = \frac{1}{\sqrt{d}}\sum_{i=0}^{d-1}|i,i \rangle $

One can show that

$|A\rangle \rangle = {\rm vec}(A) = \sqrt{d} (I\otimes A) |\eta\rangle$

The Choi state is

$\begin{align}
\mathcal C &= I\otimes \mathcal E |\eta \rangle \langle \eta| \\\\
&=\sum_i (I \otimes M_i) |\eta \rangle \langle \eta  | ( I \otimes M_i^\dagger)\\\\
& = \frac{1}{d} \sum_i {\rm vec}(M_i)  {\rm vec} (M_i) ^\dagger \\\\
& = \frac{1}{d} \sum_i |M_i\rangle \rangle \langle\langle M_i |
\end{align}$

repository: msohaibalam/forest-benchmarking

path: /docs/Superoperator representations.md

filename: Superoperator representations.md

repo_name: msohaibalam/forest-benchmarking


text:
---
layout: post
title: "Nothin But .Net - San Diego,CA (July 26-30, 2010)"
comments: true
date: 2010-04-23 09:00
categories:
- training
---

[Nothin But .Net](http://www.developwithpassion.com/training.oo) is finally making its way around to the west coast of the USA!!
The course is going to be held in the beautiful city of San Diego. Hopefully the relaxed backdrop will give us the energy we need to complete 5 days of heads down coding in an environment that is guaranteed to get you thinking actively about how and why you do what you do!
You will get introduced to techniques and approaches that can allow you to build applications in a very rapid fashion. Your attitudes towards how you handle messy code bases will also be challenged as you are encouraged to think about the opportunities for growth that can arise from dealing and taming such code bases.
The list of reviews for this course is far too many to list. Over the years this course has hosted people from all across the globe involved in an array of different domains.
If you want to take part in an environment that encourages as well as challenges you to your core, step up and take part in what could be a week that "re-energizes" you.
For more information about the course, or to register, go here: [http://nbdn2010julysandiego.eventbrite.com/](http://nbdn2010julysandiego.eventbrite.com/)
[Develop With Passion](http://www.developwithpassion.com)!!

extension: markdown


text:
# Amfphp
## What is Amfphp?

Amfphp is free and open source software, and an essential brick for the development of Web Applications. Amfphp is used in projects that cover a wide spectrum, from games to business applications. The role of Amfphp is to make connecting an application running in the browser with a server in the cloud as simple as possible.

Applications no longer run only on desktops, but must also be available on a variety of smartphones and tablets. It is becoming increasingly complex to code with the diversity of technologies used in these terminals. Amfphp is the best solution for creating accessible services to all terminals. Developers can focus on features unique to their projects, regardless of the communication between client and server.

Amfphp includes productivity tools in the "Back Office", a companion Web application, that contains a Service Browser, useful for testing, a Client Generator to give you functional client code, and a Profiler to measure performance.

## How does it work?

Amfphp works as an entry point for your client. Your client sends a request to a PHP script on your server where Amfphp is loaded. It parses the request, loads the requested service, calls it, and returns the answer accordingly.

Amfphp is maintained by Silex Labs.

Amfphp, Simple Remoting for Web Applications

[Feedback](http://www.silexlabs.org/amfphp/feedback/)

[main Amfphp website](http://silexlabs.org/amfphp/)

[Documentation](http://silexlabs.org/amfphp/documentation/)

[Forums](http://www.silexlabs.org/groups/amfphp/amfphp-users/)

[Source Code](https://github.com/silexlabs/amfphp-2.0)

[Class Reference](http://community.silexlabs.org/amfphp/reference/)

[Silex Labs](http://www.silexlabs.org/)

## Package Contents
The Amfphp library itself [Amfphp](./Amfphp)

[The Back Office](./BackOffice)

The Examples [Examples](./Examples)

[The class reference](./doc/)

[Some free Amfphp images](./goodies/)

[The license](./license.txt)

[The change log ](./changelog.txt)

The composer file(see [getcomposer.org](http://getcomposer.org)) [Composer](./composer.json)

gha_license_id: NOASSERTION


text:
---
title: Start
nav_order: 5
---

You can start a CodeBuild project with the `cody start` command. Here's an example:

    $ cody start demo
    Build started for project: demo
    Here's the CodeBuild Console Log url:
    https://us-west-2.console.aws.amazon.com/codesuite/codebuild/projects/demo/build/demo%3A7bc4cb33-d918-467a-9e09-fe7fe1f57ed8/log
    Showing logs for build demo:10b8c4dc-e328-4759-9e32-805bcee8d1f9
    Phase: SUBMITTED Status: SUCCEEDED Duration: 0
    Phase: QUEUED Status:  Duration:
    Phase: QUEUED Status: SUCCEEDED Duration: 1
    ...
    Phase: FINALIZING Status: SUCCEEDED Duration: 2
    Phase: COMPLETED Status:  Duration:
    2019-11-28 05:29:23 UTC 9: post_build
    2019-11-28 05:29:23 UTC Thu Nov 28 05:29:21 UTC 2019
    2019-11-28 05:29:25 UTC
    2019-11-28 05:29:25 UTC [Container] 2019/11/28 05:29:23 Phase complete: POST_BUILD State: SUCCEEDED
    2019-11-28 05:29:25 UTC [Container] 2019/11/28 05:29:23 Phase context status code:  Message:
    $

If the project name is the same as the parent folder name then you can do this:

    cd demo
    cody start # demo is inferred from the parent folder

## Specifying Code Branch

If you would like start a build using a specific code branch you can use the `--branch` or `-b` option.  Example:

    cody start demo -b feature-branch

## AWS CLI Equivalent

The `cody start` command is a simple wrapper to the AWS API with the ruby sdk. You can also start codebuild projects with the `aws codebuild` cli.  Here's the equivalent CLI command:

    aws codebuild start-build --project-name demo --source-version master

## Types

If you are using multiple Cody projects with [Types]({% link _docs/type-option.md %}), you can start the specific CodeBuild project type with the `--type` option.  Example:

    cody start demo --type unit

## Override CodeBuild Environment Variables

You can override CodeBuild env variables at runtime with `--env-vars`. Examples:

    cody start demo --type vpc --env-vars K1=v1 K2=v2
    cody start demo --type vpc --env-vars K1=v1 K2=ssm:v2 # support for PARAMETER_STORE

Remember the environment variables are within the CodeBuild environment instance running the build script, not the application's environment.

## CLI Reference

Also, for help info you can check the [cody start]({% link _reference/cody-start.md %}) CLI reference.

{% include prev_next.md %}

repository: prashcr/cody

repo_name: prashcr/cody


text:
---
layout: default
title: Research interests
---

# Teaching

## *Workshops*
<img align="right" width="180" height="65" class="classic_img"<EMAIL_ADDRESS>### [Git And Github Workshop](https://vlucet.github.io/git-and-github-with-r-workshop/)
**Level:** beginner
**Length:** 1 hour (preparation) + 3 hours (material)

A small workshop geared toward R users, made by collating different open source material and aimed at teaching the basics of the the `git` command line as well as the how to use GitHub and GitHub clients like GitHub Desktop. Includes a section on how to use git with RStudio.

### Grass GIS in R with `rgrass7`

*In development*


text:
# interactive-covid-19-dashboard
- Description
- Dev Process
- All version
- How to install
- License

## Description
A project hope to help people understand the tracks of the covid-19 epidemic.
The number of cases and deaths per country and date are provided as open-data by the [Johns Hopkins University](https://github.com/CSSEGISandData/COVID-19).
Dashboard and Visualisation was created by the three students of [CRI-AIRE Master](https://master.cri-paris.org/en).

## Dev Process
- COVID DATA extracted from open source - 21/05/2021
- Creating streamlit Interface

## All version
-

## How to install

## License

MIT Licence
Copyright (c) 2021 yemre-data


text:
# statreceiver

This package implements a Lua-scriptable pipeline processor for
[zeebo/admission](https://github.com/zeebo/admission) telemetry packets (like
[monkit](https://github.com/spacemonkeygo/monkit/) or something).

There are a number of types of objects involved in making this work:

 * *Sources* - A source is a source of packets. Each packet is a byte slice that,
   when parsed, consists of application and instance identification information
   (such as the application name and perhaps the MAC address or some other id
   of the computer running the application), and a list of named floating point
   values. There are currently two types of sources, a UDP source and a file
   source. A UDP source appends the current time as the timestamp to all
   packets, whereas a file source should have a prior timestamp to attach to
   each packet.
 * *Packet Destinations* - A packet destination is something that can handle
   a packet with a timestamp. This is either a packet parser, a UDP packet
   destination for forwarding to another process, or a file destination that
   will serialize all packets and timestamps for later replay.
 * *Metric Destinations* - Once a packet has been parsed, the contained metrics
   can get sent to a metric destination, such as a time series database, a
   relational database, stdout, a metric filterer, etc.

Please see example.lua for a good example of using this pipeline.

## Setup

If you use a relational database metric destination, make sure to instantiate
the schema provided in schema.sql first.

repository: storj/statreceiver

gha_language: Go

repo_name: storj/statreceiver


text:
# Description

Small script to generate all app icon sizes for iOS app icons based on a source 1024x1024.

This script is an old version of png2asset, and it's just being published for completion sake. It doesn't generate all sizes and doesn't support icons for different orientation languages.

# Requirements

You need to have `ImageMagic` for this script to work. You can install it with [Homebrew](https://brew.sh).

```
brew cask install imagemagick
```

# Usage

Save the script somewhere safe, `chmod +x` it, and add it as an alias on your `.bash_profile` file (`vim .bash_profile`), add at the end:

`alias air="/Users/andyibanez/Dropbox/Documents/Scripts/AppIconResize/script.sh"`

And reload your `.bash_profile`:

`source ~/.bash_profile`

In order to use this script, the source PNG file **should** be 1024x1024 or bigger. Giving it a smaller image will cause obvious distortions to the image.

To use it, call this function:

`air ORIGINAL_FILE OUTPUT_DIRECTORY`

Where the parameters:

**ORIGINAL_FILE**: File to the original PNG you want to resize. For example, `/Users/Eve/Desktop/App.png`. It also accepts relative paths with `~` and `.`.
**OUTPUT_DIRECTORY**: Directory where all the icons will be output to. The directory should already exist. For example, `/Users/Eve/Desktop`, but you can pass it relative directories with `~` and `.` as well.

#### Full Example

`air appicon.png .`

# Sources
* [How to resize a PNG file from the command line?](https://unix.stackexchange.com/questions/139335/how-to-resize-a-png-file-from-the-command-line)


text:
## v1.0.4 (2020-07-18)

- Upgrade dependencies to mitigate security vulnerabilities

## v1.0.3 (2019-12-22)

- Upgrade dependencies to mitigate security vulnerabilities

## v1.0.2 (2019-07-21)

- Upgrade dependencies to mitigate security vulnerabilities (such as [lodash prototype pollution](https://snyk.io/vuln/SNYK-JS-LODASH-450202))

## v1.0.1 (2019-04-02)

- Add `CHANGELOG.md` (also include it into the build)
- Add missing config docs
- Parse unescaped `\n` and `\r` in `EVENT_LINE_FORMAT` as newline symbols
- Use 24 instead of 12 hour format by default

## v1.0.0 (2019-03-31)

Initial release

repository: RakhithJK/aws-iot-button-logger-to-git

repo_name: RakhithJK/aws-iot-button-logger-to-git


text:
---
title: I Loved Mister Rogers
date: 2019-12-6
layout: post
excerpt: "I think what he did is simple, but not easy. Try it right now. Imagine a camera, and a crew, and a million dollars pointed at your face. How do you respond without reference to Self?"
tags: [spirituality]
categories: metaphysics
---

{% image /images/rogers-hero.jpg %}
*This picture is how I knew him. 1970s video where the colors bled.
Where the antenna had to be adjusted.*

I was a kid in the Mister Rogers era. I didn't know how lucky I was!
He was a technology enthusiast. He used television to create relationship
with the unseen child. It seems clear that when he looked at the
probably bulky, gray video camera, he somehow saw a real child there.

From "[Mister Rogers and the Art of Paying Attention](https://www.theatlantic.com/family/archive/2019/12/mister-rogers-attention/603106/),"
(outline.com link [here](https://outline.com/aZXJTa)) I read:

> I showed him how to sew a tail on a stuffed rabbit I was making for my son’s
> fifth birthday, and how to make a toy called a button spinner. “I like the
> things you make,” he said. I felt a warm glow from his attention.
>
> His comments weren’t just for me. Someone else was with us as we talked: a
> child on the other side of the screen. On camera, I was careful to speak in a
> way that I thought a young child would understand. But it was only when I
> watched the episode (and when I watch it still) that I could appreciate how
> deftly and naturally Mister Rogers included that child in our conversation.
> Every so often, he looked into the camera and gave a slight, knowing smile, as
> if to say, “Did you see that? What do you think of that?” The child watching
> must have known the smile was for him or her and felt noticed, just as I did.

It occurs to me that he must have invoked a kind of magic ritual.
Normally, if I look at a camera...an emissary from the world of high-tech,
full of "sparkling possibilities" (the attempt to imagine those possibilities
has a strange way of ending with visions of self-adulation, sigh), my
attention returns to my Own Self, and what I Must Do to respond to this
confrontation with the Modern and the Hip.

Mister Rogers avoided this whole trap. I think what he did is simple, but
not easy. Try it right now. Imagine a camera, and a crew, and a million
dollars pointed at your face. How do you respond without reference to
Self?

It's someone who, yes, wants to connect people. But there is a harshness,
an abstraction, in the way this figure speaks about it.
I realize they aren't talking about *any one person*. They have "moved on"
from a personal relationship to the imagined connection of many millions.
This then invokes money and power. All for the common good, of course!

Imagined connections are dry, useless paper. For a real connection,
there must be someone vulnerable and specific in the mind. Someone
admirable, someone unintentionally funny. Someone who goes reliably
wrong for a few weeks before they find the path that, mysteriously,
works for them only because it first lifts up other people.
Someone who will reach far further than you ever did.

It seems he saw the highest potential in everyone who came before him,
and spoke and engaged with that part. From the article:

> Not long after, I saw Fred Rogers again at the baptism of a friend’s child,
> and told him that I was pregnant with my third. His response was not
> “Congratulations!” or “When is the due date?”—two perfectly kind things to
> say to someone who’s expecting—but rather, “That child will be very lucky to
> have you two as parents.” It wasn’t what one would normally hear, and there
> was an earnestness in his attention that I found disarming. But as the mother
> of young children, it felt good to be reassured that what I was doing
> mattered.

By saying "That child will be very lucky to have you two as parents"
Fred Rogers moved beyond simply noting the event of the moment and
spoke to a deeper channel. To the fears and hopes of those parents.
Their unspoken questions in the night are:

"Will we be good enough?"

Or, "Will we mess him up?"

Fred Rogers' attention offered what they most needed.

I like this very much. The steady, almost sonorous (a word that invokes sound
seems right to me) gaze of
loving attention that he had is what I'll aspire too. I'll certainly fail on
lesser mountains, but gosh, it is beautiful.

repository: ripsawridge/site

repo_name: ripsawridge/site


text:
# SciKit-GStat publication companion code

[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.5970217.svg)](https://doi.org/10.5281/zenodo.5970217)

This is the companion code for Mälicke (2021).

The version Revision 1 (0.2.0) contains all adaptions made to the plots due to the open discussion.

It contains all figures in the publication (./figures/), the code to produce the figures (*.ipynb files), and the used data (./data/).
Please note that some of the data is derived from other sources and is therefore not licensed by the distributed MIT license. The respective license and attribution statement is distributed along with the data. If you use any data sample from this repository make sure to cite the original author accordingly, as well.

** References **

Mälicke, M.: SciKit-GStat 1.0: A SciPy flavoured geostatistical variogram estimation toolbox written in Python, Geosci. Model Dev. Discuss.
[preprint], https://doi.org/10.5194/gmd-2021-174, in review, 2021.


text:
#ML Ops Engineer

## Show us what you can do ##

_If any part of this exercise is unclear, please don't hesitate to ask us questions. If you feel it is taking more time to accomplish than you have to commit, please let us know that as well. Our goal is not to waste anyone's time, but to have a simple set of exercises you can use to demonstrate your skills. These are basic functions that you should feel confident in demonstrating and performing on a daily basis._

### Infrastructure as Code ###

Much of our work is managing the infrastructure on which we manage our systems.  One of our mottos is *Infrastructure as Code*, and to this end, we heavily use AWS CloudFormation, Terraform, CDK and CLI to manage our systems _including ML Ops_.

We prefer CloudFormation for this submission, However if you cannot write this in CloudFormation, you have other options...

1. Implement using TerraForm
2. Write a bash script using AWS CLI
3. Write a python module that uses CDK or BOTO3
4. Record yourself performing these functions via the AWS Console.

Please create a CloudFormation document that can be applied to AWS and configures the following services:
1) Instantiate SageMaker Domain
2) Create a SageMaker Notebook instance
3) Instantiate a basic SageMaker Pipeline, your pipeline should do the following:
   - train a model
   - deploy the model to the registry
   - deploy your model

### Finally ###

Document your submission!   Talk about stumbling blocks, clarify your decisions for us, show us what you do so that the next engineer who might look at your code in the future and need to maintain it, will be able to carry the baton.

We look forward to your submisson and discussing it with you!

repository: Inspire-com/candidate-homework

gha_language: Swift

repo_name: Inspire-com/candidate-homework


text:
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

### [1.4.0]
- Check & Request camera permission at runtime

### [1.3.1]
- Fix support for sdk level lower than 19
- Upgrade built tools to v27
- Upgrade `compile` with `implementation`

### [1.3.0]
- Add support for multiple files selection
- Add `audio/*` to default accepted file types
- Use v27 for support libraries

### [1.2.0]
- Add support for targetSdkVersion 26

### [1.1.0]
- Changed prop name to get the webview ref, from `getRef` to `webviewRef`

### [1.0.0]
- Add example project

### [0.2.0]
- Read `accept` attribute from input field

### 0.1.0
- Add support for video recording

[1.4.0]: https://github.com/andreipfeiffer/react-native-webview-android-file-upload/compare/1.3.1...1.4.0
[1.3.1]: https://github.com/andreipfeiffer/react-native-webview-android-file-upload/compare/1.3.0...1.3.1
[1.3.0]: https://github.com/andreipfeiffer/react-native-webview-android-file-upload/compare/1.2.0...1.3.0
[1.2.0]: https://github.com/andreipfeiffer/react-native-webview-android-file-upload/compare/1.1.0...1.2.0
[1.1.0]: https://github.com/andreipfeiffer/react-native-webview-android-file-upload/compare/1.0.0...1.1.0
[1.0.0]: https://github.com/andreipfeiffer/react-native-webview-android-file-upload/compare/0.2.0...1.0.0
[0.2.0]: https://github.com/andreipfeiffer/react-native-webview-android-file-upload/compare/0.1.0...0.2.0

gha_language: Java


text:
Vendor: LanScope
================
Product: LanScope
-----------------

### Use Cases

_The following Use Cases can be operationalized using log data from this data source_

* [Account Creation and Management](../UseCases/usecase_account_creation_and_management.md)
* [Activity Time  and Type](../UseCases/usecase_activity_time__and_type.md)
* [Application Activity](../UseCases/usecase_application_activity.md)
* [Asset Logon and Access](../UseCases/usecase_asset_logon_and_access.md)
* [Critical System Activity](../UseCases/usecase_critical_system_activity.md)
* [Data Loss Prevention](../UseCases/usecase_data_loss_prevention.md)
* [Email Activity](../UseCases/usecase_email_activity.md)
* [Endpoint Activity](../UseCases/usecase_endpoint_activity.md)
* [Executives](../UseCases/usecase_executives.md)
* [File Activity](../UseCases/usecase_file_activity.md)
* [Network](../UseCases/usecase_network.md)
* [Network zones and Location Access](../UseCases/usecase_network_zones_and_location_access.md)
* [Security Alert](../UseCases/usecase_security_alert.md)
* [Service Account Activity](../UseCases/usecase_service_account_activity.md)
* [Web Activity](../UseCases/usecase_web_activity.md)

### Event Types

_The following list of Event Types can be generated by Data Source LanScope_LanScope, and power the use cases above:_

- app-activity
- file-delete
- file-write
- print-activity
- process-created
- process-created-failed
- process-network
- web-activity-allowed

### Parsers

_The following Parsers can be operationalized using log data from this data source_

* [s-lanscope-app-activity-1](../Parsers/parserContent_s-lanscope-app-activity-1.md)
* [s-lanscope-asset-alert](../Parsers/parserContent_s-lanscope-asset-alert.md)
* [s-lanscope-file-operations](../Parsers/parserContent_s-lanscope-file-operations.md)
* [s-lanscope-print-activity](../Parsers/parserContent_s-lanscope-print-activity.md)
* [s-lanscope-process-created](../Parsers/parserContent_s-lanscope-process-created.md)
* [s-lanscope-process-created-failed](../Parsers/parserContent_s-lanscope-process-created-failed.md)
* [s-lanscope-web-activity](../Parsers/parserContent_s-lanscope-web-activity.md)


text:
# EC2 Instance - InSpec Profile

## Description

A library InSpec compliance profile containing a custom `ec2_instance` resource that can be used to test `meta-data` and `user-data` for AWS EC2 nodes. It does not require AWS API credentials since the resource is retrieving the data on the target ec2 nodes using the `http://<IP_ADDRESS>/` metadata API.

InSpec is an open-source run-time framework and rule language used to specify compliance, security, and policy requirements for testing any node in your infrastructure.

The controls you find in the `./controls` directory are sample ones to demonstrate how to use the `ec2_instance` resource.

### Requirements

* [InSpec](https://github.com/chef/inspec)

### Platforms

- Linux
- Windows

## Usage

- Add this to your profile's `inspec.yml` to ensure a correct InSpec version and define the profile dependency:

```yaml
supports:
  - inspec: '~> 1.0'
depends:
  - name: ec2-instance-profile
    git: https://github.com/alexpop/ec2-instance-profile
    version: '~> 0.1'
```

### Examples

- Use the `ec2_instance` resource in your profiles, the same way you'd use core InSpec resources like file, service, command, etc.

```ruby
control 'ec2-instance-1.1' do
  impact 1.0
  title 'Ensure no sensitive information is passed via the user-data'
  describe ec2_instance do
    it { should exist }
    its('user-data') { should_not match /password|secret.?access/i }
  end
end

control 'ec2-instance-1.2' do
  impact 0.6
  title 'Test the IP addresses by specifying meta-data API version'
  describe ec2_instance(version: '2016-06-30') do
    it { should exist }
    its('meta-data/public-ipv4') { should eq '' }
    its('meta-data/local-ipv4') { should match /^172\.31\..+/ }
  end
end
```

### `ec2_instance` resource parameters:

Name | Required | Type | Description
--- | --- | --- | ---
version | no | String | Defaults to 'latest' if not specified. Call this on your EC2 instance to find out all available versions: `http://<IP_ADDRESS>/`
timeout | no | Numeric | Number of seconds to wait for the HTTP connection to open. The default value is 2 seconds.
curl_path | no | String | Defaults to `curl` in `$PATH` if not specified.
wget_path | no | String | Defaults to `wget` in `$PATH` if not specified.

An HTTP client is required on the target node in order for the resource to work. `curl`, `wget` and `Invoke-WebRequest`(Windows) are currently supported.

Example of instantiating the resource with a Hash of the above parameters:

```ruby
describe ec2_instance(version: '2016-06-30', timeout: 3, curl_path: '/usr/bin/curl') do
  it { should exist }
end
```

### `ec2_instance` resource tests:

```ruby
describe ec2_instance do
  # Returns true if the node is indeed an EC2 instance
  it { should exist }
  # Test the value returned by 'http://<IP_ADDRESS>/latest/SOMETHING', see examples below:
  its('SOMETHING') { should match /hello-world/i }
  # Test 'http://<IP_ADDRESS>/latest/meta-data/local-ipv4' if we write:
  its('meta-data/public-ipv4') { should eq '' }
  # Test 'http://<IP_ADDRESS>/latest/meta-data/instance-id' if we write:
  its('meta-data/instance-id') { should match /^.{19}+$/ }
end
```

## License and Author

* Author: [Alex Pop](https://github.com/alexpop)

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

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

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


text:
# Kube-apiserver audit logs {#concept_svk_cgf_2fb .concept}

In a Kubernetes cluster, apiserver audit logs are important for cluster Operation & Maintenance \(O&M\) because they record daily operations of different users. This topic describes the apiserver audit log configurations of an Alibaba Cloud Kubernetes cluster, and how to collect and analyze audit logs through Log Service, and how to customize audit log alarm rules.

## Configurations of apiserver audit logs {#section_edv_5gf_2fb .section}

Currently, the apiserver audit function is enabled by default when you create a Kubernetes cluster. Relevant parameters and description are as follows:

**Note:** Log on to the Master node, and the directory of the apiserver configuration files is /etc/kubernetes/manifests/kube-apiserver.yaml.

|Configuration|Description|
|-------------|-----------|
|audit-log-maxbackup|The maximum fragment of audit logs stores 10 log files.|
|audit-log-maxsize|The maximum size of a single audit log is 100 MB.|
|audit-log-path|The audit log output path is /var/log/kubernetes/kubernetes.audit.|
|audit-log-maxage|The longest storage period of audit logs is seven days.|
|audit-policy-file|Configuration policy file of audit logs. The directory is /etc/kubernetes/audit-policy.yml.|

Log on to the Master node machine. The directory of the audit log configuration policy file is /etc/kubernetes/audit-policy.yml. The content of the file is as follows:

```
apiVersion: audit.k8s.io/v1beta1 # This is required.
kind: Policy
# We recommend that you do not generate audit events for all requests in RequestReceived stage.
omitStages:
  - "RequestReceived"
rules:
  # The following requests are manually identified as high-volume and low-risk.
  # Therefore, we recommend that you drop them.
  - level: None
    users: ["system:kube-proxy"]
    verbs: ["watch"]
    resources:
      - group: "" # core
        resources: ["endpoints", "services"]
  - level: None
    users: ["system:unsecured"]
    namespaces: ["kube-system"]
    verbs: ["get"]
    resources:
      - group: "" # core
        resources: ["configmaps"]
  - level: None
    users: ["kubelet"] # legacy kubelet identity
    verbs: ["get"]
    resources:
      - group: "" # core
        resources: ["nodes"]
  - level: None
    userGroups: ["system:nodes"]
    verbs: ["get"]
    resources:
      - group: "" # core
        resources: ["nodes"]
  - level: None
    users:
      - system:kube-controller-manager
      - system:kube-scheduler
      - system:serviceaccount:kube-system:endpoint-controller
    verbs: ["get", "update"]
    namespaces: ["kube-system"]
    resources:
      - group: "" # core
        resources: ["endpoints"]
  - level: None
    users: ["system:apiserver"]
    verbs: ["get"]
    resources:
      - group: "" # core
        resources: ["namespaces"]
  # We recommend that you do not log these read-only URLs.
  - level: None
    nonResourceURLs:
      - /healthz*
      - /version
      - /swagger*
  # We recommend that you do not log events requests.
  - level: None
    resources:
      - group: "" # core
        resources: ["events"]
  # Secrets, ConfigMaps, and TokenReviews can contain sensitive and binary data.
  # Therefore, they are logged only at the Metadata level.
  - level: Metadata
    resources:
      - group: "" # core
        resources: ["secrets", "configmaps"]
      - group: authentication.k8s.io
        resources: ["tokenreviews"]
  # Get repsonses can be large; skip them.
  - level: Request
    verbs: ["get", "list", "watch"]
    resources:
      - group: "" # core
      - group: "admissionregistration.k8s.io"
      - group: "apps"
      - group: "authentication.k8s.io"
      - group: "authorization.k8s.io"
      - group: "autoscaling"
      - group: "batch"
      - group: "certificates.k8s.io"
      - group: "extensions"
      - group: "networking.k8s.io"
      - group: "policy"
      - group: "rbac.authorization.k8s.io"
      - group: "settings.k8s.io"
      - group: "storage.k8s.io"
  # Default level for known APIs.
  - level: RequestResponse
    resources:
      - group: "" # core
      - group: "admissionregistration.k8s.io"
      - group: "apps"
      - group: "authentication.k8s.io"
      - group: "authorization.k8s.io"
      - group: "autoscaling"
      - group: "batch"
      - group: "certificates.k8s.io"
      - group: "extensions"
      - group: "networking.k8s.io"
      - group: "policy"
      - group: "rbac.authorization.k8s.io"
      - group: "settings.k8s.io"
      - group: "storage.k8s.io"
  # Default level for all other requests.
  - level: Metadata
```

**Note:**

-   Logs are not recorded immediately after requests are received. Log recording starts only after the response body header is sent.
-   The following requests or operations are not audited: redundant kube-proxy watch requests, GET requests from kubelet and system:nodes for nodes, operations performed on endpoints by kube components in the kube-system, and GET requests from the apiserver for namespaces.
-   Read-only urls such as /healthz\*, /version\*, and /swagger\* are not audited.
-   Logs of interfaces of secrets, configmaps, and tokenreviews are set to the metadata level because they might contain sensitive information or binary files. For logs of this level, only the user, timestamp, request resources, and request actions of the request event are audited. The request body and the response body are not audited.
-   For sensitive interfaces such as authentication, rbac, certificates, autoscaling, and storage, the corresponding request bodies and response bodies are audited according to the read and write requests.

## View audit log reports {#section_ry3_pnf_qgb .section}

A Kubernetes cluster that runs on Alibaba Cloud Container Service has three audit log reports that provide the following information:

-   Operations performed by all users and system components on the cluster
-   The source IP address of each operation, the area to which a source IP addresses belongs, and the source IP address distribution
-   Detailed operation charts of all resources
-   Operation charts of each sub-account
-   Charts of important operations such as logging on to a container, accessing a secret, and removing resources

**Note:**

-   For Kubernetes clusters created after January 13, 2019, if you active Log Service for the clusters, the system automatically enables audit log report functions. If audit log report functions are disabled for a Kubernetes cluster, see [Manually enable audit log report functions](#).
-   We recommend that you do not modify audit log reports. If you want to customize audit log reports, you can create new reports in the [Log Service console](https://partners-intl.console.aliyun.com/#/sls).

You can access audit log reports by using either of the following two methods:

-   Log on to the [Container Service console](https://partners-intl.console.aliyun.com/#/cs). In the action column of the target cluster, choose **More** \> **Cluster Audit**.

    ![](http://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/assets/img/21467/155141875337908_en-US.png)

-   Log on to the [Container Service console](https://partners-intl.console.aliyun.com/#/cs).Click the target cluster name, and then click **Cluster Audit** in the left-side navigation pane.

    ![](http://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/assets/img/21467/155141875337910_en-US.png)

## Audit log report overview {#section_hkj_bcy_ngb .section}

The following three apiserver audit log reports are available: Audit Center Overview, Resource Operation Overview, and Resource Operation Detail.

-   Audit Center Overview

    This report displays an overview of the Kubernetes cluster events and the detailed information about important events, such as public network visits, command execution, resource removal, and secret visits.

    ![](http://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/assets/img/21467/155141875337911_en-US.png)

    **Note:** By default, this report displays statistics for one week. You can customize a statistics time range. In addition, you can filter events by specifying one or multiple factors, such as a namespace, a sub-account ID, and a status code.

-   Resource Operation Overview

    This report displays the operation statistics information about computing resources, network resources, and storage resources of a Kubernetes cluster. Operations include creation, update, removal, and access.

    -   Computing resources include deployment, StatefulSet, CronJob, DaemonSet, Job, and pod.
    -   Network resources include service and Ingress.
    -   Storage resources include ConfigMap, secret, and Persistent Volume Claim.
    ![](http://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/assets/img/21467/155141875337915_en-US.png)

    **Note:**

    -   By default, this report displays statistics for one week. You can customize a statistics time range. In addition, you can filter events by specifying one or both of the following factors: a namespace or a sub-account ID.
    -   If you want to view the detailed operation events of a resource, we recommend that you use Resource Operation Detail.
-   Resource Operation Detail

    This report displays detailed operation information of a Kubernetes cluster resource. You must select or enter a resource type to view detailed operation information in time. This report displays the total number of operation events, namespace distribution, success rate, timing trend, and specific operation charts.

    ![](http://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/assets/img/21467/155141875337918_en-US.png)

    **Note:**

    -   If you want to view a CRD resource registered in Kubernetes or any other resources not listed in the report, you can enter the plural form of the target resource. For example, to view a CRD resource named AliyunLogConfig, you can enter AliyunLogConfigs.
    -   By default, this report displays statistics for one week. You can customize a statistics time range. In addition, you can filter events by specifying one or multiple factors, such as a namespace, a sub-account ID, and a status code.

## View detailed log records {#section_s4g_dhf_2fb .section}

If you want to customize a log query or analyze audit logs, you can log on to Log Service to view detailed log records.

1.  Log on to the [Log Service console](https://partners-intl.console.aliyun.com/#/sls).
2.  In the left-side navigation pane, click **Project Management**, select the Project configured when you create the cluster, and then click the Project name.

    ![](http://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/assets/img/21467/155141875312111_en-US.png)

3.  On the Logstores page, find the Logstore named audit-$\{clusterid\} and click **Search** at the right side of the Logstore. The audit logs of the cluster are stored in this Logstore.

    ![](http://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/assets/img/21467/155141875312114_en-US.png)

    **Note:**

    -   When you create a Kubernetes cluster, your specified log Project automatically creates a Logstore named audit-$\{clusterid\}.
    -   The audit log Logstore index is set by default. We recommend that you do not modify the index. Otherwise, the audit log reports become invalid.

To search for an audit log, you can use one of the following methods:

-   To query a sub-account operation record, enter the sub-account ID and then click **Search & Analysis**.
-   To query operations on a resource, enter the resource name and click **Search & Analysis**.
-   To filter out operations performed by system components, enter `NOT user.username: node NOT user.username: serviceaccount NOT user.username: apiserver NOT user.username: kube-scheduler NOT user.username: kube-controller-manager`, and then click **Search & Analysis**.

For more information, see [Log Service search and analysis methods](../../../../../reseller.en-US/User Guide/Index and query/Overview.md#).

## Set resource alarms {#section_av1_lly_ngb .section}

You can use the alarm function of Log Service to set resource alarms. Alarm notifications can be sent through a DingTalk group robot, a customized Webhook, and the Message Center.

**Note:** Audit log reports provide multiple query statements. On the Logstores page, click **Dashboard** in the left-side navigation pane and then click a dashboard \(namely, an audit log report\) to display all charts, Click the menu in the upper-right corner of a chart, and then click **View Details**.

Example 1: Set an alarm notification for running a command on a container

To prevent Kubernetes cluster users from logging on to any container to run a command, you must set an alarm notification for running a command on any container. Furthermore, the alarm notification must include detailed information such as the container to which the user logged on, commands, user name, the event ID, the operation time, and the user IP address.

-   The query statement is as follows:

    ```
    verb : create and objectRef.subresource:exec and stage:  ResponseStarted | SELECT auditID as "event ID", date_format(from_unixtime(__time__), '%Y-%m-%d %T' ) as "operation time",  regexp_extract("requestURI", '([^\?]*)/exec\?.*', 1)as "resource",  regexp_extract("requestURI", '\?(.*)', 1)as "command" ,"responseStatus.code" as "status code",
     CASE
     WHEN "user.username" != 'kubernetes-admin' then "user.username"
     WHEN "user.username" = 'kubernetes-admin' and regexp_like("annotations.authorization.k8s.io/reason", 'RoleBinding') then regexp_extract("annotations.authorization.k8s.io/reason", ' to User "(\w+)"', 1)
     ELSE 'kubernetes-admin' END
     as "operation account",
    CASE WHEN json_array_length(sourceIPs) = 1 then json_format(json_array_get(sourceIPs, 0)) ELSE  sourceIPs END
    as "source IP address" limit 100
    ```

-   The condition expression is `operation event =~ ".*"`.

Example 2: Set an alarm notification for failed Internet access to apiserver

To prevent malicious attacks on a Kubernetes cluster for which Internet access is enabled, you need to monitor the number of Internet access times and the failed access rate. Specifically, an alarm notification must be sent, when the number of Internet access times reaches a specified threshold and the failed access rate exceeds a specified threshold. Furthermore, the alarm notification must include detailed information such as the area to which the user IP address belongs, the user IP address, and the high risk IP address. For example, to receive an alarm notification when the number of Internet access times reaches 10 and the failed access rate exceeds 50%, configure the following settings:

-   Query statement.

    ```
    * | select ip as "source IP address", total as "number of access times", round(rate * 100, 2) as "failed access rate%", failCount as "number of illegal access times", CASE when security_check_ip(ip) = 1 then 'yes' else 'no' end  as "high risk IP address",  ip_to_country(ip) as "country", ip_to_province(ip) as "province", ip_to_city(ip) as "city", ip_to_provider(ip) as "network operator" from (select CASE WHEN json_array_length(sourceIPs) = 1 then json_format(json_array_get(sourceIPs, 0)) ELSE  sourceIPs END
    as ip, count(1) as total,
    sum(CASE WHEN "responseStatus.code" < 400 then 0
    ELSE 1 END) * 1.0 / count(1) as rate,
    count_if("responseStatus.code" = 403) as failCount
    from log  group by ip limit 10000) where ip_to_domain(ip) != 'intranet'  having "number of access times" > 10 and "failed access rate%" > 50 ORDER by "number of access times" desc limit 100
    ```

-   Condition expression is `source IP address =~ ".*"`.

## Manually enable audit log report functions {#section_rgl_hvy_ngb .section}

You can manually enable audit log report functions.

1.  Enable apiserver audit log.

    View apiserver pod settings. That is, check whether audit log settings are configured for the startup parameters and environment variable.

    -   Startup parameters

        ```
        containers:
          - command:
            - kube-apiserver
            - --audit-log-maxbackup=10
            - --audit-log-maxsize=100
            - --audit-log-path=/var/log/kubernetes/kubernetes.audit
            - --audit-log-maxage=7
            - --audit-policy-file=/etc/kubernetes/audit-policy.yml
        ```

    -   Environment variable

        ```
        env:
            - name: aliyun_logs_audit-c12ba20***************9f0b
              value: /var/log/kubernetes/kubernetes.audit
        ```

    If the apiserver pod settings does not contain the preceding settings, you must upgrade the Kubernete cluster to the latest version. For more information, see [Upgrade a Kubernetes cluster](reseller.en-US/User Guide/Kubernetes cluster/Cluster management/Upgrade a Kubernetes cluster.md#).

2.  Use the latest version of the Log Service component.
    -   For how to install the Log Service component, see [Manually install the Log Service component](reseller.en-US/User Guide/Kubernetes cluster/Log management/Use Log Service to collect Kubernetes cluster logs.md#section_shf_y5r_gfb).
    -   If you have installed the Log Service component, but the audit log function is disabled, you must upgrade the component to the latest version and you must ensure that your Logtail version is not earlier than v0.16.16 and can run on Master nodes. For more information, see [Upgrade the Log Service component](reseller.en-US/User Guide/Kubernetes cluster/Log management/Use Log Service to collect Kubernetes cluster logs.md#section_b3f_y5r_gfb).
3.  Update audit log parsing methods.
    1.  Log on to the [Log Service console](https://partners-intl.console.aliyun.com/#/sls).
    2.  In the left-side navigation pane, click **Project Management**, and then click the name of the Project specified when creating your Kubernetes cluster.
    3.  The Logstores page is displayed by default. Click **Manage** on the right of the Logstore named audit-$\{clustered\}, and then click the configuration name. On the Specify Collection Mode tab page, select the **JSON Mode**.

        ![](http://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/assets/img/21467/155141875337960_en-US.png)

## Use a thirty-party log solution {#section_nf2_lsf_2fb .section}

Log on to the Master node of the cluster, and you can find the source file of the audit logs in the path of /var/log/kubernetes/kubernetes.audit. The source file is in standard JSON format. When deploying a cluster, you can use other log solutions to collect and search audit logs, instead of using Alibaba Cloud Log Service.

url: https://raw.githubusercontent.com/osswangxining/csk/a3c4988e5d2c7e266241d9839b6807837926919c/intl.en-US/User Guide/Kubernetes cluster/Security management/Kube-apiserver audit logs.md

repository: osswangxining/csk

filename: Kube-apiserver audit logs.md

repo_name: osswangxining/csk


text:
# Integrating math with art

Software to make calculus in an elegant way, then the result seems like art.

+ **I**: Integrated
+ **C**: creative
+ **E**: enviroment

+ **C**: Calculating
+ **R**: random
+ **E**: entangled
+ **A**: artistics
+ **M**: mathematics

What is better than ice cream? Sweet and colorful like arts, cold as mathematics

### Some interesting lectures:

[How an MIT research group turned computer code into a modern design medium](https://eyeondesign.aiga.org/how-an-mit-research-group-turned-computer-code-into-a-modern-design-medium/)

### Interesting software:
[Processing Foundation](https://github.com/processing)

[OpenCV](https://opencv.org/)

[Qt](https://www.qt.io/)

[OpenGL](https://www.opengl.org/)

[Pyo - Python DSP module](https://github.com/belangeo/pyo)


text:
A simple on the surface but mildly complicated **Flutter** app using a **machine learning** model. The model runs on a **Python** server and is used to detect palm oil plantations in images uploaded by the user from their gallery. It interacts with the mobile app via **Firebase** through API requests after proceeding through a **Square payment gateway**.

Built in less than a week over a normal work week with no previous experience in Flutter/Firebase/Square.

Login, basic UI and payment system started from forked repo: https://github.com/efortuna/shrine_with_square

Firebase communication and python server inspired by this repo: https://github.com/ZbigniewTomanek/image_classification_with_flutter

# Setup and usage
Run the python flask app found in **FlutterMLApp/python** with
```
flask run --host=<IP_ADDRESS>
```
This puts the machine learning model in service to be requested by the Android app. This is not for serving a web app.

In **lib/service.dart**, a URL variable at the top of the file is set by default. This is the URL necessary for the app running on an Android emulator to find the Python server, which should be running on your local machine. **You may need to change this depending on where you run the Python server**

Once this is running, go ahead and launch the app on an Android emulator (if you need to set up an Android emulator or Flutter, follow their installation tutorial: https://flutter.dev/docs/get-started/install).

Select an image and make a payment (no payments are actually made, this is a test app).
The default card on Sqaure to use is **4111 1111 1111 1111**

repository: KazToozs/FlutterMLApp

repo_name: KazToozs/FlutterMLApp