text:
---
id: 385
title: More on Thunderbird in France
date: 2008-01-31T00:55:22+00:00
author: David Ascher
layout: post

restapi_import_id:
  - 5780561eab8f6
original_post_id:
  - "385"
categories:
  - France
  - Mozilla
  - Thunderbird
---
I had a great day in Mountain View today. It was the day after the Firefox 3b3 code freeze, so there were a lot of very tired, bleary-eyed engineers walking around, but the tree was green, regressions seemed under control, and great features had landed (I’m particularly looking forward to integrating the new Add-ons manager in Thunderbird, it’ll help solve a real pain point for users of extensions). I also got to meet some of the Toronto UX folks, and generally talk blue-sky Thunderbird UI ideas, which is always fun.

There were only two negatives about the day: the fact that I hit yet-another-KQED pledge drive, and that even after several rounds of triage during the day, I came home to an inbox with 454 emails to process.

A couple of interesting links as part of that mailstorm came from home:

The AFP (France’s largest news agency) reports that “[French police deal blow to Microsoft](http://afp.google.com/article/ALeqM5iU4Lq7tOR_WVOJLZ3IeRaIH03x6w)“, referring to the Gendarmerie Nationale’s decision to move to an open source stack for their 70,000 seats, using Ubuntu, OpenOffice, Firefox, and Thunderbird. (I like the cute picture in the left of that story)

Equally impressive, Tristan Nitot [reports](http://standblog.org/blog/post/2008/01/30/Questions-a-Thierry-Leblond-Ministere-de-la-Defense) (in French) on his conversation with a representative of the French Defense Ministry, who indicates that they’re recommending Postfix as the mail server and Thunderbird as the recommended mail client for most users, reaching up to 200,000 users (this doesn’t include the 70,000 mentioned above).

Both of those organizations use Thunderbird in _truly_ mission-critical situations, and have build significant [extensions](http://milimail.org/milimail/index.php/Main_Page) to support their particular requirements regarding delivery notification, acknowledgement processes, etc. Not something everyone needs, but if you need it, you really need it, and Thunderbird’s extension model can let these kinds of sophisticated users help themselves, which is the way software should be.


text:
# Real time Drowsiness Detector for Safe Driving using Eye Blink Pattern Recognition Technique

[![GitHub issues](https://img.shields.io/github/issues/sudo-rajarshi/Real-time-Drowsiness-Detector-for-Safe-Driving-using-Eye-Blink-Pattern-Recognition-Technique)](https://github.com/sudo-rajarshi/Real-time-Drowsiness-Detector-for-Safe-Driving-using-Eye-Blink-Pattern-Recognition-Technique/issues)
[![GitHub stars](https://img.shields.io/github/stars/sudo-rajarshi/Real-time-Drowsiness-Detector-for-Safe-Driving-using-Eye-Blink-Pattern-Recognition-Technique)](https://github.com/sudo-rajarshi/Real-time-Drowsiness-Detector-for-Safe-Driving-using-Eye-Blink-Pattern-Recognition-Technique/stargazers)
[![GitHub license](https://img.shields.io/github/license/sudo-rajarshi/Real-time-Drowsiness-Detector-for-Safe-Driving-using-Eye-Blink-Pattern-Recognition-Technique)](https://github.com/sudo-rajarshi/Real-time-Drowsiness-Detector-for-Safe-Driving-using-Eye-Blink-Pattern-Recognition-Technique/blob/master/LICENSE)

Inspired by Soukupová and Čech’s 2016 paper - [Real-Time Eye Blink Detection using Facial Landmarks](https://www.semanticscholar.org/paper/Real-Time-Eye-Blink-Detection-using-Facial-Soukupov%C3%A1-%C4%8Cech/4fa1ba3531219ca8c39d8749160faf1a877f2ced).

## Salient Features:
1) Real time drowsiness detection is implemented on light weight
processing unit (raspberry pi).
2) The system is able to capture real time images using miniature
camera (say webcam, raspberry camera) installed at dashboard
of a car.
3) Fast and accurate face detection and eye detection algorithm is
performed on real time captured images.
4) Proposed algorithm is able to detect drowsiness in both
constrained and unconstrained background.
5) Scale invariant detection is possible.
6) The system can detect drowsiness in noisy environment.
7) Entire Computational time is very less.
8) Prior communication is established with family members via
email, SMS etc.

## Proposed Methodology:
### Step 1: Real time image capture
Real time images are captured using raspberry pi camera with size of
640x480x3px(RGB).
### Step 2: Eye detection from facial landmark indexes
The facial landmark detector produces 68 (x, y)-coordinates that map
to specific facial structures. These 68 point mappings were obtained
by training a shape predictor on the labelled iBUG 300-W dataset.

![Facial Landmarks](https://pyblog.xyz/wp-content/uploads/2018/03/facial_landmarks_68markup-300x242.jpg)

Therefore, to extract the eye regions from a set of facial
landmarks, we simply need to know the correct array slice
indexes. Using those indexes, we are able to extract the eye
regions via an array slice.

### Step 3: Eye Blink detection Algorithm
![Drowsiness Detection](https://www.pyimagesearch.com/wp-content/uploads/2017/04/blink_detection_plot.jpg)

For every video frame, the eye landmarks are detected. The eye aspect ratio (EAR) between height
and width of the eye is computed.

![alt text](https://latex.codecogs.com/gif.latex?EAR%20%3D%20%5Cfrac%7B%7C%7Cp_2-p_6%7C%7C+%7C%7Cp_3-p_5%7C%7C%7D%7B%7C%7Cp_1-p_4%7C%7C%7D)

Here we've the graph of EAR w.r.t time. As we can see, the Eye Aspect Ratio is constant (indicating the eye is open), then rapidly drops to zero, then increases again, indicating a blink has taken place.

In our drowsiness detector case, we’ll be monitoring the Eye Aspect Ratio to see if the value falls but does not increase again, thus implying that the person has closed his eyes.

## Run in your own machine:
* `git clone https://github.com/sudo-rajarshi/Real-time-Drowsiness-Detector-for-Safe-Driving-using-Eye-Blink-Pattern-Recognition-Technique.git`
* `cd Real-time-Drowsiness-Detector-for-Safe-Driving-using-Eye-Blink-Pattern-Recognition-Technique`
* `pip3 install -r requirements.txt` (This will take time)
* `python3 Drowsiness_detecion.py`
* `python3 Drowsiness_detecion_gpio.py` (for Raspberry Pi)
* `Press Q to stop the process`

license: MIT

branch_name: refs/heads/master

extension: md

gha_language: Jupyter Notebook

gha_license_id: MIT

license_type: permissive


text:
GIMVS - Graphical Interface for MaxEnt Variable Selection
=========================================================

The [MaxentVariableSelection](https://github.com/alj1983/MaxentVariableSelection) package is useful to identify the most important set of uncorrelated environmental variables on a **MaxEnt** Model and also helps tune **MaxEnt** settings. The aim of this **RStudio** gadget is to simplify the tasks to select input directories and files, and MaxEnt parameters. It also helps with the creation of input files in SWD format.

## Default Parameters
At the beginning of the script are defined the default directories, files, and parameters. It is recommended that you modify them according to your OS and experiments. Please note that if you are using a computer with Windows OS, you should put the paths with the forward slash `"/"` or the double backwards slash `"\\"`.

## Installation

Just donwload the file `gimvs.R` from: [https://github.com/geoabi/gimvs](https://github.com/geoabi/gimvs)

Also install the following packages:

```R
install.packages("shiny")
install.packages("miniUI")
install.packages("raster")
install.packages("MaxentVariableSelection")
```
You can also install **MaxentVariableSelection** using:
```R
devtools::install_github("alj1983/MaxentVariableSelection")
```
You can get the last version of **MaxEnt** and documentation [here](http://biodiversityinformatics.amnh.org/open_source/maxent/). This gadget was tested using the version **3.3.3k** that you can get [here](https://github.com/mrmaxent/Maxent/tree/master/ArchivedReleases/3.3.3k).

## How to use
Open **RStudio** and set your working directory to the location where you downloaded the `gimvs.R` file. Later use the command `source` to execute the gadget. For example, if you donwloaded the file to `C:/myScripts` use:
```R
source("C:/myScripts/gimvs.R")
```
Alternatively you can just open the file on the file editor of **RStudio** and click on `Source`.

This gadget is an implementation of the instructions provided with the documentation of **MaxentVariableSelection**, you could test this gadget by following the tutorial in `MaxentVariableSelection.pdf` that is located in the doc directory of the package installation. You can also get it [here](https://github.com/alj1983/MaxentVariableSelection/blob/master/inst/doc/MaxentVariableSelection.pdf). Please note that running the variable selection could take a long period of time depending to the input data and your computer configuration.

## Problems and Contribution
If you have problems running the script or you have suggestions, please open an issue [here](https://github.com/geoabi/gimvs/issues) at  GitHub. Also if you are interested in collaborate, please make a pull request.

## Screenshots

repository: geoabi/gimvs

repo_name: geoabi/gimvs


text:
## ARTBAT
This is a simple python script that reads in two text files. The first is a list of numbers. The second is a list of point names. The output is a complete list of each point name for every number. In this example there are 40 numbers. So for each point name there will be 40 unique points, totaling 1280.

## Motivation
I needed to generate 40 names for each point in the list. Instead of doing this manually, which would take a while, I quickly created a python script to do it for me.

## Tech
<b>Built with:</b>
- [Python](https://www.python.org/)

## Installation
Python 3 is the only requirement for this project. There were not any third party modules used.

## Usage

```bash
python main.py
```

## License
[MIT](https://choosealicense.com/licenses/mit/)

branch_name: refs/heads/main


text:
# webhookd

[![Image size](https://img.shields.io/imagelayers/image-size/ncarlier/webhookd/latest.svg)](https://hub.docker.com/r/ncarlier/webhookd/)
[![Docker pulls](https://img.shields.io/docker/pulls/ncarlier/webhookd.svg)](https://hub.docker.com/r/ncarlier/webhookd/)

A very simple webhook server to launch shell scripts.

It can be used as a cheap alternative of Docker hub in order to build private Docker images.

## Installation

### Binaries

Linux binaries for release [0.0.3](https://github.com/ncarlier/webhookd/releases)

* [amd64](https://github.com/ncarlier/webhookd/releases/download/v0.0.3/webhookd-linux-amd64-v0.0.3.tar.gz)

Download the version you need, untar, and install to your PATH.

```
$ wget https://github.com/ncarlier/webhookd/releases/download/v0.0.3/webhookd-linux-amd64-v0.0.3.tar.gz
$ tar xvzf webhookd-linux-amd64-v0.0.3.tar.gz
$ ./webhookd
```

### Docker

Start the container mounting your scripts directory:

```
$ docker run -d --name=webhookd \
  --env-file etc/env.conf \
  -v ${PWD}/scripts:/var/opt/webhookd/scripts \
  -p 8080:8080 \
  ncarlier/webhookd
```

The provided environment file (`etc/env.conf`) is used to configure the app.
Check [sample configuration](etc/env_sample.com) for details.

## Usage

Create your own scripts template in the **scripts** directory.

Respect the following structure:

```
/scripts
|--> /bitbucket
  |--> /script_1.sh
  |--> /script_2.sh
|--> /github
|--> /gitlab
|--> /docker
```

The hookname you will use will be related to the hook you want to use (github, bitbucket, ...) and the script name you want to call:
For instance if you are **gitlab** and want to call **build.sh** then you will need to use:

```
http://webhook_ip:port/gitlab/build
```

It is important to use the right hook in order for your script to received parameters extract from the hook payload.

For now, supported hooks are:

- GitHub
- Gitlab
- Bitbucket
- Docker Hub

Check the scripts directory for samples.

Once the action script created, you can trigger the webhook :

```
$ curl -H "Content-Type: application/json" \
  --data @payload.json \
  http://localhost:8080/<hookname>/<action>
```

The action script's output is collected and sent by email or by HTTP request.

The HTTP notification need some configuration:

- **APP_NOTIFIER**=http
- **APP_NOTIFIER_FROM**=webhookd<EMAIL_ADDRESS>-<EMAIL_ADDRESS>- **APP_HTTP_NOTIFIER_URL**=http://requestb.in/v9b229v9

> Note that the HTTP notification is compatible with [Mailgun](https://mailgun.com) API.

As the smtp notification:

- **APP_NOTIFIER**=smtp
- **APP_SMTP_NOTIFIER_HOST**=localhost:25


text:
# zsh-dotnet-completion

> Zsh plugin for _dotnet_ CLI completion

![Short movie showing tab completion in Zsh for dotnet CLI](demo.gif)

## Installation

### Manually

Clone this repository somewhere (`~/.zsh-dotnet-completion` for example)

```shell
git clone https://github.com/memark/zsh-dotnet-completion.git ~/.zsh-dotnet-completion
```

Then source it in your `.zshrc`

```shell
source ~/.zsh-dotnet-completion/zsh-dotnet-completion.plugin.zsh
```

### Using [Antigen](https://github.com/zsh-users/antigen)

Bundle `zsh-dotnet-completion` in your `.zshrc`

```shell
antigen bundle memark/zsh-dotnet-completion
```

### Using [zplug](https://github.com/b4b4r07/zplug)

Load `zsh-dotnet-completion` as a plugin in your `.zshrc`

```shell
zplug "memark/zsh-dotnet-completion", defer:2
```

### Using [zgen](https://github.com/tarjoilija/zgen)

Include the load command in your `.zshrc`

```shell
zgen load memark/zsh-dotnet-completion
```

### As an [Oh My ZSH!](https://github.com/robbyrussell/oh-my-zsh) custom plugin

Clone `zsh-dotnet-completion` into your custom plugins repo

```shell
git clone https://github.com/memark/zsh-dotnet-completion ~/.oh-my-zsh/custom/plugins/zsh-dotnet-completion
```

Then load as a plugin in your `.zshrc`

```shell
plugins+=(zsh-dotnet-completion)
```

## Credits

The plugin is based on the instructions found at [How to enable TAB completion for the .NET Core CLI](https://docs.microsoft.com/en-us/dotnet/core/tools/enable-tab-autocomplete#zsh).

The structure of this page was inspired by [zsh-better-npm-completion](https://github.com/lukechilds/zsh-better-npm-completion) by Luke Childs, from which I also borrowed the installation instructions.

## License

MIT © Magnus Markling


text:
# Markdown Sample

## Paragraph
This is a simple paragraph.

_Italic text_

*Italic text*

**Strong text**

__Strong text__

## Unordered List
* One
* Two
* Three
	* Three and a half
* Four

## Ordered List
1. One
1. Two
1. Three
	1. Three and a half
1. Four

## A Table
This is a table:

| Title                   | Author           | Pages  |
|-------------------------|------------------|--------|
| The Wind in the Willows |  Kenneth Grahame |  500   |
| The Lord of the Rings   |  J.R.R. Tolkien  |  1000  |

## Code Block

    > x = x + 1;
    > y = "Hello";
    > y.length() + 42;

## Code Span
This is a ``code`` span.

repository: ingomohr/docwriter

gha_language: Java

repo_name: ingomohr/docwriter


text:
# About
Designed to be pronounced like "cross-ing", this is currently a narrow-minded RPC library that helps building a particular style of microservices.

Essentially, it is RabbitMQ + protobuf with some pre-defined rules on message topics.

# Credit
This started from an opioninated usage of the amqp library, as such, it took references from the following fine projects, especially `cony`:

* [cony](https://github.com/assembla/cony)
    * wrapper around ampq in declarative style
* [coworkers](https://github.com/tjmehta/coworkers)
    * A RabbitMQ Microservice Framework in Node.js
* [relay](https://github.com/armon/relay)
    * Golang framework for simple message passing using an AMQP broker

Later on, somebody suggested that `xing` should provide higher level functionalities like what `gRPC` does. Initially I was against the idea because 1) I don't really like code generators 2) I don't really like hiding the fact that a seemingly simple function call is actually a remote call. But I added the functionality anyway, again, taking references from the following fine projects, especially `go-micro`:

* [go-micro](https://github.com/micro/go-micro)
    * a feature rich, flexible microservice framework that has very good abstraction. the companion [protobuf compiler plugin](https://github.com/wzhliang/protobuf/) for `xing` was a fork from go-micro; the WIP sercice registration builds directly on top of the `registry` package.
* [go-kit](https://github.com/go-kit/kit)
    * A standard library for microservices.
* [rpcx](https://github.com/smallnest/rpcx)
    * A RPC service framework based on net/rpc like alibaba Dubbo and weibo Motan. One of best performance RPC frameworks.

repository: wzhliang/xing

repo_name: wzhliang/xing


text:
# How to contribute

## Process

### 1) Create feature branch

I.e. `feature/dropdown`

### 2) Create your component in the appropriate directory

I.e. a dropdown component would go into `src/components/ui/form/NiceDrowndown.ts`

All components are implemented in Typescript.

#### Themes

If the component uses a theme, add its type definition in the same folder: `NiceDropdownTheme.ts`
Also add a default theme for the component in the same file.
Add them to `src/themes/Theme.ts` and `src/themes/DefaultTheme.ts`.

#### Props

If there are props used to style the component (spacing, colors, font sizes, etc), make sure that they are optional and that the component falls back to the theme if they are ommited.

### 3) Add JSDocs to your component

Add a comment above each prop in the interface for the props.

### 4) Add stories

Make a separate JS file for your component.

### 5) Add unit tests

Make sure that all conditional parts of the component are tested.

```
<Clickable onClick={disabled ? undefined : onToggle}>
```

Make sure that there are tests for disabled=true and disabled=false.

### 6) Verifying in browser

The component should work and look as expected in:
Chrome, Firefox, Edge, Safari.

### 7) Create a pull request in Github

## Enhancers

### Enhancers for external libs

If you are creating an enhancer for an external lib, make sure to document which version of the library which it has been tested with.

repository: StenaIT/stenajs-webui-core

gha_language: TypeScript

repo_name: StenaIT/stenajs-webui-core


text:
# house-monitor

This is the software for a mechanism I built to monitor my house while I'm away.

It runs on a [raspberry pi 1] (https://www.raspberrypi.org/products/model-b/) and
uses a [one wire temperature sensor](https://www.sparkfun.com/products/245) and
[raspberry pi camera](https://www.sparkfun.com/products/11868).

It uploads the data to a [cloud service](https://aws.amazon.com/ec2/) so I can access it from anywhere.

The client application is an [Angular2](http://www.angular2.com/) app written in [typescript](http://typescriptlang.org).
The server and misc utilities are all written in [Node.js](https://nodejs.org/en/).  The temperature graph is done
with [google charts](https://developers.google.com/chart/?hl=en) and [nginx](https://www.nginx.com/resources/wiki/) handles http.

[The linux motion utility](http://www.lavrsen.dk/foswiki/bin/view/Motion/WebHome) is used to handle the video.

## Screenshot
![screenshot](https://raw.githubusercontent.com/cparker/house-monitor/master/src/resources/screenshot.png)

## Block Diagram
![block diagram](https://raw.githubusercontent.com/cparker/house-monitor/master/src/resources/house-monitor-pic.jpg)

**temp.js** - Gets temperature from one-wire sensor

**recordTemp.js** - saves raw temperature readings in .json file

**upload-new-vids.js** - uploads video images and temperature data to http://cjparker.us

**re-encode-vids.js** - re-encodes videos to make them viewable on iOS browsers

**server.js** - Provides REST API access to video and temperature data

See src/resources for

repository: cparker/house-monitor

repo_name: cparker/house-monitor


text:
---
layout: post
title: "Context-Aware Crowd Counting"
date: 2019-04-15 08:32:16
categories: arXiv_CV
tags: arXiv_CV
author: Weizhe Liu, Mathieu Salzmann, Pascal Fua
mathjax: true
---

* content
{:toc}

##### Abstract
State-of-the-art methods for counting people in crowded scenes rely on deep networks to estimate crowd density. They typically use the same filters over the whole image or over large image patches. Only then do they estimate local scale to compensate for perspective distortion. This is typically achieved by training an auxiliary classifier to select, for predefined image patches, the best kernel size among a limited set of choices. As such, these methods are not end-to-end trainable and restricted in the scope of context they can leverage.
 In this paper, we introduce an end-to-end trainable deep architecture that combines features obtained using multiple receptive field sizes and learns the importance of each such feature at each image location. In other words, our approach adaptively encodes the scale of the contextual information required to accurately predict crowd density. This yields an algorithm that outperforms state-of-the-art crowd counting methods, especially when perspective effects are strong.

##### Abstract (translated by Google)

##### URL
[http://arxiv.org/abs/1811.10452](http://arxiv.org/abs/1811.10452)

##### PDF
[http://arxiv.org/pdf/1811.10452](http://arxiv.org/pdf/1811.10452)


text:
1. Channels
    - Channels should have different permission levels to limit access
    - Root users should be able to modify channel settings, including subjects, channel name, and members.
    -  Channels should be easily creatable somehow
    - Channels should be able to "import" and include other channels, only if the importer has root permissions in the importing channel and at least admin permissions in the exporting channel
2. UI
    - Consider swipe actions instead of tap-and-hold for editing and deleting homework on touch screens
    - Show context menu on right click on desktop
    - Search and dropdown suggestions for adding members to a channel
    - Add search features for homework??
    - Improve colors somehow??
3. New Features
    - Mark as done
        - Hides homework unless a `show all` setting is enabled
        - Could be activated by swipe?
        - Allows for users to be notified about homework not done
        - Users can see how many % of members have completed homework
    - Analytics
        - Graph of homework v time
        - Graph of homework v subject
        - See who is the biggest contributer in terms of adding homework
4. Security
    - Increase number of unit tests
        - Send incorrect types and see what happens
    - Increase mitigation for CSRF
        - Especially for websockets, maybe implement CSRF token on top of origin checking

repository: junron/hwboard

gha_language: JavaScript

repo_name: junron/hwboard


text:
Components
==========

A tab in the Kubernetes UI with its set of visualizations is referred to as a *component*. Components are separated from the chrome and services to simplify the development of new visualizations. This document describes how to create and modify components.

Each component has its own directory in `www/master/components`. The component directory contains a manifest file and the files comprising the component, such as HTML  pages and views, Angular providers, CSS and Less files, and other assets. Here is the recommended structure for a component directory:

```
foo_component
├── config
├── css
├── img
├── js
│   └── modules
│       ├── controllers
│       ├── directives
│       └── services
├── less
├── pages
├── protractor
├── test
├── views
│   └── partials
└── manifest.json
```

###Manifest file

The JSON-formatted manifest file, named `manifest.json`, resides at the root of the directory. Using the component directory name and the contents of the manifest, the Kubernetes UI automatically adds a tab to the chrome, a dependency on the component's AngularJS module in the main AngularJS app, and Angular routes for the component.

For example, consider the following manifest file at `master/components/foo_component/manifest.json`:

```
{
  "routes": [
    {
      "url": "/",
      "templateUrl": "/components/foo_component/pages/home.html"
    },
    {
      "url": "/kittens",
      "templateUrl": "/components/foo_component/pages/kittens.html",
      "css": "/components/foo_component/css/kittens.css"
    }
  ]
}
```

From the name of the component directory, the Kubernetes UI:

* creates a tab called "Foo Component",
* adds Angular module `kubernetesApp.components.fooComponent` to the dependencies of `kubernetesApp`, and
* defines Angular routes `/foo_component/` and `/foo_component/kittens`.

Every tab links to `/` relative to its component, so it is important to always define a `/` route.

###Source files
Many of the files located in `master/components/<component>` are copied to `app/components/<component>/` on each gulp build. This includes (but is not limited to) HTML pages and views, CSS files and images.

Exceptions include the `config` and `less` directories, and all of the `.js` files. The following sections explain how the exceptions are built into the UI.

####JavaScript
All JavaScript files located in the `master/components/<component>/js` are concatenated together with the rest of the UI's JavaScript and written to `app/assets/js/app.js`. In the production build, they are also uglified.

####Configuration

Similar to the [application wide configuration](../../README.md#configuration), components can define environment specific configuration. The gulp task creates the constant `ENV` under the `kubernetesApp.config` module, which is an object with a property for the root UI and each component.

For example, a configuration for the `development` environment specific to `foo_component` would be located at `master/components/foo_component/config/development.json`. Such a component would access its `development.json` configuration verbatim at `ENV.foo_component`:

```
angular.module('kubernetesApp.components.fooComponent', ['kubernetesApp.config'])
    .provider('foo', ...)
    .config(['fooProvider', 'ENV', function(fooProvider, ENV) {
      // Configure fooProvider using ENV['foo_component'].
    });
```

####Less

Like JavaScript, the component's Less files are built into one monolithic CSS file. All top-level Less files located at `master/components/<component>/less/*.less` are imported into the main UI's Less file. The result is then copied to `app/assets/css/app.css`. In the production build, it is also minified.

Sub-directories of this path are watched for changes, but not directly imported. This is useful for defining common colors, mixins and other functions or variables used by the top-level Less files.

###Appendix

####Manifest schema

```
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "description": {
      "type": "string",
      "description": "Very brief summary of the component. Use a README.md file for detailed descriptions."
    },
    "routes": {
      "type": "array",
      "description": "Angular routes for the component.",
      "items": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string",
            "description": "Short description of the route."
          },
          "url": {
            "type": "string",
            "description": "Route location relative to '/<component>'."
          },
          "templateUrl": {
            "type": "string",
            "description": "Absolute location of the HTML template."
          },
          "css": {
            "type": "string",
            "description": "Absolute location of CSS to use with this route."
          }
        },
        "required": ["url", "templateUrl"]
      },
      "minItems": 1
    }
  },
  "required": ["routes"]
}
```

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/www/master/components/README.md?pixel)]()

repository: tnm/kubernetes

gha_language: Go

repo_name: tnm/kubernetes


text:
---
subcategory: "Security"
---

# databricks_permissions Resource

This resource allows you to generically manage [access control](https://docs.databricks.com/security/access-control/index.html) in Databricks workspace. It would guarantee that only _admins_, _authenticated principal_ and those declared within `access_control` blocks would have specified access. It is not possible to remove management rights from _admins_ group.

-> **Note** Configuring this resource for an object will **OVERWRITE** any existing permissions of the same type unless imported, and changes made outside of Terraform will be reset unless the changes are also reflected in the configuration.

-> **Note** It is not possible to lower permissions for `admins` or your own user anywhere from `CAN_MANAGE` level, so Databricks Terraform Provider [removes](https://github.com/databricks/terraform-provider-databricks/blob/master/access/resource_permissions.go#L261-L271) those `access_control` blocks automatically.

-> **Note** If multiple permission levels are specified for an identity (e.g. `CAN_RESTART` and `CAN_MANAGE` for a cluster), only the highest level permission is returned and will cause permanent drift.

## Cluster usage

It's possible to separate [cluster access control](https://docs.databricks.com/security/access-control/cluster-acl.html) to three different permission levels: `CAN_ATTACH_TO`, `CAN_RESTART` and `CAN_MANAGE`:

```hcl
resource "databricks_group" "auto" {
  display_name = "Automation"
}

resource "databricks_group" "eng" {
  display_name = "Engineering"
}

resource "databricks_group" "ds" {
  display_name = "Data Science"
}

data "databricks_spark_version" "latest" {}

data "databricks_node_type" "smallest" {
  local_disk = true
}

resource "databricks_cluster" "shared_autoscaling" {
  cluster_name            = "Shared Autoscaling"
  spark_version           = data.databricks_spark_version.latest.id
  node_type_id            = data.databricks_node_type.smallest.id
  autotermination_minutes = 60
  autoscale {
    min_workers = 1
    max_workers = 10
  }
}

resource "databricks_permissions" "cluster_usage" {
  cluster_id = databricks_cluster.shared_autoscaling.id

  access_control {
    group_name       = databricks_group.auto.display_name
    permission_level = "CAN_ATTACH_TO"
  }

  access_control {
    group_name       = databricks_group.eng.display_name
    permission_level = "CAN_RESTART"
  }

  access_control {
    group_name       = databricks_group.ds.display_name
    permission_level = "CAN_MANAGE"
  }
}
```

## Cluster Policy usage

Cluster policies allow creation of [clusters](cluster.md), that match [given policy](https://docs.databricks.com/administration-guide/clusters/policies.html). It's possible to assign `CAN_USE` permission to users and groups:

```hcl
resource "databricks_group" "ds" {
  display_name = "Data Science"
}

resource "databricks_group" "eng" {
  display_name = "Engineering"
}

resource "databricks_cluster_policy" "something_simple" {
  name = "Some simple policy"
  definition = jsonencode({
    "spark_conf.spark.hadoop.javax.jdo.option.ConnectionURL" : {
      "type" : "forbidden"
    },
    "spark_conf.spark.secondkey" : {
      "type" : "forbidden"
    }
  })
}

resource "databricks_permissions" "policy_usage" {
  cluster_policy_id = databricks_cluster_policy.something_simple.id

  access_control {
    group_name       = databricks_group.ds.display_name
    permission_level = "CAN_USE"
  }

  access_control {
    group_name       = databricks_group.eng.display_name
    permission_level = "CAN_USE"
  }
}
```

## Instance Pool usage

[Instance Pools](instance_pool.md) access control [allows to](https://docs.databricks.com/security/access-control/pool-acl.html) assign `CAN_ATTACH_TO` and `CAN_MANAGE` permissions to users, service principals, and groups. It's also possible to grant creation of Instance Pools to individual [groups](group.md#allow_instance_pool_create) and [users](user.md#allow_instance_pool_create), [service principals](service_principal.md#allow_instance_pool_create).

```hcl
resource "databricks_group" "auto" {
  display_name = "Automation"
}

resource "databricks_group" "eng" {
  display_name = "Engineering"
}

data "databricks_node_type" "smallest" {
  local_disk = true
}

resource "databricks_instance_pool" "this" {
  instance_pool_name                    = "Reserved Instances"
  idle_instance_autotermination_minutes = 60
  node_type_id                          = data.databricks_node_type.smallest.id
  min_idle_instances                    = 0
  max_capacity                          = 10
}

resource "databricks_permissions" "pool_usage" {
  instance_pool_id = databricks_instance_pool.this.id

  access_control {
    group_name       = databricks_group.auto.display_name
    permission_level = "CAN_ATTACH_TO"
  }

  access_control {
    group_name       = databricks_group.eng.display_name
    permission_level = "CAN_MANAGE"
  }
}
```

## Job usage

There are four assignable [permission levels](https://docs.databricks.com/security/access-control/jobs-acl.html#job-permissions) for [databricks_job](job.md): `CAN_VIEW`, `CAN_MANAGE_RUN`, `IS_OWNER`, and `CAN_MANAGE`. Admins are granted the `CAN_MANAGE` permission by default, and they can assign that permission to non-admin users, and service principals.

- The creator of a job has `IS_OWNER` permission. Destroying `databricks_permissions` resource for a job would revert ownership to the creator.
- A job must have exactly one owner. If a resource is changed and no owner is specified, the currently authenticated principal would become the new owner of the job. Nothing would change, per se, if the job was created through Terraform.
- A job cannot have a group as an owner.
- Jobs triggered through _Run Now_ assume the permissions of the job owner and not the user, and service principal who issued Run Now.
- Read [main documentation](https://docs.databricks.com/security/access-control/jobs-acl.html) for additional detail.

```hcl
resource "databricks_group" "auto" {
  display_name = "Automation"
}

resource "databricks_group" "eng" {
  display_name = "Engineering"
}

resource "databricks_service_principal" "aws_principal" {
  display_name = "main"
}

data "databricks_spark_version" "latest" {}

data "databricks_node_type" "smallest" {
  local_disk = true
}

resource "databricks_job" "this" {
  name                = "Featurization"
  max_concurrent_runs = 1

  new_cluster {
    num_workers   = 300
    spark_version = data.databricks_spark_version.latest.id
    node_type_id  = data.databricks_node_type.smallest.id
  }

  notebook_task {
    notebook_path = "/Production/MakeFeatures"
  }
}

resource "databricks_permissions" "job_usage" {
  job_id = databricks_job.this.id

  access_control {
    group_name       = "users"
    permission_level = "CAN_VIEW"
  }

  access_control {
    group_name       = databricks_group.auto.display_name
    permission_level = "CAN_MANAGE_RUN"
  }

  access_control {
    group_name       = databricks_group.eng.display_name
    permission_level = "CAN_MANAGE"
  }

  access_control {
    service_principal_name = databricks_service_principal.aws_principal.application_id
    permission_level       = "IS_OWNER"
  }
}
```

## Delta Live Tables usage

There are four assignable [permission levels](https://docs.databricks.com/security/access-control/dlt-acl.html#delta-live-tables-permissions) for [databricks_pipeline](pipeline.md): `CAN_VIEW`, `CAN_RUN`, `CAN_MANAGE`, and `IS_OWNER`. Admins are granted the `CAN_MANAGE` permission by default, and they can assign that permission to non-admin users, and service principals.

- The creator of a DLT Pipeline has `IS_OWNER` permission. Destroying `databricks_permissions` resource for a pipeline would revert ownership to the creator.
- A DLT pipeline must have exactly one owner. If a resource is changed and no owner is specified, the currently authenticated principal would become the new owner of the pipeline. Nothing would change, per se, if the pipeline was created through Terraform.
- A DLT pipeline cannot have a group as an owner.
- DLT Pipelines triggered through _Start_ assume the permissions of the pipeline owner and not the user, and service principal who issued Run Now.
- Read [main documentation](https://docs.databricks.com/security/access-control/dlt-acl.html) for additional detail.

```hcl
resource "databricks_group" "eng" {
  display_name = "Engineering"
}

resource "databricks_notebook" "dlt_demo" {
  content_base64 = base64encode(<<-EOT
    import dlt
    json_path = "/databricks-datasets/wikipedia-datasets/data-001/clickstream/raw-uncompressed-json/2015_2_clickstream.json"
    @dlt.table(
       comment="The raw wikipedia clickstream dataset, ingested from /databricks-datasets."
    )
    def clickstream_raw():
        return (spark.read.format("json").load(json_path))
    EOT
  )
  language = "PYTHON"
  path     = "${data.databricks_current_user.me.home}/DLT_Demo"
}

resource "databricks_pipeline" "this" {
  name    = "DLT Demo Pipeline (${data.databricks_current_user.me.alphanumeric})"
  storage = "/test/tf-pipeline"
  configuration = {
    key1 = "value1"
    key2 = "value2"
  }

  library {
    notebook {
      path = databricks_notebook.dlt_demo.id
    }
  }

  continuous = false
  filters {
    include = ["com.databricks.include"]
    exclude = ["com.databricks.exclude"]
  }
}

resource "databricks_permissions" "dlt_usage" {
  pipeline_id = databricks_pipeline.this.id

  access_control {
    group_name       = "users"
    permission_level = "CAN_VIEW"
  }

  access_control {
    group_name       = databricks_group.eng.display_name
    permission_level = "CAN_MANAGE"
  }
}
```

## Notebook usage

Valid [permission levels](https://docs.databricks.com/security/access-control/workspace-acl.html#notebook-permissions) for [databricks_notebook](notebook.md) are: `CAN_READ`, `CAN_RUN`, `CAN_EDIT`, and `CAN_MANAGE`.

```hcl
resource "databricks_group" "auto" {
  display_name = "Automation"
}

resource "databricks_group" "eng" {
  display_name = "Engineering"
}

resource "databricks_notebook" "this" {
  content_base64 = base64encode("# Welcome to your Python notebook")
  path           = "/Production/ETL/Features"
  language       = "PYTHON"
}

resource "databricks_permissions" "notebook_usage" {
  notebook_path = databricks_notebook.this.path

  access_control {
    group_name       = "users"
    permission_level = "CAN_READ"
  }

  access_control {
    group_name       = databricks_group.auto.display_name
    permission_level = "CAN_RUN"
  }

  access_control {
    group_name       = databricks_group.eng.display_name
    permission_level = "CAN_EDIT"
  }
}
```

## Folder usage

Valid [permission levels](https://docs.databricks.com/security/access-control/workspace-acl.html#folder-permissions) for folders of [databricks_directory](directory.md) are: `CAN_READ`, `CAN_RUN`, `CAN_EDIT`, and `CAN_MANAGE`. Notebooks and experiments in a folder inherit all permissions settings of that folder. For example, a user (or service principal) that has `CAN_RUN` permission on a folder has `CAN_RUN` permission on the notebooks in that folder.

- All users can list items in the folder without any permissions.
- All users (or service principals) have `CAN_MANAGE` permission for items in the Workspace > Shared Icon Shared folder. You can grant `CAN_MANAGE` permission to notebooks and folders by moving them to the Shared Icon Shared folder.
- All users (or service principals) have `CAN_MANAGE` permission for objects the user creates.
- User home directory - The user (or service principal) has `CAN_MANAGE` permission. All other users (or service principals) can list their directories.

```hcl
resource "databricks_group" "auto" {
  display_name = "Automation"
}

resource "databricks_group" "eng" {
  display_name = "Engineering"
}

resource "databricks_directory" "this" {
  path = "/Production/ETL"
}

resource "databricks_permissions" "folder_usage" {
  directory_path = databricks_directory.this.path
  depends_on     = [databricks_directory.this]

  access_control {
    group_name       = "users"
    permission_level = "CAN_READ"
  }

  access_control {
    group_name       = databricks_group.auto.display_name
    permission_level = "CAN_RUN"
  }

  access_control {
    group_name       = databricks_group.eng.display_name
    permission_level = "CAN_EDIT"
  }
}
```

## Repos usage

Valid [permission levels](https://docs.databricks.com/security/access-control/workspace-acl.html) for [databricks_repo](repo.md) are: `CAN_READ`, `CAN_RUN`, `CAN_EDIT`, and `CAN_MANAGE`.

```hcl
resource "databricks_group" "auto" {
  display_name = "Automation"
}

resource "databricks_group" "eng" {
  display_name = "Engineering"
}

resource "databricks_repo" "this" {
  url = "https://github.com/user/demo.git"
}

resource "databricks_permissions" "repo_usage" {
  repo_id = databricks_repo.this.id

  access_control {
    group_name       = "users"
    permission_level = "CAN_READ"
  }

  access_control {
    group_name       = databricks_group.auto.display_name
    permission_level = "CAN_RUN"
  }

  access_control {
    group_name       = databricks_group.eng.display_name
    permission_level = "CAN_EDIT"
  }
}
```

## MLflow Experiment usage

Valid [permission levels](https://docs.databricks.com/security/access-control/workspace-acl.html#mlflow-experiment-permissions-1) for [databricks_mlflow_experiment](mlflow_experiment.md) are: `CAN_READ`, `CAN_EDIT`, and `CAN_MANAGE`.

```hcl
data "databricks_current_user" "me" {}

resource "databricks_mlflow_experiment" "this" {
  name              = "${data.databricks_current_user.me.home}/Sample"
  artifact_location = "dbfs:/tmp/my-experiment"
  description       = "My MLflow experiment description"
}

resource "databricks_group" "auto" {
  display_name = "Automation"
}

resource "databricks_group" "eng" {
  display_name = "Engineering"
}

resource "databricks_permissions" "experiment_usage" {
  experiment_id = databricks_mlflow_experiment.this.id

  access_control {
    group_name       = "users"
    permission_level = "CAN_READ"
  }

  access_control {
    group_name       = databricks_group.auto.display_name
    permission_level = "CAN_MANAGE"
  }

  access_control {
    group_name       = databricks_group.eng.display_name
    permission_level = "CAN_EDIT"
  }
}
```

## MLflow Model usage

Valid [permission levels](https://docs.databricks.com/security/access-control/workspace-acl.html#mlflow-model-permissions-1) for [databricks_mlflow_model](mlflow_model.md) are: `CAN_READ`, `CAN_EDIT`, `CAN_MANAGE_STAGING_VERSIONS`, `CAN_MANAGE_PRODUCTION_VERSIONS`, and `CAN_MANAGE`. You can also manage permissions for all MLflow models by `registered_model_id = "root"`.

```hcl
resource "databricks_mlflow_model" "this" {
  name = "SomePredictions"
}

resource "databricks_group" "auto" {
  display_name = "Automation"
}

resource "databricks_group" "eng" {
  display_name = "Engineering"
}

resource "databricks_permissions" "model_usage" {
  registered_model_id = databricks_mlflow_model.this.registered_model_id

  access_control {
    group_name       = "users"
    permission_level = "CAN_READ"
  }

  access_control {
    group_name       = databricks_group.auto.display_name
    permission_level = "CAN_MANAGE_PRODUCTION_VERSIONS"
  }

  access_control {
    group_name       = databricks_group.eng.display_name
    permission_level = "CAN_MANAGE_STAGING_VERSIONS"
  }
}
```

## Passwords usage

By default on AWS deployments, all admin users can sign in to Databricks using either SSO or their username and password, and all API users can authenticate to the Databricks REST APIs using their username and password. As an admin, you [can limit](https://docs.databricks.com/administration-guide/users-groups/single-sign-on/index.html#optional-configure-password-access-control) admin users’ and API users’ ability to authenticate with their username and password by configuring `CAN_USE` permissions using password access control.

```hcl
resource "databricks_group" "guests" {
  display_name = "Guest Users"
}

resource "databricks_permissions" "password_usage" {
  authorization = "passwords"

  access_control {
    group_name       = databricks_group.guests.display_name
    permission_level = "CAN_USE"
  }
}
```

## Token usage

It is required to have at least 1 personal access token in the workspace before you can manage tokens permissions.

!> **Warning** There can be only one `authorization = "tokens"` permissions resource per workspace, otherwise there'll be a permanent configuration drift. After applying changes, users who previously had either `CAN_USE` or `CAN_MANAGE` permission but no longer have either permission have their access to token-based authentication revoked. Their active tokens are immediately deleted (revoked).

Only [possible permission](https://docs.databricks.com/administration-guide/access-control/tokens.html) to assign to non-admin group is `CAN_USE`, where _admins_ `CAN_MANAGE` all tokens:

```hcl
resource "databricks_group" "auto" {
  display_name = "Automation"
}

resource "databricks_group" "eng" {
  display_name = "Engineering"
}

resource "databricks_permissions" "token_usage" {
  authorization = "tokens"

  access_control {
    group_name       = databricks_group.auto.display_name
    permission_level = "CAN_USE"
  }

  access_control {
    group_name       = databricks_group.eng.display_name
    permission_level = "CAN_USE"
  }
}
```

## SQL warehouse usage

[SQL warehouses](https://docs.databricks.com/sql/user/security/access-control/sql-endpoint-acl.html) have two possible permissions: `CAN_USE` and `CAN_MANAGE`:

```hcl
data "databricks_current_user" "me" {}

resource "databricks_group" "auto" {
  display_name = "Automation"
}

resource "databricks_group" "eng" {
  display_name = "Engineering"
}

resource "databricks_sql_endpoint" "this" {
  name             = "Endpoint of ${data.databricks_current_user.me.alphanumeric}"
  cluster_size     = "Small"
  max_num_clusters = 1

  tags {
    custom_tags {
      key   = "City"
      value = "Amsterdam"
    }
  }
}

resource "databricks_permissions" "endpoint_usage" {
  sql_endpoint_id = databricks_sql_endpoint.this.id

  access_control {
    group_name       = databricks_group.auto.display_name
    permission_level = "CAN_USE"
  }

  access_control {
    group_name       = databricks_group.eng.display_name
    permission_level = "CAN_MANAGE"
  }
}
```

## SQL Dashboard usage

[SQL dashboards](https://docs.databricks.com/sql/user/security/access-control/dashboard-acl.html) have three possible permissions: `CAN_VIEW`, `CAN_RUN` and `CAN_MANAGE`:

```hcl
resource "databricks_group" "auto" {
  display_name = "Automation"
}

resource "databricks_group" "eng" {
  display_name = "Engineering"
}

resource "databricks_permissions" "endpoint_usage" {
  sql_dashboard_id = "3244325"

  access_control {
    group_name       = databricks_group.auto.display_name
    permission_level = "CAN_RUN"
  }

  access_control {
    group_name       = databricks_group.eng.display_name
    permission_level = "CAN_MANAGE"
  }
}
```

## SQL Query usage

[SQL queries](https://docs.databricks.com/sql/user/security/access-control/query-acl.html) have three possible permissions: `CAN_VIEW`, `CAN_RUN` and `CAN_MANAGE`:

-> **Note** If you do not define an `access_control` block granting `CAN_MANAGE` explictly for the user calling this provider, Databricks Terraform Provider will add `CAN_MANAGE` permission for the caller. This is a failsafe to prevent situations where the caller is locked out from making changes to the targeted `databricks_sql_query` resource when backend API do not apply permission inheritance correctly.

```hcl
resource "databricks_group" "auto" {
  display_name = "Automation"
}

resource "databricks_group" "eng" {
  display_name = "Engineering"
}

resource "databricks_permissions" "endpoint_usage" {
  sql_query_id = "3244325"

  access_control {
    group_name       = databricks_group.auto.display_name
    permission_level = "CAN_RUN"
  }

  access_control {
    group_name       = databricks_group.eng.display_name
    permission_level = "CAN_MANAGE"
  }
}
```

## SQL Alert usage

[SQL alerts](https://docs.databricks.com/sql/user/security/access-control/alert-acl.html) have three possible permissions: `CAN_VIEW`, `CAN_RUN` and `CAN_MANAGE`:

```hcl
resource "databricks_group" "auto" {
  display_name = "Automation"
}

resource "databricks_group" "eng" {
  display_name = "Engineering"
}

resource "databricks_permissions" "endpoint_usage" {
  sql_alert_id = "3244325"

  access_control {
    group_name       = databricks_group.auto.display_name
    permission_level = "CAN_RUN"
  }

  access_control {
    group_name       = databricks_group.eng.display_name
    permission_level = "CAN_MANAGE"
  }
}
```

## Instance Profiles

[Instance Profiles](instance_profile.md) are not managed by General Permissions API and therefore [databricks_group_instance_profile](group_instance_profile.md) and [databricks_user_instance_profile](user_instance_profile.md) should be used to allow usage of specific AWS EC2 IAM roles to users or groups.

## Secrets

One can control access to [databricks_secret](secret.md) through `initial_manage_principal` argument on [databricks_secret_scope](secret_scope.md) or [databricks_secret_acl](secret_acl.md), so that users (or service principals) can `READ`, `WRITE` or `MANAGE` entries within secret scope.

## Tables, Views and Databases

General Permissions API does not apply to access control for tables and they have to be managed separately using the [databricks_sql_permissions](sql_permissions.md) resource, though you're encouraged to use Unity Catalog or migrate to it.

## Data Access with Unity Catalog

Initially in Unity Catalog all users have no access to data, which has to be later assigned through [databricks_grants](grants.md) resource.

## Argument Reference

One type argument and at least one access control block argument are required.

### Type Argument

Exactly one of the following arguments is required:

- `cluster_id` - [cluster](cluster.md) id
- `cluster_policy_id` - [cluster policy](cluster_policy.md) id
- `instance_pool_id` - [instance pool](instance_pool.md) id
- `job_id` - [job](job.md) id
- `pipeline_id` - [pipeline](pipeline.md) id
- `notebook_id` - ID of [notebook](notebook.md) within workspace
- `notebook_path` - path of notebook
- `directory_id` - [directory](notebook.md) id
- `directory_path` - path of directory
- `repo_id` - [repo](repo.md) id
- `repo_path` - path of databricks repo directory(`/Repos/<username>/...`)
- `experiment_id` - [MLflow experiment](mlflow_experiment.md) id
- `registered_model_id` - [MLflow registered model](mlflow_model.md) id
- `authorization` - either [`tokens`](https://docs.databricks.com/administration-guide/access-control/tokens.html) or [`passwords`](https://docs.databricks.com/administration-guide/users-groups/single-sign-on/index.html#configure-password-permission).
- `sql_endpoint_id` - [SQL warehouse](sql_endpoint.md) id
- `sql_dashboard_id` - [SQL dashboard](sql_dashboard.md) id
- `sql_query_id` - [SQL query](sql_query.md) id
- `sql_alert_id` - [SQL alert](https://docs.databricks.com/sql/user/security/access-control/alert-acl.html) id

### Access Control Argument

One or more `access_control` blocks are required to actually set the permission levels:

```hcl
access_control {
  group_name       = databricks_group.datascience.display_name
  permission_level = "CAN_USE"
}
```

Arguments for the `access_control` block are:

-> **Note** It is not possible to lower permissions for `admins` or your own user anywhere from `CAN_MANAGE` level, so Databricks Terraform Provider [removes](https://github.com/databricks/terraform-provider-databricks/blob/master/access/resource_permissions.go#L261-L271) those `access_control` blocks automatically.

- `permission_level` - (Required) permission level according to specific resource. See examples above for the reference.

Exactly one of the below arguments is required:

- `user_name` - (Optional) name of the [user](user.md).
- `service_principal_name` - (Optional) Application ID of the [service_principal](service_principal.md#application_id).
- `group_name` - (Optional) name of the [group](group.md). We recommend setting permissions on groups.

## Attribute Reference

In addition to all arguments above, the following attributes are exported:

- `id` - Canonical unique identifier for the permissions.
- `object_type` - type of permissions.

## Import

The resource permissions can be imported using the object id

```bash
terraform import databricks_permissions.this /<object type>/<object id>
```

### Import Example

Configuration file:

```hcl
resource "databricks_mlflow_model" "model" {
  name        = "example_model"
  description = "MLflow registered model"
}

resource "databricks_permissions" "model_usage" {
  registered_model_id = databricks_mlflow_model.model.registered_model_id

  access_control {
    group_name       = "users"
    permission_level = "CAN_READ"
  }
}
```

Import command:

```bash
terraform import databricks_permissions.model_usage /registered-models/<registered_model_id>
```

repository: jxbell/terraform-provider-databricks

repo_name: jxbell/terraform-provider-databricks


text:
# Chrome extension: WoW Auction Helper

A chrome extension that extends the wow web auction interface with convenience functionality.

## Features

- Adds a button to the UI which undercut the competition of a particular item with 10 silver bid and 5 silver buyout. Clicking the button will fill in the input fields with the undercut amount, shift+clicking the button will create the auction directly.

## Requirements

[Chrome Web Browser](www.google.com/chrome/)

## Installation

1. In your browser navigate to `chrome://extensions`
2. Click the checkbox `Developer mode`
3. Click the button `Load unpacked extension...`
4. Choose the repository directory in the dialog
5. The extension should now be installed. If you have the auction page open in another tab, refresh that now.

repository: jakobmulvad/auction-helper

repo_name: jakobmulvad/auction-helper


text:
---
layout: post
title: Queuing on EC2 with core.async
summary: Asynchronous queueing and consumption of SQS messages with Clojure.
author: Moe Aboulkheir
categories: clojure aws async sqs messaging
tags: clojure aws async sqs messaging
---

## Background

Last week we  [began talking about
Iris](/clojure/iris/messaging/2015/06/03/iris-clojure-part-one/) as a means
of transmitting mostly empty maps nerve impulses between
our two webservers subsystems of the beneficent and rapidly
tumefying superintelligence we're all collaborating on.

Looking inside our creation, observing the traffic which holds it together, we
see that not all messages are similarly disposed.  Some mope in narrowing
circles.  Others flit with vitality and ambition, mocking our attempts to
confine them.

Outside, stories of The Work spread.  Phones and wristwatches whir at the
promise of deciding even a single, imperceptible pixel in the corner of its
daydreams.

## Technology

This post will focus on using Amazon's queuing service, SQS, in conjunction with
Clojure & [core.async](https://github.com/clojure/core.async).  It will be
shortly followed by less interesting post covering SNS.

### [SQS](http://aws.amazon.com/sqs/)

Named after a minor Greek god, SQS is an Amazon-hosted queue service, with no
ordering guarantees and explicit receipt confirmation.  It allows delivery of
messages across EC2 regions, as well as between AWS accounts.  The receive API
is based on HTTP long-polling, a detail we'll abstract with channels.

### [Fink-Nottle](https://github.com/nervous-systems/fink-nottle)

Fink-Nottle is a Clojure library which tries to expose all of the features of
SQS (and its cousin, [SNS](http://aws.amazon.com/sns/)) via a consistent,
asynchronous API.  It's built on top of
[Eulalie](https://github.com/nervous-systems/eulalie), an
[httpkit](http://www.http-kit.org/)-based AWS client library.

As a name, _Fink-Nottle_ primarily exudes Saturn energy, and so resonates
harmoniously with the malefic half-planet Ketu, which governs SQS.  The
reluctant and repressed Moon energy of SNS will be harder work.

## Examples

Through a series of narrated excerpts, we're going to make it as easy as
possible to get started.  There's a small [Github
repository](https://github.com/nervous-systems/fink-nottle-demo) containing a
runnable version of this code.

All of the functions we'll be talking about accept (at least) an AWS credentials
map (`:secret-key`, `:access-key`, optionally `:region`, `:token`) and return
asynchronous channels to which one or more result values will be written.
Synchronous versions of all of the SQS API-level functions are available.

### Creating Queues

SQS queues are created by passing symbolic names to `create-queue!`, which
returns a channel populated with the queue's URL.

```clojure
(sqs/create-queue! creds "fink-nottle-tasks-demo")
```

That's more or less the last you'll hear of this name - the SQS API almost
exlusively refers to existing queues by URL, with the exception of embedded
policy documents, and so on, which use ARNs (_Amazon Resource Names_).

Entity creation in SQS (and SNS) is generally idempotent - as long as you're
consistent (i.e. in terms of configuration), you can repeatedly use the creation
API without getting different URL/ARN values.  It's probably best to not count
on this feature in serious code, though.

### Simple Send/Receive

```clojure
(ns fink-nottle-demo.sqs
  (:require [fink-nottle.sqs :as sqs]
            [fink-nottle.sqs.channeled :as sqs.channeled]
            ...))

(defn receive-loop! [creds queue-url]
  (let [messages (sqs.channeled/receive! creds queue-url)]
    (go
      (loop []
        (let [{:keys [body attrs] :as message} (<! messages)]
          ;; Maybe do something with the message
          (recur))))))
```

N.B.  For the sake of simplicity, the code samples
may not explicitly deal with errors.  In the sample above, the take from the
messages channel could yield an exception.

`sqs.channeled/receive!` is giving us a channel which it'll populate with map representations
of messages consumed from the given queue.  By default, these will be received
from SQS up to 10 at a time (the maximum per request), with each request parking
for up to 20 seconds if no messages are available.

The most interesting components of the message map are `:body` (a string, as far
as SQS is concerned - more of which below) and `:attrs`, a map of message
attributes with types of either string, number, or binary (byte array).

```clojure
(defn send-loop! [creds queue-url]
  (go
    (loop [i 0]
      (<! (sqs/send-message!
           creds queue-url {:body "Hello" :attrs {:i i}})
      (<! (async/timeout 1000))
      (recur (inc i)))))
```

Super vanilla.  We're sending a string body, a single number attribute, and
waiting a second in between sends.

### Deletion

If the two examples above were running concurrently, we'd eventually see some
strange behaviour in `receive-loop!`.  As none of the incoming messages are being
actively deleted, after an interval (which defaults to 30 seconds), SQS will
attempt redelivery to the same queue.

```clojure
(<! (sqs/processed! creds message))
```

Placing the above call in the receive loop would prevent this behaviour.  There
is a lower-level function, `sqs/delete-message!` which accepts `:receipt-handle`
from within the message map, but they're doing exactly the same thing.

### Structured Messages

Fink-Nottle provides a very simple means of applying functions to message bodies
at send & receive time, conditioned by a tag in the message map.  Here's an
example of something we could do with it:

```clojure
(defmethod sqs.tagged/message-in  :edn [_ body]
  (clojure.edn/read-string body))
(defmethod sqs.tagged/message-out :edn [_ body] (pr-str body))

(sqs/send-message!
 creds queue-url
 {:body {:event :increment :value i}
  :fink-nottle/tag :edn})
```

Messages received within reach of the above `message-in` definition will be read
as Clojure data structures.

### Batching Writes

As SQS is billed per-request1, we probably ought to use the batch
sending API, which allows up to 10 messages at a time to be sent for the price
of one.  Fink-Nottle makes this pretty easy:

```clojure
(let [{:keys [in-chan error-chan]}
      (sqs.channeled/batching-sends creds queue-url)]
  (>! in-chan {:body {:event :increment :value i}
               :fink-nottle/tag :edn}))
  ;; ...

```

When occurring within a configurable window, writes on the `in-chan` received
from `batching-channel` will be grouped together before being sent to SQS.  With
the default behaviour, if any of the sends results in an error, subsequent
writes will park until `error-chan` has been consumed.

We can get identical behaviour for deletes by using
`sqs.channeled/batching-deletes`.

1 The first million per month are free.

### Combining The Above Features

```clojure
(defn send-loop! [creds queue-url]
  (let [{:keys [in-chan]}
        (channeled/batching-sends creds queue-url)]
    (go
      (loop [i 0]
        (>! in-chan {:body {:event :increment :value i}
                     :fink-nottle/tag :edn})
        (<! (async/timeout (rand-int 300)))
        (recur (inc i))))))

(defn receive-loop! [id creds queue-url]
  (let [messages (channeled/receive! creds queue-url)
        {deletes :in-chan}
        (channeled/batching-deletes creds queue-url)]
    (go
      (loop []
        (let [{:keys [body attrs] :as message} (<! messages)]
          ;; ...
          (>! deletes message)
          (recur))))))
```

### Bonus Round: Dead Letter Queues

We can ask SQS to remove messages from a given queue and place them on another
when some unsucessful delivery threshold is reached (i.e. if a message has been
returned N times from a `receive-message` call without being deleted).

To add this feature to an existing queue, we'd do something like:

```clojure
(sqs/set-queue-attribute!
 creds queue-url
 :redrive-policy
 {:max-receive-count 2
  :dead-letter-target-arn dead-letter-queue-arn})
```

The ARN for a queue is obtained with `sqs/queue-arn!`

## Closing

SQS/Fink-Nottle support additional features not covered in this post - queue
purging, fine-grained permissions, manipulation of visibility
per message, etc.

In the follow-up on the SNS portion of Fink-Nottle, we'll try to cover pushing
of messages to SQS queues, as well as to mobile devices.

repository: nervous-systems/pixyll

repo_name: nervous-systems/pixyll


text:
# Changelog

## [v0.0.2](https://github.com/ErnWong/dotfiles/tree/v0.0.2) (2021-12-11)

**Fixed bugs:**

- Fix credentials story for gh [\#16](https://github.com/ErnWong/dotfiles/issues/16)

## [v0.0.1](https://github.com/ErnWong/dotfiles/tree/v0.0.1) (2021-12-05)

**Implemented enhancements:**

- Improve display resolution on virtual machines [\#4](https://github.com/ErnWong/dotfiles/issues/4)
- Better monospaced font support [\#3](https://github.com/ErnWong/dotfiles/issues/3)

\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*

repository: ErnWong/dotfiles

repo_name: ErnWong/dotfiles


text:
---
layout: default
---

# 1993-07-08 - Re: text p.d. cryptosystems for email

## Header Data

From<EMAIL_ADDRESS>(Ed Carp)

To<EMAIL_ADDRESS>Message Hash: 816eb501f5c5a8386177be0c3729ec029f658ae6de56dcdf3a24eb8cef279de1

Message ID: \<m0oE0L4-00026eC@warrior\>

Reply To<EMAIL_ADDRESS>UTC Datetime: 1993-07-08 18:14:05 UTC

Raw Date: Thu, 8 Jul 93 11:14:05 PDT

## Raw message

```
{% raw  %}From<EMAIL_ADDRESS>(Ed Carp)
Date: Thu, 8 Jul 93 11:14:05 PDT
To<EMAIL_ADDRESS>Subject: Re: text p.d. cryptosystems for email
In-Reply-To<EMAIL_ADDRESS>Message-ID: <m0oE0L4-00026eC@warrior>
MIME-Version: 1.0
Content-Type: text

> What you want is PGP. Doubtless someone out there is likely to tell
> you more about it...

I'd be careful with PGP - since the source code is freely available, it'd be
simplicity itself to insert one or two lines of C code to snarf away a copy
of your cleartext before encryption.  Somewhere where ye olde sysadmin could
peruse it at his/her leisure...

The only way to be sure is to get PGP off the net (from an ftp site out of
the control of your admin folks) and build it yourself.
--
Ed Carp<EMAIL_ADDRESS>	510/659-9560
   For anonymous mailers --><EMAIL_ADDRESS>"Disagreements are not meant to be challenges.  They are just a different
 reality."  -- Risa D'Angeles

{% endraw %}
```

## Thread

+ Return to [July 1993](/archive/1993/07)

+ Return to<EMAIL_ADDRESS>(Ed Carp)](/authors/khijolerc_at_apple_com_ed_carp_)"

+ _Unknown thread root_
  + 1993-07-08 (Thu, 8 Jul 93 11:14:05 PDT) - Re: text p.d. cryptosystems for email -<EMAIL_ADDRESS>(Ed Carp)_


text:
# yal10n

[![Java CI with Maven](https://github.com/adangel/yal10n/actions/workflows/maven.yml/badge.svg)](https://github.com/adangel/yal10n/actions/workflows/maven.yml)

The Yet Another Localization Maven Plugin helps in the localization process of software projects.

## Documentation

<http://yal10n.sf.net>

## Bug reports / Feature requests

Please report any bugs or feature requests at http://sourceforge.net/p/yal10n/tickets.

## Pull requests

Pull requests are welcome: https://github.com/adangel/yal10n


text:
[![Build Status](https://travis-ci.org/patbl/Skillshare.im.png?branch=master)](https://travis-ci.org/patbl/Skillshare.im)
[![Code Climate](https://codeclimate.com/github/patbl/Skillshare.im.png)](https://codeclimate.com/github/patbl/Skillshare.im)
[![Coverage Status](https://coveralls.io/repos/patbl/Skillshare.im/badge.png?branch=master)](https://coveralls.io/r/patbl/Skillshare.im?branch=master)

# Skillshare.im

Skillshare.im is a Rails app whose purpose is to make it easier for
effective altruists to help each other out by sharing their skills,
stuff, and couches with one another.

## Contributing

Check out the
[Trello board](https://trello.com/b/3ULaf1Ob/sharing-app) to see what
we're working on. If you'd like to help, e-mail me at
<EMAIL_ADDRESS>
Getting set up is invariably a bit of a headache. We can arrange a
Skype chat if it would be helpful.

gha_language: Ruby


text:
# Dashed Border Generator
A simple online tool for creating custom dashed or dotted borders. Using CSS hack, this tool can simply increase space between dots, change dash length or distance between strokes.

## How does it work? 🚀
Native CSS properties **don't support** the customization of `border-style`.
Therefore, we use a trick with an ***SVG image inside*** `background-image` property.
The SVG features give us the ability to change the distance between dashed lines, set custom pattern, add dash offset or even change a line cap.

Generated SVG image is vector and it fills width and height of elements by 100%, so it doesn't matter what size elements have.

## [View in Action](http://kovart.github.io/dashed-border-generator/)
![intro](./intro.png)

## Dependencies
* [VueJS](https://github.com/vuejs/vue)
* [Bootstrap 4](https://github.com/twbs/bootstrap)
* [vue-color](https://github.com/xiaokaike/vue-color)
* [mini-svg-data-uri](https://github.com/tigt/mini-svg-data-uri)

## License
[The MIT License](http://opensource.org/licenses/MIT)

Copyright (c) 2019-present, Artem Kovalchuk

repository: kovart/dashed-border-generator

gha_language: HTML

repo_name: kovart/dashed-border-generator


text:
## Please note this is an Arm fork with some enhancements listed below.

1. Preload trace file to memory for performance test.
2. Arm linux build with headless support.
3. Enhanced device simulation layer.
4. Some replay performance optimization.

*** The Windows build is NOT tested and may be broken.**

And it is prefered to use the script `build_vktrace.sh` to do the build.

# Vulkan Ecosystem Components

This project provides vktrace capture/replay tool, the Layer Factory, and other layer tools and driver tests.

## CI Build Status
| Platform | Build Status |
|:--------:|:------------:|
| Linux/Android | [![Build Status](https://travis-ci.org/LunarG/VulkanTools.svg?branch=master)](https://travis-ci.org/LunarG/VulkanTools) |
| Windows | [![Build status](https://ci.appveyor.com/api/projects/status/2ncmy766ufb2hnh2/branch/master?svg=true)](https://ci.appveyor.com/project/karl-lunarg/vulkantools/branch/master) |

## Introduction

Branches within this repository include the Vulkan loader, validation layers, header files, and associated tests.  These pieces are mirrored from this Github repository:
https://github.com/KhronosGroup/Vulkan-ValidationLayers
These pieces are required to enable this repository to be built standalone; that is without having to clone the Vulkan-ValidationLayers repository.

The following components are available in this repository over and above what is mirrored from Vulkan-ValidationLayers repository
- Api_dump, screenshot, device_simulation, and example layers (layersvt/)
- Starter_layer and demo_layer (layer_factory/)
- tests for the vktrace and vkreplay (tests/)
- vktrace and vkreplay, API capture and replay  (vktrace/)

## Contributing

If you intend to contribute, the preferred work flow is for you to develop your contribution
in a fork of this repo in your GitHub account and then submit a pull request.
Please see the [CONTRIBUTING](CONTRIBUTING.md) file in this repository for more details

## How to Build and Run

[BUILD.md](BUILD.md)
includes directions for building all the components, running the tests and running the demo applications.

Information on how to enable the various layers is in
[layersvt/README.md](layersvt/README.md).

## Version Tagging Scheme

Updates to the `LunarG-VulkanTools` repository which correspond to a new Vulkan specification release are tagged using the following format: `v<`_`version`_`>` (e.g., `v1.1.96`).

**Note**: Marked version releases have undergone thorough testing but do not imply the same quality level as SDK tags. SDK tags follow the `sdk-<`_`version`_`>.<`_`patch`_`>` format (e.g., `sdk-<IP_ADDRESS>`).

This scheme was adopted following the 1.1.96 Vulkan specification release.

## License
This work is released as open source under a Apache-style license from Khronos including a Khronos copyright.

See COPYRIGHT.txt for a full list of licenses used in this repository.

## Acknowledgements
While this project has been developed primarily by LunarG, Inc., there are many other
companies and individuals making this possible: Valve Corporation, funding
project development; Google providing significant contributions to the validation layers;
Khronos providing oversight and hosting of the project.

repository: ARM-software/vktrace-arm

repo_name: ARM-software/vktrace-arm


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

# Morra

The odds and evens variant of the [Morra game](https://en.wikipedia.org/wiki/Morra_(game)), written in Haskell. The purpose of this project is to learn how to use monad transformers, in this case the StateT monad transformer is used.

## Getting Started

### Prerequisites

Install [stack](https://www.haskellstack.org/):
```
curl -sSL https://get.haskellstack.org/ | sh
```

### Building and running the game

At the prject root, first run:

```
stack build
```

and then

```
stack exec morra-exe
```

## Running the tests

At the project root, run:
```
stack test
```

## License

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

repository: oskarek/morra

repo_name: oskarek/morra


text:
# Tmux cpu status

Enables displaying cpu percentage and status icon in Tmux status-right.

CPU:

`CPU: ❏ 8.7%`

This is done by introducing 2 new format strings that can be added to
`status-right` option:
- `#{cpu_icon}` - will display a cpu status icon
- `#{cpu_percentage}` - will show cpu percentage

### Usage

Add `#{cpu_icon}` or `#{cpu_percentage}` format strings to existing
`status-right` Tmux option. Example:

    # in .tmux.conf
    set -g status-right "CPU: #{cpu_icon} #{cpu_percentage} | %a %h-%d %H:%M "

### Installation with [Tmux Plugin Manager](https://github.com/tmux-plugins/tpm) (recommended)

Add plugin to the list of TPM plugins in `.tmux.conf`:

    set -g @tpm_plugins "             \
      tmux-plugins/tpm                \
      tmux-plugins/tmux-cpu           \
    "

Hit `prefix + I` to fetch the plugin and source it.

If format strings are added to `status-right`, they should now be visible.

### Manual Installation

Clone the repo:

    $ git clone https://github.com/tmux-plugins/tmux-cpu ~/clone/path

Add this line to the bottom of `.tmux.conf`:

    run-shell ~/clone/path/cpu.tmux

Reload TMUX environment:

    # type this in terminal
    $ tmux source-file ~/.tmux.conf

If format strings are added to `status-right`, they should now be visible.

### Changing icons

By default, these icons are displayed:

 - cpu: "❏"

You can change these defaults by adding the following to `.tmux.conf` (the
following lines are not in the code block so that emojis can be seen):

 - set-option -g @cpu_icon ":sunglasses:"

Don't forget to reload TMUX environment (`$ tmux source-file ~/.tmux.conf`)
after you do this.

### Limitations

- CPU change most likely won't be instant.

  It will take some time (15 - 60 seconds) for the value to change.
  This depends on the `status-interval` TMUX option.

### Other plugins

You might also find these useful:

- [battery](https://github.com/tmux-plugins/tmux-battery) - Plug and play battery percentage and icon indicator for Tmux.
- [online status](https://github.com/tmux-plugins/tmux-online-status) - online status
  indicator in Tmux `status-right`. Useful when on flaky connection to see if
  you're online.

### License

[MIT](LICENSE)

repository: dohsimpson/dotfiles

repo_name: dohsimpson/dotfiles


text:
---
id: ui_reference
name: UI Reference
title: UI Reference
tags:
    - Reference
---

# User Interface in Core

## Overview

UI in Core includes all the 2D elements that can be used to build menus, notifications, dialogue boxes, and heads up displays (HUD's). Creating UI Elements is mostly a drag-and-drop process, where any UI element can be added to the scene with ease.

## UI Elements

### Control

A **Control** (UIControl) is a **CoreObject** which serves as a base class for other Controls. All UI classes include the properties within a Control such as the position and size properties.

More information can be found in the [UIControl API](../api/uicontrol.md)

### Container

All other UI elements must be a descendant of a **Container** (UIContainer) to be visible. It does not have a position or size. It is always the size of the entire screen. It has no properties or functions of its own, but inherits everything from CoreObject.

More information can be found in the [UIContainer API](../api/uicontainer.md)

#### Container Types

Containers have a **Content Type** which allow creators to specify the way the UI works and optimize performance. By default, Containers will have the **Dynamic** type, but can be made more performant by changing their type to **Static** in instances where they do not need to move.

##### UI Type Definitions

- **Static**: Used for any UI that does not need to move.
- **Dynamic**: Used for any UI that will move.
- **Texture**: For extremely complex UI with many elements to be rendered as a single texture, like Minimap UI.

!!! warning "Texture Content Type"
    The **Texture** Content Type has greater cost than the other UI Container Content Types, but this cost is fixed. It is recommended to only use **one** Texture per project.

### Panel

A **Panel** (UIPanel) can be used for containing and laying out other UI elements, such as images and text. It is optional and is best used for organization.

Panels also have an **Opacity** that will be applied to all elements inside of it.

More information can be found in the [UIPanel API](../api/uipanel.md)

### Scroll Panel

A **Scroll Panel** (UIScrollPanel) is a Panel that has a scroll bar for overflowing elements.

More information can be found in the [UIScrollPanel API](../api/uiscrollpanel.md)

### Image

An **Image** (UIImage) displays a given image (found in the **Core Content** window).

More information can be found in the [UIImage API](../api/uiimage.md)

#### Change the Image in the Editor

Like Materials on static mesh objects, there are two ways to change the image being displayed; either by dragging from the **UI Textures** category of **Core Content** or by selecting from the **Properties** window, and double-clicking the icon in the **Image** property.

#### Change the Image with Script

If you have an asset reference to an image (or its MUID), you can use the `UIImage:SetImage()` function.

Images can also be manually set to show a player's profile picture by using the `UIImage:SetPlayerProfile()` function.

#### Change the Color of an Image with Script

The color of an image can be changed dynamically by using the `UIImage:SetColor()` function.

### Text

A **Text** (UIText) displays text.

More information can be found in the [UIText API](../api/uitext.md)

#### Text Fonts

![Sample of Core Fonts](../img/UI/UI_Fonts.png){: .center loading="lazy" }

#### Change the Font

Like Materials on static mesh objects, there are two ways to change the font of text; either by dragging from the **Fonts** category of **Core Content** or by selecting from the **Property Window**, and double-clicking the icon in the **Font** property.

The font can also be changed with script by using the `UIText:SetFont()` function.

#### Change the Text with Script

The content of the text (what is actually beind displayed) can be changed by setting a new value to the `UIText.text` property to a new string.

```lua
TextObject.text = "New Value"
```

#### Change the Color of Text with Script

The color of text can be changed dynamically by using the `UIText:SetColor()` function.

#### Get the Visual Size of a Text with Script

When the text is being rendered on the screen, you can get the amount of pixels that it takes up on the screen by using the `UIText:ComputeApproximateSize()` function.

### Progress Bar

A **Progress Bar** (UIProgressBar) displays a dynamically filled rectangle that can be used for things such as health indicators, loading screen, and much more.

More information can be found in the [UIProgressBar API](../api/uiprogressbar.md)

#### Change the Progress with Script

The progress is set by using a scale of `0` to `1` (meaning 50% would be `0.5`). This can be set by changing the value of `UIProgressBar.progress` to a new number in that range.

```lua
ProgressBarObject.progress = 0.6 -- 60%
```

### Button

A **Button** (UIButton) can be clicked and interacted with. This must be in a client context to function.

More information can be found in the [UIButton API](../api/uibutton.md)

#### Listening to Events

A button has several events that can be listened to that informs you if it was clicked, hovered, etc. You can listen to these by figuring out which one is needed (look at the API for reference) and connect it to a function.

An example using `UIButton.clickedEvent`

```lua
function OnButtonClicked(button)
    print(button.name, "clicked")
end

ButtonObject.clickedEvent:Connect(OnButtonClicked)
```

### Perk Purchase Button

A **Perk Purchase Button** (UIPerkPurchaseButton) is similar to a regular button but allows players to purchase perks within a game. It is designed to present a consistent purchasing experience for players across all games.

More information can be found in the [UIPerkPurchaseButton API](../api/uiperkpurchasebutton.md)

## Toggling UI With a Trigger

There may be situations you want to show **UI** when a player enters a certain area in the map. This can be done by utilizing **Triggers**.

In this example, the trigger will show a **UI** that informs the player that they are in a specific zone, the "Red Zone."

![Trigger Zone](../img/UIReference/TriggerZone.png){: .center loading="lazy" }

### Create a Script

First, you need to create a script that will handle this implementation.

1. Create a script inside the **UI** that will be toggled using the trigger. The name of the script can be anything; this tutorial will be using `ToggleOnTrigger`.

![Toggle On Trigger Script](../img/UIReference/ToggleOnTriggerScript.png){: .center loading="lazy" }

### Create Custom Properties for the UI and Trigger

Second, you need a reference to the **UI** and to the trigger so that you can implement the required trigger events that then toggle the **UI**.

1. While having the script selected in the hierarchy, in the **Properties** window, add a **CoreObjectReference** **Custom Property** to the script and name it `Interface`.
2. Drag-and-drop the **UI** from the **Hierarchy** into the **Custom Property** you just created.
3. While having the script selected in the hierarchy, in the **Properties** window, add a **CoreObjectReference** **Custom Property** to the script and name it `Trigger`.
4. Drag-and-drop the **Trigger** from the **Hierarchy** into the **Custom Property** you just created.

![Toggle On Trigger Custom Properties](../img/UIReference/ToggleOnTriggerCustomProperties.png){: .center loading="lazy" }

### Create Variable References for the UI and Trigger

Now, it is time to begin coding. First, you need to create variables that refer the the **UI** and **Trigger** **Custom Properties**.

Add this to the top of your script:

```lua
local Interface = script:GetCustomProperty("Interface"):WaitForObject()
local Trigger = script:GetCustomProperty("Trigger"):WaitForObject()
```

### Create Variable Reference to Local Player

The **UI** should only become visible if the **Local Player** (you, for instance) enters the trigger. Otherwise, if any **Player** enters or exits the trigger, the **UI** will have some very odd behaviour.

Under the **Custom Property** references, add this to the script:

```lua
local LocalPlayer = Game.GetLocalPlayer()
```

### Connect Event When a Player Enters the Trigger

It is now time to show the **UI** when a **Player** enters the **Trigger**. This is used by utilizing the `Trigger.beginOverlapEvent` event.

At the bottom of the script, add this:

```lua
function OnBeginOverlap(trigger, player)

end

Trigger.beginOverlapEvent:Connect(OnBeginOverlap)
```

### Toggle the UI On if the Local Player is Inside

Now you can check to see if the **Player** that entered the trigger is the ***Local Player**.

Inside the `OnBeginOverlap` function, add this check:

```lua
if not player:IsA("Player") or player ~= LocalPlayer then
    return
end
```

The parameter is named `player` so it is easier to understand for the developer, but it is actually an **Object**, meaning it can be a **Player** or any **CoreObject** that enters it. Therefore, this will escape early if the object entering the **Trigger** is not a **Player**. This will also escape early if the **Player** entering the **Trigger** is not the **Local Player**.

Next, add this line of code to toggle the visibility of the UI to be inherit (visible only if all the objects it is inside is also visible):

```lua
Interface.visibility = Visibility.INHERIT
```

### Connect Event When a Player Leaves the Trigger

It is now time to hide the **UI** when a **Player** exits the **Trigger**. This is used by utilizing the `Trigger.endOverlapEvent` event.

At the bottom of the script, add this:

```lua
function OnEndOverlap(trigger, player)

end

Trigger.endOverlapEvent:Connect(OnEndOverlap)
```

### Toggle the UI Off if the Local Player is Inside

Now you can check to see if the **Player** that exited the trigger is the ***Local Player**.

Inside the `OnEndOverlap` function, add this check:

```lua
if not player:IsA("Player") or player ~= LocalPlayer then
    return
end
```

Next, add this line of code to toggle the visibility of the UI to be off:

```lua
Interface.visibility = Visibility.FORCE_OFF
```

### Hide the UI

Finally, you can disable the visibility of the UI so that when the **Player** spawns in, it is off by default.

1. Click the UI in the **Hierarchy**.
2. In the **Properties** window, change the **Visibility** to **Force Off**.

![Toggle On Trigger Visibility](../img/UIReference/ToggleOnTriggerVisibility.png){: .center loading="lazy" }

### Final Code

```lua
local Interface = script:GetCustomProperty("Interface"):WaitForObject()
local Trigger = script:GetCustomProperty("Trigger"):WaitForObject()

local LocalPlayer = Game.GetLocalPlayer()

function OnBeginOverlap(trigger, player)
    if not player:IsA("Player") or player ~= LocalPlayer then
        return
    end

    Interface.visibility = Visibility.INHERIT
end

function OnEndOverlap(trigger, player)
    if not player:IsA("Player") or player ~= LocalPlayer  then
        return
    end

    Interface.visibility = Visibility.FORCE_OFF
end

Trigger.beginOverlapEvent:Connect(OnBeginOverlap)
Trigger.endOverlapEvent:Connect(OnEndOverlap)
```

## Toggling UI With a Binding

There may be situations you want to show **UI** when a player presses a certain button. This can be done by utilizing **Bindings**.

In this example, pressing ++T++ will show a **UI** that gives some quick information to the player about the game.

![Quick Information](../img/UIReference/QuickInformation.png){: .center loading="lazy" }

### Create a Script

First, you need to create a script that will handle this implementation.

1. Create a script inside the **UI** that will be toggled using the trigger. The name of the script can be anything; this tutorial will be using `ToggleOnBinding`.

![Toggle On Binding Script](../img/UIReference/ToggleOnBindingScript.png){: .center loading="lazy" }

### Create Custom Properties for the UI and Binding

Second, you need a reference to the **UI** and to the trigger so that you can implement the required trigger events that then toggle the **UI**.

1. While having the script selected in the hierarchy, in the **Properties** window, add a **CoreObjectReference** **Custom Property** to the script and name it `Interface`.
2. Drag-and-drop the **UI** from the **Hierarchy** into the **Custom Property** you just created.
3. While having the script selected in the hierarchy, in the **Properties** window, add a **String** **Custom Property** to the script and name it `Binding`.
4. Search the binding list for what binding you want to use. This example will be using ++T++, which is `ability_extra_24`.

![Toggle On Binding Custom Properties](../img/UIReference/ToggleOnBindingCustomProperties.png){: .center loading="lazy" }

### Create Variable References for the UI and Binding

Now, it is time to begin coding. First, you need to create variables that refer the the **UI** and **Binding** **Custom Properties**.

Add this to the top of your script:

```lua
local Interface = script:GetCustomProperty("Interface"):WaitForObject()

local BINDING = script:GetCustomProperty("Binding")
```

`BINDING` is in all caps to hint that it is a constant; a variable that the value is no altered.

### Create Variable Reference to Local Player

The **UI** should only become visible if the **Local Player** presses the binding.

Under or between the **Custom Property** references, add this to the script:

```lua
local LocalPlayer = Game.GetLocalPlayer()
```

### Connect Event When a Player Presses a Binding

It is now time to show the **UI** when a **Player** enters the **Trigger**. This is used by utilizing the `Player.bindingPressedEvent` event.

At the bottom of the script, add this:

```lua
function OnBindingPressed(player, binding)

end

LocalPlayer.bindingPressedEvent:Connect(OnBindingPressed)
```

### Check the Binding

The `bindingPressedEvent` event fires when any binding is pressed so you need to check and see if it is the correct binding that you want it to be.

Do this by adding this to the top of the `OnBindingPressed` function:

```lua
if binding ~= BINDING then
    return
end
```

This will escape early if the two bindings do not match.

### Toggle the Visibility of the UI

Toggling the visibility of the **UI** can be done with a quick `if/else` statement.

Add this to the bottom of the function:

```lua
if Interface.visibility == Visibility.FORCE_OFF then
    Interface.visibility = Visibility.INHERIT
else
    Interface.visibility = Visibility.FORCE_OFF
end
```

### Hide the UI

Finally, you can disable the visibility of the UI so that when the **Player** spawns in, it is off by default.

1. Click the UI in the **Hierarchy**.

2. In the **Properties** window, change the **Visibility** to **Force Off**.

![Toggle On Binding Visibility](../img/UIReference/ToggleOnBindingVisibility.png){: .center loading="lazy" }

### Final Code

```lua
local Interface = script:GetCustomProperty("Interface"):WaitForObject()

local LocalPlayer = Game.GetLocalPlayer()

local BINDING = script:GetCustomProperty("Binding")

function OnBindingPressed(player, binding)
    if binding ~= BINDING then
        return
    end

    if Interface.visibility == Visibility.FORCE_OFF then
        Interface.visibility = Visibility.INHERIT
    else
        Interface.visibility = Visibility.FORCE_OFF
    end
end

LocalPlayer.bindingPressedEvent:Connect(OnBindingPressed)
```

## Toggling UI With a Button

There may be situations you want to show **UI** when a player presses a button on the screen. This can be done by utilizing **Buttons**.

In this example, pressing the button will show a **UI** that gives some quick information to the player about the game.

![Quick Information with Button](../img/UIReference/QuickInformationWithButton.png){: .center loading="lazy" }

### Create a Script

First, you need to create a script that will handle this implementation.

1. Create a script inside the **UI** that will be toggled using the trigger. The name of the script can be anything; this tutorial will be using `ToggleOnButton`.

![Toggle On Button Script](../img/UIReference/ToggleOnButtonScript.png){: .center loading="lazy" }

### Create Custom Properties for the UI and Trigger

Second, you need a reference to the **UI** and to the trigger so that you can implement the required trigger events that then toggle the **UI**.

1. While having the script selected in the hierarchy, in the **Properties** window, add a **CoreObjectReference** **Custom Property** to the script and name it `Interface`.
2. Drag-and-drop the **UI** from the **Hierarchy** into the **Custom Property** you just created.
3. While having the script selected in the hierarchy, in the **Properties** window, add a **CoreObjectReference** **Custom Property** to the script and name it `Button`.
4. Drag-and-drop the **Button** from the **Hierarchy** into the **Custom Property** you just created.

![Toggle On Button Custom Properties](../img/UIReference/ToggleOnButtonCustomProperties.png){: .center loading="lazy" }

### Create Variable References for the UI and Button

Now, it is time to begin coding. First, you need to create variables that refer the the **UI** and **Button** **Custom Properties**.

Add this to the top of your script:

```lua
local Interface = script:GetCustomProperty("Interface"):WaitForObject()
local Button = script:GetCustomProperty("Button"):WaitForObject()
```

### Connect Event When a Player Presses the Button

It is now time to show the **UI** when a **Player** presses the **Button**. This is used by utilizing the `Button.clickedEvent` event.

At the bottom of the script, add this:

```lua
function OnButtonClicked(trigger, player)

end

Button.clickedEvent:Connect(OnButtonClicked)
```

### Toggle the Visibility of the UI

Toggling the visibility of the **UI** can be done with a quick `if/else` statement.

Add this to the function:

```lua
if Interface.visibility == Visibility.FORCE_OFF then
    Interface.visibility = Visibility.INHERIT
else
    Interface.visibility = Visibility.FORCE_OFF
end
```

### Enable the Cursor

If you do not already do this somewhere else in your game, you can enable the cursor using the `UI` namespace.

Add this to the bottom of your script:

```lua
UI.SetCanCursorInteractWithUI(true)
UI.SetCursorVisible(true)
```

### Hide the UI

Finally, you can disable the visibility of the UI so that when the **Player** spawns in, it is off by default.

1. Click the UI in the **Hierarchy**.
2. In the **Properties** window, change the **Visibility** to **Force Off**.

![Toggle On Button Visibility](../img/UIReference/ToggleOnButtonVisibility.png){: .center loading="lazy" }

### Final Code

```lua
local Interface = script:GetCustomProperty("Interface"):WaitForObject()
local Button = script:GetCustomProperty("Button"):WaitForObject()

function OnButtonClicked(trigger, player)
    if Interface.visibility == Visibility.FORCE_OFF then
        Interface.visibility = Visibility.INHERIT
    else
        Interface.visibility = Visibility.FORCE_OFF
    end
end

Button.clickedEvent:Connect(OnButtonClicked)

UI.SetCanCursorInteractWithUI(true)
UI.SetCursorVisible(true)
```

## Learn More

[UIControl](../api/uicontrol.md) | [UIText](../api/uitext.md) | [Events](../api/events.md)

repository: PopThosePringles/platform-documentation

branch_name: refs/heads/development

repo_name: PopThosePringles/platform-documentation


text:
---
id: 323
title: SSL Termination and Secure Cookies/requireSSL with ASP.NET Forms Authentication
date: 2014-03-07T08:37:20+00:00
author: james.crowley
layout: post
guid: http://www.jamescrowley.co.uk/?p=323
permalink: /2014/03/07/ssl-termination-and-secure-cookiesrequiressl-with-asp-net-forms-authentication/
sfw_comment_form_password:
  - BD8BVQNm0Jw0
categories:
  - 'Information Security & Privacy'
  - Software Engineering
tags:
  - forms authentication
  - iis
---
If you’re running a HTTPS-only web application, then you probably have requireSSL set to true in your web.config like so:

<httpCookies requireSSL="true" httpOnlyCookies="true"

With requireSSL set, any cookies ASP.NET sends with the HTTP response – in particular, the forms authentication cookies – will have the [“secure” flag](https://www.owasp.org/index.php/SecureFlag) set. This ensures that they will only be sent to your website when being accessed over HTTPS.

What happens if you put your web application behind a load balancer with SSL termination? In this case, ASP.NET will see the request coming in as non-HTTPS (Request.IsSecureConnection always returns false) and refuse to set your cookies:

_“The application is configured to issue secure cookies. These cookies require the browser to issue the request over SSL (https protocol). However, the current request is not over SSL.”_

Fortunately, we have a few tricks up our sleeve:

  1. If the HTTPS server variable is set to ‘on’, ASP.NET will think we are over HTTPS
  2. The HTTP\_X\_FORWARDED_PROTO header will contain the original protocol running at the load balancer (so we can check that the end connection is in fact HTTPS)

With this knowledge, and the rewrite module available in IIS 7 upwards, we can set up the following:

<rewrite>
        <rules>
            <rule name="HTTPS_AlwaysOn" patternSyntax="Wildcard">
                <match url="*" />
                <serverVariables>
                    <set name="HTTPS" value="on" />
                </serverVariables>
                <action type="None" />
                <conditions>
                    <add input="{HTTP_X_FORWARDED_PROTO}" pattern="https" />
                </conditions>
            </rule>
        </rules>
    </rewrite>

You’ll also need to add HTTPS to the list of allowedServerVariables in the applicationHost.config (or through the URL Rewrite config)

<rewrite>
            <allowedServerVariables>
                <add name="HTTPS" />
            </allowedServerVariables>
        </rewrite>

With thanks to [Levi Broderick](https://twitter.com/LeviBroderick) on the ASP.NET team who sent me in the right direction to this solution!

gha_language: SCSS


text:
# Franz Viber Plugin

This is a plugin for the [Franz Messaging App](https://meetfranz.com/) that wraps Viber inside a docker container, published via novnc.

_(In simple terms think of this as a "web based" Viber wrapper...)_

-------------------

![Screenshot](franz-plugin/screenshot.jpg)

### Steps to get started:

To get up and running you will need to:

 1. Install [Docker](https://www.docker.com/) (on your machine, or a server somewhere that will "publish" your Viber application)...
 2. Install [Docker Compose](https://docs.docker.com/compose/install/) - Pretty straightforward, follow the instructions...
 3. Configure & start the Viber container...
 4. Install the Viber plugin to Franz.

### Configuring & Starting Viber Container

This is fairly straightforward, just run the following commands from the `viber-docker` directory:

```
docker-compose up --build -d
```

By default the container will auto-start when Docker starts (so if you restart your computer, it will come back automatically).

### Install plugin to Franz

Please see the [franz-plugin/readme](franz-plugin/readme.md) file for instructions on installing and enabling the Viber Plugin within Franz.

### Moving Files/Directories?

If you move this project's files around after you have stood up the docker container, you will need to: `docker-compose down && docker-compose up -d` the _viber-docker_ directory again.

### Publishing the Viber Server on the web (web based Viber)

If you want to run just the docker container on the web (to publish Viber as if it was a Web Based Chat app) I suggest you put a service such as [Caddy](https://caddyserver.com/) in-front of the service to provide a free SSL certificate (via Lets Encrypt) - You will also want to change the default VNC password in `viber-docker/docker-root/etc/cont-init.d/10-setup-vnc` to something unique and secure.

You may then access the service via your favourite browser like so:
`https://<your-viber-server>/?autoconnect=true&reconnect=true&resize=remote&reconnect_delay=1000`

### Future Improvements
- There's currently no notifications hooked into Franz - We might be able to do this by monitor any signal sent via libpulse and assume it's a Notification?

- Map audio through to Host Client from Libpulse (See: https://github.com/novnc/noVNC/issues/302)

repository: ned-kelly/viber-franz

repo_name: ned-kelly/viber-franz