text:
---
title: Build a high performance KVM hypervisor on Rackspace’s OnMetal servers
author: Major Hayden
type: post
date: 2015-08-28T14:00:16+00:00
url: /2015/08/28/build-a-high-performance-kvm-hypervisor-on-rackspaces-onmetal-servers/
dsq_thread_id:
  -<PHONE_NUMBER>
categories:
  - Blog Posts
tags:
  - fedora
  - kvm
  - networking
  - rackspace
  - raid
  - virtualization

---
I received some good feedback about [my post on systemd-networkd and bonded interfaces][1] on [Rackspace's OnMetal servers][2], and I decided to write about another use case. Recent product updates allow you to [attach a Cloud Block Storage volume][3], and this opens up quite a few new possibilities for deployments.

So why not create a high-performance KVM hypervisor on an OnMetal server? Let's do this.

## Disclaimer

**_WHOA THERE._** These are amazing servers and because of that, they're priced much differently than Cloud Servers are. Be sure to review the pricing for [OnMetal][2] and [Cloud Block Storage][4] before going through this guide. **Don't end up with an unexpected bill by building one of these servers and forgetting to destroy it.**

## Building the server

We can build our server using command line tools. One of my tools, [supernova][5], makes this quite easy. My IAD environment is called `prodiad` and I can boot an OnMetal server like this:

```
supernova prodiad boot \
  --flavor onmetal-memory1 \
  --image 4c361a4a-51b4-4e29-8a35-3b0e25e49ee1 \
  --key_name personal_servers \
  --poll \
  kvm-onmetal
```

In the command above, I've built an OnMetal Memory server. I'll end up with some hardware like this:

  * Dual Intel Xeon E5-2630 v2 2.6Ghz
  * 12 cores total
  * 512GB RAM
  * 10Gbps connectivity
  * 32GB disk

Everything looks amazing except for the storage — but we'll fix that soon. I've also built the server with Fedora 22 and provided my public ssh key.

Wait a few minutes after running the supernova command and you should be back to a prompt. Verify that your new OnMetal server is pinging, but keep in mind it may still be in the process of booting up or configuring itself.

## Adding storage

Getting additional storage for an OnMetal server is done in two steps: provisioning the LUN and attaching it to the host. This is a bit easier in Cloud Servers since the actual attachment is done behind the scenes. You end up with a disk that attaches itself to the virtual machine at the hypervisor layer. OnMetal is a little different, but the process is still very straightforward.

Let's start by making four 100GB SSD volumes. We will eventually put these into a RAID 10 volume.

```shell
for i in `seq 1 4`; do
    supernova prodiad volume-create \
      --display-name onmetal-kvm-${i} \
      --volume-type SSD \
      100
done
```

We can list our new volumes:

```
$ supernova prodiad volume-list
+--------------------------------------+-----------+---------------+------+-------------+-------------+
| ID                                   | Status    | Display Name  | Size | Volume Type | Attached to |
+--------------------------------------+-----------+---------------+------+-------------+-------------+
| 0beb1f81-eb04-4aca-9b14-c952f9eb81e2 | available | onmetal-kvm-4 | 100  | SSD         |             |
| 83b9d6d9-e7eb-4b53-9342-fa2fd3670bb4 | available | onmetal-kvm-3 | 100  | SSD         |             |
| a593cbbe-089f-4ede-81f4-003717b2309f | available | onmetal-kvm-2 | 100  | SSD         |             |
| 2c51e09f-d984-4de5-8852-c0f9c6176e00 | available | onmetal-kvm-1 | 100  | SSD         |             |
+--------------------------------------+-----------+---------------+------+-------------+-------------+
```

It's now time to attach our volumes to our OnMetal server. Let's get our OnMetal server's UUID:

```
$ supernova prodiad list --name kvm-onmetal --minimal
[SUPERNOVA] Running nova against prodiad...
+--------------------------------------+-------------+
| ID                                   | Name        |
+--------------------------------------+-------------+
| 6a80d0b9-ce3e-4693-bedb-d843fea7cb0b | kvm-onmetal |
+--------------------------------------+-------------+
```

Now we're ready to attach the volumes:

```
ONMETAL_UUID=6a80d0b9-ce3e-4693-bedb-d843fea7cb0b
supernova prodiad volume-attach $ONMETAL_UUID 2c51e09f-d984-4de5-8852-c0f9c6176e00
supernova prodiad volume-attach $ONMETAL_UUID a593cbbe-089f-4ede-81f4-003717b2309f
supernova prodiad volume-attach $ONMETAL_UUID 83b9d6d9-e7eb-4b53-9342-fa2fd3670bb4
supernova prodiad volume-attach $ONMETAL_UUID 0beb1f81-eb04-4aca-9b14-c952f9eb81e2
```

Let's log into the OnMetal server and get it ready. Install the `iscsi-initator-utils` package and set up the services:

```
dnf -y install iscsi-initiator-utils
systemctl enable iscsid
systemctl start iscsid
```

Our iSCSI IQN data is in our OnMetal server's metadata. Grab your metadata JSON with this command:

```
supernova prodiad show 6a80d0b9-ce3e-4693-bedb-d843fea7cb0b | grep metadata
```

If you copy/paste the JSON data into a file, you can use Python to make the JSON easier to read:

```
cat iscsi_metadata.json | python -m json.tool
```

Start by putting your server's initiator name into a file. It should be called `initiator_name` in the JSON data.

```
echo InitiatorName=iqn.2008-10.org.openstack:735f1804-bf47-4b28-b9fc-cbff3995635e > /etc/iscsi/initiatorname.iscsi
```

Do the iSCSI logins for each \`target\_iqn\` and \`target\_portal\` in your JSON output. It should look something like this each time:

```
# iscsiadm -m discovery --type sendtargets --portal $TARGET_PORTAL
# iscsiadm -m node --targetname=$TARGET_IQN --portal $TARGET_PORTAL --login
```

When you're all done, you should have four new disks:

```
# ls /dev/disk/by-path/
ip-<IP_ADDRESS>:3260-iscsi-iqn.2010-11.com.rackspace:a593cbbe-089f-4ede-81f4-003717b2309f-lun-0
ip-<IP_ADDRESS>:3260-iscsi-iqn.2010-11.com.rackspace:0beb1f81-eb04-4aca-9b14-c952f9eb81e2-lun-0
ip-<IP_ADDRESS>:3260-iscsi-iqn.2010-11.com.rackspace:2c51e09f-d984-4de5-8852-c0f9c6176e00-lun-0
ip-<IP_ADDRESS>:3260-iscsi-iqn.2010-11.com.rackspace:83b9d6d9-e7eb-4b53-9342-fa2fd3670bb4-lun-0
```

## Building the RAID volume

We can build the raid volume using the paths from above to prevent against device name changes later. Let's make a RAID 10 volume:

```
dnf -y install mdadm
mdadm --create /dev/md0 --level=10 --raid-devices=4 /dev/disk/by-path/*
```

Check the status of the new RAID volume:

```
# cat /proc/mdstat
Personalities : [raid10]
md0 : active raid10 sdd[3] sdc[2] sdb[1] sde[0]
      209584128 blocks super 1.2 512K chunks 2 near-copies [4/4] [UUUU]
      [>....................]  resync =  0.7% (1534400/209584128) finish=15.8min speed=219200K/sec
```

Come on, our storage volumes are faster than that. Let's speed it up a bit:

```
# sysctl -w dev.raid.speed_limit_max=99999999
# cat /proc/mdstat
Personalities : [raid10]
md0 : active raid10 sdd[3] sdc[2] sdb[1] sde[0]
      209584128 blocks super 1.2 512K chunks 2 near-copies [4/4] [UUUU]
      [====>................]  resync = 21.1% (44229312/209584128) finish=2.9min speed=925564K/sec
```

That's more like it. Let's put a XFS filesystem on the volume and get it mounted:

```
dnf -y install xfsprogs
mkfs.xfs /dev/md0
mkdir /mnt/raid
echo "/dev/md0 /mnt/raid xfs defaults,noatime 0 1" >> /etc/fstab
mount -a
```

## Getting KVM going

It's time to get packages updated and installed:

```
dnf -y upgrade
dnf -y install libvirt libvirt-daemon* virt-install virt-manager xorg-x11-xauth gnome-icon-theme gnome-themes-standard dejavu*
systemctl start libvirtd
systemctl enable libvirtd
```

We can create a qcow volume and begin installing Fedora into a virtual machine:

```
qemu-img create -f qcow2 /mnt/raid/fedora-kvm.qcow2 20G
virt-install --name=fedora-kvm --ram=16384 \
    --vcpus=4 --os-variant=fedora21 --accelerate \
    --hvm --network network=default \
    --disk /mnt/raid/fedora-kvm.qcow2 \
    --location http://iad.mirror.rackspace.com/fedora/releases/22/Server/x86_64/os/ \
    --noautoconsole --graphics vnc --autostart
```

Logout and then ssh to the server again, this time with `-Y` for X forwarding. Run `virt-manager` and verify that the VM is running.

![

## Additional thoughts

Obviously, this is a very manual process. It could be automated with scripts, or an orchestration framework, like Ansible. In addition, deployment of virtual machines could be automated with OpenStack. However, my goal here was to demonstrate a new use case for OnMetal servers. I'll add the automation to my long list of to-do's.

 [1]: /2015/08/21/using-systemd-networkd-with-bonding-on-rackspaces-onmetal-servers/
 [2]: http://www.rackspace.com/en-us/cloud/servers/onmetal
 [3]: http://www.rackspace.com/knowledge_center/article/attach-a-cloud-block-storage-volume-to-an-onmetal-server
 [4]: http://www.rackspace.com/cloud/block-storage
 [5]: https://github.com/major/supernova
 [6]: /wp-content/uploads/2015/08/virt-manager-listing.png
 [installer_screenshot]: /wp-content/uploads/2015/08/onmetal-kvm-vm.png


text:
## tryhard command

`tryhard` is a very basic tool to list and rewrite `try` candidate statements.
It operates on a file-by-file basis and does not type-check the code;
potential statements are recognized and rewritten purely based on pattern
matching, with the very real possibility of false positives. Use utmost
caution when using the rewrite feature (-r flag) and have a backup as needed.

Given a file, it operates on that file; given a directory, it operates on all
`.go` files in that directory, recursively. Files starting with a period are ignored.

`tryhard` considers each top-level function with a last result of named type `error`,
which may or may not be the predefined type `error`. Inside these functions `tryhard`
considers assignments of the form

```Go
v1, v2, ..., vn, <err> = f() // can also be := instead of =
```

followed by an `if` statement of the form

```Go
if <err> != nil {
	return ..., <err>
}
```

or an `if` statement with an init expression matching the above assignment. The
error variable `<err>` must be called `err`, unless specified otherwise with the
-err flag; the variable may or may not be of type `error` or correspond to the
result error. The return statement must contain one or more return expressions,
with all but the last one denoting a zero value of sorts (a zero number literal,
an empty string, an empty composite literal, etc.). The last result must be the
variable `<err>`.

**CAUTION**: If the rewrite flag (-r) is specified, the file is updated in place!
         Make sure you can revert to the original.

Function literals (closures) are currently ignored.

### Usage:
```
tryhard [flags] [path ...]
```

The flags are:
```
-l
	list positions of potential `try` candidate statements
-r
	rewrite potential `try` candidate statements to use `try`
-err
	name of error variable; using "" permits any name (default "err")
```

If no -l is provided, `tryhard` reports the number of potential candidates found.

repository: balasanjay/tryhard

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: balasanjay/tryhard


text:
# rscp-e3dc [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
A library to assist in constructing RSCP (remote storage control protocol) frames and data to communicate with E3DC servers.

RSCP is a proprietary protocol from [E3/DC GmbH](https://www.e3dc.com/).

This library is available under the [MIT license](./LICENSE).

## Requirements
* JDK 1.8+
* Maven 3.6

## How to use it

### Add dependency
Add a dependency in your `pom.xml`:

```xml
    <dependencies>
        <dependency>
            <groupId>io.github.bvotteler</groupId>
            <artifactId>e3dc-rscp</artifactId>
            <version>1.0.2</version>
        </dependency>
    </dependencies>
```

### Constructing a frame
To construct a frame, we can use `RSCPData.Builder` in combination with `RSCPFrame.Builder`.

Typically, we want to start with an authentication frame like this:
```java
// set user name (same as used to login to the portal)
RSCPData authUser = RSCPData.builder()
        .tag(RSCPTag.TAG_RSCP_AUTHENTICATION_USER)
        .stringValue(user)
        .build();

// add password (same as used to login to the portal)
RSCPData authPwd = RSCPData.builder()
        .tag(RSCPTag.TAG_RSCP_AUTHENTICATION_PASSWORD)
        .stringValue(password)
        .build();

// combine user/password into a authentication request container
RSCPData authContainer = RSCPData.builder()
        .tag(RSCPTag.TAG_RSCP_REQ_AUTHENTICATION)
        .containerValues(Arrays.asList(authUser, authPwd))
        .build();

// put the authentication request into a frame
RSCPFrame authFrame = RSCPFrame.builder()
        .addData(authContainer)
        .timestamp(Instant.now())
        .build();

// get byte array ready to be encrypted and sent to the server
byte[] frame = authFrame.getAsByteArray();
```

### Reading a received frame
Similarly, we can use the received, decrypted byte array to inspect the response.
```java
// assuming we have the response byte array in byte[] response...
RSCPFrame frame = RSCPFrame.builder()
        .buildFromRawBytes(response);

// get the contents of the frame
List<RSCPData> dataList = frame.getData();
// an authentication response contains a single data set with the authentication level
// as CHAR8 value which fits into a Java short
RSCPData authData = dataList.get(0);
// read optional short (will be empty if the data cannot be expressed as short)
Optional<Short> authLevel = authData.getValueAsInt();
```

### Sample project
[rscp-e3dc-sample][rscpsample] is a sample project showing how this library could be used.

It shows how to construct an authentication frame, as well as a database request frame.
In addition, it shows how to encrypt and decrypt frames sent to/received from E3DC servers.

[rscpsample]: https://github.com/bvotteler/rscp-e3dc-sample
## Build
Build the library with:

`mvn clean compile`

## Test
Run the tests with:

`mvn test`

## Package
To package the project, run:

`mvn package`

You can also [configure your local repository][mvnlocal] for Maven, then run:

`mvn package install`

[mvnlocal]: https://maven.apache.org/guides/mini/guide-configuring-maven.html#configuring-your-local-repository

license: MIT

branch_name: refs/heads/main


text:
# stremio-addons-client
An example client to the Stremio add-ons protocol, similar to Stremio's Board. Because the desktop app is nothing more but a client to the add-ons system, this is basically **an open-source Stremio**.
![Stremio add-ons client](/screenshots/board-1.png)

## What's this?
It's an example client of the [stremio-addons](http://github.com/Stremio/stremio-addons) system.
It mimics Stremio's Board interface, and shows all catalogues of movie/series/channel/etc that can be gathered for all the connected add-ons (by default, all official ones).

**The main purpose of this is to aid developers in creating their own Stremio add-on by showing them how the actual app(s) utilize the add-on client.**

## How to run
```bash
git clone http://github.com/Stremio/stremio-addons-client-board
cd stremio-addons-client-board
npm install
npm start
# open browser at http://localhost:9900
```

## What are Stremio add-ons

**Stremio add-ons extend Stremio with content.**

That means either adding items to Discover/Board or providing sources to stream content farom.

Unlike regular software plugins, Stremio addons **do not run inside Stremio**, but instead are **accessed through HTTP over network**. You can think of them as **RSS on steroids**. Multiple addons can be activated, providing you more content, without installation or security risks.

## Does it use the same logic as the desktop app?
**Yes, the absolutely same logic, except**:

1. Stremio has a user log-in, and utilizes only the enabled add-ons by the user. This utilizes all add-ons served by the tracker.
2. The desktop app caches received results in [linvodb](http://github.com/Stremio/linvodb3), while this always loads them on demand

**But all in all, if an add-on works here, it should work on the desktop app and the mobile app.**

## Can I see example add-ons?

[Hello World add-on](https://github.com/Ivshti/addon-helloworld)

[Vodo add-on](https://github.com/Ivshti/stremio-vodo)

[Guidebox add-on](http://github.com/Stremio/guidebox-stremio)

[Filmon.tv add-on](http://github.com/Stremio/filmon-stremio)

You can see all known hosted Stremio add-ons at [addons.strem.io](http://addons.strem.io)

## How to create my own add-on?
### [Follow the guidelines here.](https://github.com/Stremio/stremio-addons/blob/master/documentation/home.md)


text:
# Command /bin/sh failed with exit code 1

I run into some issues about compilation.

1. `Command /bin/sh failed with exit code 1`

   After I upgraded xCode, and I could run my app on a simulator, but I cannot run it on a device. This issue was resolved after I restarted my Mac.

2. `ld: framework not found`

   I got this issue when I added some frameworks to `project -> targets -> general -> Embedded Binaries` and I added them to `project -> targets -> Build Phases -> Link Binary With Libraries`. I solved this issue by removing them from `Link Binary With Libraries`.

repository: nootfly/TIL

gha_language: HTML

repo_name: nootfly/TIL


text:
# Elective-Statistics
A script written in C++ that generates a summary indicating trends among students regarding selection of college electives.

What's Needed?

A Text File Containing A List Of What Subjects Students Have Selected

What's Generated?

![alt text](https://github.com/dishanp/Elective-Statistics/blob/main/statistics.png)

repository: dishanp/Elective-Statistics

repo_name: dishanp/Elective-Statistics


text:
# Things a non Programmer can do
## Start listening

Everything in open source involves other people.
You're looking to join a team, and that means understanding the community and how it works.
Walking in to a project and saying "Hi, here's what I think this project should be doing" is usually not taken as a good thing.
Some projects may welcome that sort of approach, but if the project has been running a while, the chances of that attitude being embraced are small.
**Listening is the best way to know what the project needs.**

1. **Join a mailing list**: For many projects, the mailing list is the main conduit of communication about the development of the project.
On large projects, there are many mailing lists to choose from.
For example, the PostgreSQL project has no fewer than 12 user-oriented lists and six developer lists on its mailing list page.
I suggest you follow the main user-oriented list and the core developer list in which to start listening.

2. **Follow a blog**: Blogs maintained by core developers often give information about what's coming up in future releases,
and what it's taken to get there. A planet site aggregates news and blog entries from many sources related to the project.
If there is a planet site, like planet.gnome.org or planet.mysql.com, start there. Just search Google for "planet <projectname>."

3. **Join an IRC channel**: Many open source projects have dedicated Internet relay chat (IRC) channels where developers and users hang out to discuss problems and development.
Check the project's website for the details of what the channel is called and what IRC network it's found on.

**Work with Tickets**
Code is the heart of any open source project, but don't think that writing code is the only way to contribute.
Maintenance of code and the systems surrounding the code often are neglected in the rush to create new features and to fix bugs.
Look to these areas as an easy way to get your foot into a project.
Most projects have a publicly visible trouble ticket system, linked from the front page of the project's website and included in the documentation.
It's the primary conduit of communication between the users and the developers. Keeping it current is a great way to help the project.
You may need to get special permissions in the ticketing system, which most project leaders will be glad to give you when you say you want to help clean up the tickets.

4. **Diagnose a bug**: Bugs are often poorly reported.
Diagnosing and triaging a bug can help save the developers save time with the legwork of figuring out the specifics of the problem.
If a user reported, "The software doesn't work when I do X," spend some time to figure out the specifics of what goes into that problem.
Is it repeatable? Can you create a set of steps to cause the problem repeatedly? Can you narrow down the problem, such as only happening on one browser but not another, or one distro but not another?

Even if you don't know what causes the problem, the effort you put into narrowing down the circumstances makes it easier for someone else to fix it.
Whatever you discover, add it to the ticket in the bug system for all to see.

5. **Close fixed bugs**: Often bugs are fixed in the codebase but tickets reported about them don’t get updated in the ticketing system.
Cleaning up this cruft can be time-consuming, but it's valuable to the whole project.

Start by querying the ticket system for tickets older than a year and see if the bug still exists.
Check the project's release change log to see if the bug was fixed and can be closed.
If it's known to be fixed, note the version number in the ticket and close it.

Try to recreate the bug with the latest version of the software.
If it can't be recreated with the latest version, note that in the ticket and close it.
If it still exists, note that in the ticket as well and leave it open.

Working with Code
Programmers of all experience levels can help with the code in the project.
Don't think that you have to be a coding genius to make real contributions to your favorite project.

If your work involves modification to the code, investigate the method that the project uses for getting code from contributors.
Each project has its own workflow, so ask about how to do it before you set out to submit code.

For example, the PostgreSQL project is very rigorous in its process: Code modifications are sent in patch form to a mailing list where core developers scrutinize every aspect of the change. On the other end is a project like Parrot where it's easy to get commit privileges to the codebase. If the project uses GitHub, there may be a workflow that uses the pull request feature of GitHub. No two projects are the same.

Whenever you modify code, make sure that you act as a responsible member of the community and keep your code style to match the rest of the codebase. The code you add or modify should look like the rest. You might not like the bracing style or the handling of spaces for indentation, but it's rude to submit a code change that doesn't match the existing standards. It's the same as saying "I don't like your style, and I think mine is better, so you should do it my way."

6. **Test a beta or release candidate**: Any project that's designed to run on multiple platforms can have all sorts of portability problems.
When a release approaches and a beta or release candidate is published, the project leader hopes that it will be tested by many different people on many different platforms.
You can be one of those people and help ensure that the package works on your platform.

Typically you only need to download, build, and test the software, but the value to the project can be huge if you're on an uncommon distribution or hardware.
Just reporting back that the build and test works helps the project leaders know that the impending release is solid.

7. **Fix a bug**: This is usually where contributors wanting to get working on code start.
It’s simple: Find an interesting-sounding bug in the ticket system and try to fix it in the code.
Document the fix in the code if it's appropriate.
It's a good idea to add a test to the test suite to test the spot of code you fixed; some projects require bug fixes to include tests. Keep notes as you poke around this unfamiliar codebase. Even if you aren't able to fix the bug, document in the ticket what you discovered as part of the fix attempt. What you find helps those who come after you.

8. **Write a test**: Most projects have a test suite that tests the code, but it's hard to imagine a test suite that couldn't have more tests added to it.
Use a test coverage tool like gcov for C, or Devel::Cover for Perl to identify areas in the source code that aren't tested by the test suite.
Then, add a test to the suite to cover it.

9. **Silence a compiler warning**: The build process for many C-based projects often spew the odd compiler warning flag to the screen.
These warnings are usually not indicators of a problem, but they can look like it.
Having too many warnings can make the compiler sound like it's crying wolf.
Check to see if the code could actually be hiding a bug.If not, modifying the source to silence helps to hide these false positives.

10. **Add a comment**:
When you're digging through the code, you may find some spots that are confusing.
Chances are if you were confused, others will be  as well. Document them in the code and submit a patch.
Work with Documentation
Documentation is typically the part of a project that gets short shrift.
It also can suffer from having been written from the point of view of those who are familiar with the project, rather than through the eyes of someone just getting into it.
If you've ever read docs for a project where you think, "It's as though this manual expects that I already know how to use the package," you know what I'm talking about.
Often a set of fresh eyes can point out deficiencies in the documentation that those close to the project don't notice.

11. **Create an example**: There is no project that has too many how-to examples.
Whether it's a web API, a library of routines, a GUI app like Gimp or a command line tool,
a good example of proper usage can more clearly and quickly explain proper usage of software than pages of documentation.
For an API or library, create an example program that uses the tool. This could even be extracted from code you've written, trimmed down to the bare necessities.
For a tool, show real-world examples of how you've used it in your daily life. If you’re visually oriented,
consider creating a screen-capture of an important process, such as how to install the application.

Work with Community
Open source is only partly about code. Community makes open source work. Here are ways you can help build it up.

12. **Answer a question**: The best way to help build the community is by helping others.
Answering a question, especially from someone who is just getting their feet wet, is crucial to helping the project grow and thrive.
The time you take to help a beginner, even if they're asking a question where you could easily throw back a quick "RTFM," pays off down the road in getting another active member of the community.
Everyone starts out somewhere, and projects need a constant inflow of people if they're to stay vital.

13. **Write a blog post**:
If you've got a blog, write about your experiences with the project that you're using.
Tell about a problem you faced using the software and what you did to solve it.
You'll be helping in two ways, both by helping keep the project on the minds of others around you,
and by creating a record for anyone else who has your problem in the future  and searches the web for the answer.
(A blog of your technical adventures is also an excellent way to show real-world experience with the software in question next time you go hunting for a job using it.)

14. **Improve a website**:
If you've got skills in web design and can help improve the website, and thus the public-facing image of the project, that's time well spent.
Perhaps the project could use a graphic overhaul, or a logo to identify the project.
These may be skills lacking in the community. I know I'd love it if I could get some graphic design help on my projects' websites.

15. **Write technical documentation**
  If you can write about how an application or piece of software works, you could write technical documentation about it. Especially open source projects that are looking to update, revamp, expand, or create technical docs for the general public to read. The more you write in plain english, the better. The best part, you don't have to be a programmer to write techincal docs.

Most of all, listen to what people around you discuss. See if you can recognize a pressing need. For instance, recently on the Parrot developers' mailing list, it was decided to use GitHub as the trouble ticket system, abandoning the old Trac installation they had. Some people were against the move because there was no way to convert the tickets to GitHub's system. After a day of back and forth arguing, I piped up and said "How about if I write a converter?" People were thrilled at the idea. I spent the time to write a conversion program for the 450+ tickets, so we lost none of our ticket history. It was a great success.  I got to pitch in, and the core developers stayed focused on the business of working on Parrot.

15. **Teach and Help others**:
The best way to learn more about a topic is to try to teach it.
The best teach is the one who can explain complex stuff with simple examples. So you need to try to be the best teacher to be the best learner and the best in your programming world. Teaching others will make you feel better about yourself and it will help you get better skills and knowledge in your profession. When you get Help from someone don't keep it to yourself share it with the others. Make the world a better place to live.

url: https://raw.githubusercontent.com/firstcontributions/first-contributions/0d55a674b4a91d8cef4a2534b21fe1cf5eff85d1/additional-material/Things a non Programmer can do.md

repository: firstcontributions/first-contributions

filename: Things a non Programmer can do.md

gha_license_id: MIT

repo_name: firstcontributions/first-contributions


text:
# Puccinia acetosae f. acetosae (Schumach.) Körn., 1876 FORM

#### Status
SYNONYM

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

#### Published in
Hedwigia 15: 184 (1876)

#### Original name
Uredo acetosae Schumach., 1803

### Remarks
null

repository: mdoering/backbone

path: /life/Fungi/Basidiomycota/Pucciniomycetes/Pucciniales/Pucciniaceae/Puccinia/Puccinia acetosae/ Syn. Puccinia acetosae acetosae/README.md

repo_name: mdoering/backbone


text:
# Images

Each subdirectory corresponds to an image that is automatically built and pushed to gcr.io/k8s-testimages when PRs that touch them merge using [postsubmit prowjobs](https://testgrid.k8s.io/sig-testing-images) that run the [image-builder](/images/builder)

## Updating test-infra images

We have bazel images that have two versions of bazel installed. The upgrade process is as follows:
* Ensure [`.bazelversion`] file matches one of the versions in these three images:
  - [`images/bazel`]'s `test-infra` variant
  - [`images/bazelbuild`]'s `test-infra` variant
* Choose the new target the [bazel release blog], such as `3.1`
  - Ensure the [`repo-infra` release] supports bazel >= the target vesion.
    - Look in [`load.bzl`] to see which repo-infra tag is used.
    - If necessary, update the `bazel_toolchains` version in [`repo-infra`'s `load.bzl`] to the latest [`bazel-toolchains` release].
    - Cut a new `repo-infra` release with this change.
    - Update `test-infra`'s `load.bzl` to use this `repo-infra` release.
* Create a PR to make images to include both the current and target version:
  - The old version should match what is currently in `.bazelversion`
  - The new version should be the target version.
  - [`images/bazel`]'s `test-infra` variant
  - [`images/bazelbuild`]'s `test-infra` variant
* Merge the PR
  - This should postsubmits to create the `bazel` and `bazelbuild` images.
* Update usage to these new images
  - Manually update the [`bazel-base`] digtest in `containers.bzl` to the new image.
    - NOTE: must update the digest (the tag param is just documentation)
    - `TODO(fejta):` this should be done automatically like the others
  - The periodic prow autobump job should make a PR to start using these images an hour later.
  - The next day oncall should merge this PR, at which point they will start getting used.
* Create a PR to change [`.bazelversion`] to the target version.
  - This should cause presubmits to try and use the new version.
  - Merging the PR will cause postsubmis/periodics to start using it.

## Testing Images

There is no automated testing pipeline for images:
- Any jobs that use the `:latest` tag use the latest published image immediately
- Any jobs that use a `:v{date}-{sha}[-{variant}]` tag (e.g. `:v20200407-c818676-master`) are updated to use the latest published image ~daily.  This is accomplished by PR's created by the [autobumper prowjob](https://testgrid.k8s.io/sig-testing-prow#autobump-prow), which are merged by [test-infra oncall](https://go.k8s.io/oncall) once a day during weekdays.

1. Merge a PR changing something in the image directory.

1. Grep the [prowjob configs](/config/jobs) to find out which jobs are using `gcr.io/k8s-testimages/<image-name>:latest` and monitor [TestGrid](http://testgrid.k8s.io) for new failures corresponding to your change.

    * On failure, send a new PR to rollback your last one or a fix if you know immediately.
    * Some of these images might be presubmits; you could monitor them at http://prow.k8s.io

1. You are done. If more breaks happen later, [test-infra oncall](go.k8s.io/oncall) will take care of it.

[`bazel-base`]: /containers.bzl
[`.bazelversion`]: /.bazelversion
[`images/bazel`]: /images/bazel/variants.yaml
[`images/bazelbuild`]: /images/bazelbuild/variants.yaml
[bazel release blog]: https://blog.bazel.build
[`repo-infra` release]: https://github.com/kubernetes/repo-infra/releases
[`load.bzl`]: /load.bzl
[`bazel_toolchains` release]: https://github.com/bazelbuild/bazel-toolchains/releases
[`repo-infra`'s `load.bzl`]: https://github.com/kubernetes/repo-infra/blob/master/load.bzl

repository: kubernetes/test-infra

gha_language: Go

repo_name: kubernetes/test-infra


text:
# Kubeflow Access Management API

Kubeflow Access Management API provides fine-grain user-namespace level access control.
The goal is to support multi-tenancy kubeflow cluster / services.

## Resources under management

### Profile
- Profile contains owner which refers to a k8s user.
- Profile will create a namespace with same name and make profile owner the namespace owner.
- Profile will create necessary k8s resources to enable owner access to kubeflow services under multi-tenancy mode.
- After the namespace is created, the owner can grant access to additional users or groups using the API or by creating RBAC roles & bindings directly.
- Delete profile will delete namespace and other k8s resources owned by this profile.

### Binding
- Binding contains a user-namespace pair.
- Binding will give user edit access to referred namespace.
- Delete binding will revoke user's access in binding.

## Use Cases
#### Case 1: Self serve Kubeflow

A Kubeflow admin would like to grant a set of users the ability to create/delete a namespace in which they can consume Kubeflow.
The resulting namespace should only be accessible to the user who created it; or people they grant access to.
RBAC doesn't directly support this. So we provide a service on top of RBAC which will enforce this based on the user's identity

#### Case 2: Allow user to update / share resources they own.

We will not grant user permission to edit cluster-scoped CRD resources. Then to enable user editting their own resources,
we provide update / share / delete APIs and perform permission check on every coming request.

## APIs

#####`/v1/profiles`
* `create`: create new profile;
  * called when new user self-register.

#####`/v1/profiles/{profile}`
* `delete`: delete profile;
  * called when admin or owner delete profile / namespace.

#####`/v1/bindings`
* `create`: create new binding;
  * called when admin or owner share namespace access with other users.
* `get`: get bindings;
  * called when query for binding status.
  * filter by user=... | namespace=... | role=owner/editor to query permissions related to a user / namespace.
  * For example filter by<EMAIL_ADDRESS>when need to list namespaces for user<EMAIL_ADDRESS>called when need to list namespaces for an user (list namespaces on notebook spawner for current user)
  * For example filter by "namespace=abc" when need to list users of a namespace "abc"; called when need to list users of namespace "abc".
* `delete`: delete binding;
  * called when admin or owner revoke namespace access.

repository: kubeflow/kubeflow

gha_language: TypeScript

repo_name: kubeflow/kubeflow


text:
# Change Log

## [0.3.0](https://github.com/czechboy0/Redbird/tree/0.3.0) (2016-02-25)
[Full Changelog](https://github.com/czechboy0/Redbird/compare/0.2.3...0.3.0)

**Closed issues:**

- Auto-connect to a server with idle-timeout [\#17](https://github.com/czechboy0/Redbird/issues/17)

**Merged pull requests:**

- Auto reconnect, easier auth [\#18](https://github.com/czechboy0/Redbird/pull/18) ([czechboy0](https://github.com/czechboy0))

## [0.2.3](https://github.com/czechboy0/Redbird/tree/0.2.3) (2016-02-22)
[Full Changelog](https://github.com/czechboy0/Redbird/compare/0.2.2...0.2.3)

## [0.2.2](https://github.com/czechboy0/Redbird/tree/0.2.2) (2016-02-17)
[Full Changelog](https://github.com/czechboy0/Redbird/compare/0.2.1...0.2.2)

## [0.2.1](https://github.com/czechboy0/Redbird/tree/0.2.1) (2016-02-17)
[Full Changelog](https://github.com/czechboy0/Redbird/compare/0.2.0...0.2.1)

**Closed issues:**

- Add Swift & Redis to Travis cache to speed up build/tests [\#15](https://github.com/czechboy0/Redbird/issues/15)

## [0.2.0](https://github.com/czechboy0/Redbird/tree/0.2.0) (2016-02-16)
[Full Changelog](https://github.com/czechboy0/Redbird/compare/0.1.0...0.2.0)

**Implemented enhancements:**

- Performance tests  [\#7](https://github.com/czechboy0/Redbird/issues/7)
- Support Pipelining [\#5](https://github.com/czechboy0/Redbird/issues/5)
- Convenience wrappers for commands [\#4](https://github.com/czechboy0/Redbird/issues/4)

**Closed issues:**

- Timeout & automatic reconnect [\#12](https://github.com/czechboy0/Redbird/issues/12)

**Merged pull requests:**

- Performance tests [\#14](https://github.com/czechboy0/Redbird/pull/14) ([czechboy0](https://github.com/czechboy0))
- Pipelining support [\#13](https://github.com/czechboy0/Redbird/pull/13) ([czechboy0](https://github.com/czechboy0))

## [0.1.0](https://github.com/czechboy0/Redbird/tree/0.1.0) (2016-02-14)
[Full Changelog](https://github.com/czechboy0/Redbird/compare/0.0.3...0.1.0)

**Closed issues:**

- Create targets and travis jobs for iOS, tvOS and watchOS [\#8](https://github.com/czechboy0/Redbird/issues/8)
- Add fastlane for easy release process [\#6](https://github.com/czechboy0/Redbird/issues/6)
- Authentication [\#2](https://github.com/czechboy0/Redbird/issues/2)

**Merged pull requests:**

- Authentication simplified [\#11](https://github.com/czechboy0/Redbird/pull/11) ([czechboy0](https://github.com/czechboy0))
- Live Tests on Travis [\#10](https://github.com/czechboy0/Redbird/pull/10) ([czechboy0](https://github.com/czechboy0))

## [0.0.3](https://github.com/czechboy0/Redbird/tree/0.0.3) (2016-02-14)
[Full Changelog](https://github.com/czechboy0/Redbird/compare/0.0.2...0.0.3)

## [0.0.2](https://github.com/czechboy0/Redbird/tree/0.0.2) (2016-02-13)
[Full Changelog](https://github.com/czechboy0/Redbird/compare/0.0.1...0.0.2)

**Closed issues:**

- Resp types to Swift types easy conversion [\#3](https://github.com/czechboy0/Redbird/issues/3)
- Add a Podspec [\#1](https://github.com/czechboy0/Redbird/issues/1)

## [0.0.1](https://github.com/czechboy0/Redbird/tree/0.0.1) (2016-02-13)

\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*

repository: cwoloszynski/redbird

gha_language: Swift

repo_name: cwoloszynski/redbird


text:
# Android app for controlling robot via Bluetooth
This Android app is built for ECE 4180 final project at Georgia Institute of Technology.
Project page from mbed developer site: https://developer.mbed.org/users/malavikabindhi/notebook/wall-mapping-robot/

The base of this app is nRF UART app for Android from Nordic Semiconductor.
Source: https://github.com/NordicSemiconductor/Android-nRF-UART

A screenshot of the app with short introductions is shown below.
![screenshot](https://github.com/kniw233/BLERobot4180/blob/master/Screenshot.png)


text:
Tips for those that want to make changes
========================================

# Versions

File [scripts/common.sh](scripts/common.sh) can be edited if you want to
change the version of a particular system.

Be wary that you might also need to change the hadoop version described
by the symbolic link in the function installSpark (in File [scripts/setup-spark.sh](scripts/setup-spark.sh))

repository: Tello-Wharton/vagrant-hadoop-spark-hive

repo_name: Tello-Wharton/vagrant-hadoop-spark-hive


text:
# From Monolith to K8s - Workshop

## Installing and Configuring Keycloak
During this step-by-step you will be using **Kubernetes Cluster** and a Keycloak as SSO to secure our API Gateway and Microservices.

### Creating a Kubernetes Cluster with KIND

```
$ cat <<EOF | kind create cluster --name dev --config=-
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
  kubeadmConfigPatches:
  - |
    kind: InitConfiguration
    nodeRegistration:
      kubeletExtraArgs:
        node-labels: "ingress-ready=true"
  extraPortMappings:
  - containerPort: 80
    hostPort: 80
    protocol: TCP
  - containerPort: 443
    hostPort: 443
    protocol: TCP
- role: worker
- role: worker
- role: worker
EOF
```

Don't forget to set current cluster/context

```
$ kubectl cluster-info --context kind-dev
```

Install Ingress Controller

```
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/provider/kind/deploy.yaml
```

## Install the Application with SSO

```
helm repo add dev http://chartmuseum-jx.<IP_ADDRESS>.nip.io
helm repo update
helm install app-sso dev/fmtok8s-app-sso
```

### Installing Keycloak in our Kubernetes Cluster

```
$ kubectl create -f https://raw.githubusercontent.com/keycloak/keycloak-quickstarts/latest/kubernetes-examples/keycloak.yaml
```

Let's see if the keycloak pod is up and running with:

```
$ kubectl get pods
```

After installing keycloak you need to modify the base installation to set the keycloak service to use the port 80 instead of 8080, you can do this by editting the keyclaok service with:

```
$ kubectl edit svc keycloak
```

Modify the port from:
```
 - name: http
    nodePort: 32595
    **port: 8080**
    protocol: TCP
    targetPort: 8080

```

to

```
 - name: http
    nodePort: 32595
    **port: 80**
    protocol: TCP
    targetPort: 8080

```

Once this is done, you need to edit your `/etc/hosts` files in your host machine to include the `keycloak` host for the ingress definition to work:

```
$ sudo vi /etc/hosts

<IP_ADDRESS>	localhost keycloak
```

If you are using Windows
```
Go to file C:\Windows\System32\drivers\etc\hosts and add:

<IP_ADDRESS> keycloak
```

## Configuring Keycloak

If you already isntalled the application, an Ingress was created to route traffic to Keycloak under the `keycloak` host. Point your browser to `http://keycloak` to access the adminstration console.

### 1 - Let's access Administration Console:

### 2 - We'll access using our credentials passed through configurations

**User**: admin
**Password**: admin

### 3 - Create your realm (fmtok8s)

  What is Keycloak's Realm?
      A realm manages a set of users, credentials, roles, and groups. In our example, we'll create a Realm for fmtok8s application. A user belongs nd accesses one realm, a realm are isolated from one another, then if you create an user in Realm A the another Realm (B) cannot see, and if you create an user on Realm A this user cannot access Realm B.

### 4 - Creating Client Scope

  What is Client Scopes?
      "Client scopes allow you to define a common set of protocol mappers and roles. Wich are shared between multiple clients".

It will help us to mapper roles in token.

In configure section, click on Client Scopes, after click on create button, to create a Client Scope.

Complete Protocol Mapper form, and click on save:

### 4 - Creating a Realm's Client

What is Keycloak's Client?
"Clients are applications and services that want to use Keycloak to secure themselves and provide a single sign-on solution". In our solution, we'll just one client API Gateway.

### 5 - Configuring a Client

The client configuration's page is very large, then I will divide it in two parts:

OAuth2 configuration:

Client Scope configuration:

Click on Client Scopes tab, and add `fmtok8s` Client Scope

## 6 - Creating an Realm's User

After, you should set the user's password

### 7 - Creating a Realm's Role

### 8 - Adding a role to user

## Changing API Gateway to secure our hidden microservices

[API Gateway](https://github.com/mcruzdev/fmtok8s-api-gateway) was created with Spring Cloud Gateway. The Spring Cloud Gateway uses Spring Webflux working with reactive stack.

There is a great lib called
`org.keycloak:keycloak-spring-boot-starter` that help us to configure our application using keycloak and it runs better with Servlet applications. [See](https://keycloak.discourse.group/t/webflux-support-for-spring-boot-and-spring-security-adapters/2936)

In this workshop, you will use Spring Security OAuth2. Let's go to use it.

### Adding Spring OAuth2 dependecies in API Gateway

```
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-oauth2-client</artifactId>
</dependency>
```

It is important to notice that this Spring Boot dependency makes the API Gateway component an OAuth2 Client but not a Server hosting restricted resources.

### Configuring

We should change the configuration of **API Gateway** on application.yml

```
spring:
  security:
    oauth2:
      client:
        provider:
          oidc:
            issuer-uri: http://keycloak/auth/realms/fmtok8s
        registration:
          oidc:
            client-name: keycloak
            provider: oidc
            client-id: gateway
            client-secret: <CLIENT SECRET>
            scope:
              - openid
```

Edit the API-Gateway deployment and add the following Environment Vairables:

```
$ kubectl edit deploy app-sso-fmtok8s-api-gateway
```
Look for the env section and add the following variables:

```
        - name: SPRING_PROFILES_ACTIVE
          value: sso
        - name: SPRING_SECURITY_OAUTH2_CLIENT_PROVIDER_OIDC_ISSUER_URI
          value: http://keycloak/auth/realms/fmtok8s
        - name: SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_OIDC_CLIENT_ID
          value: gateway
        - name: SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_OIDC_CLIENT_SECRET
          value: <CLIENT SECRET>
        - name: SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_OIDC_SCOPE_0
          value: openid

```

The property client-secret should be filled with client-secret from keycloak, let's get our client-secret from gateway keycloak client:

**Copy gateway's secret:**

And add a filter a new filter on **API Gateway** to relay de Token to hiden services

```
spring:
  cloud:
    gateway:
      default-filters:
        - TokenRelay=
        - RemoveRequestHeader=Cookie

```

### Creating class SecurityConfig to our Gateway

```
package com.salaboy.conferences.site.security;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Profile;
import org.springframework.security.config.annotation.web.reactive.EnableWebFluxSecurity;
import org.springframework.security.config.web.server.ServerHttpSecurity;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.oauth2.client.oidc.userinfo.OidcReactiveOAuth2UserService;
import org.springframework.security.oauth2.client.oidc.userinfo.OidcUserRequest;
import org.springframework.security.oauth2.client.userinfo.ReactiveOAuth2UserService;
import org.springframework.security.oauth2.core.oidc.user.DefaultOidcUser;
import org.springframework.security.oauth2.core.oidc.user.OidcUser;
import org.springframework.security.oauth2.core.oidc.user.OidcUserAuthority;
import org.springframework.security.web.server.SecurityWebFilterChain;

import java.util.*;
import java.util.stream.Collectors;

@Profile("sso")
@EnableWebFluxSecurity
public class SecurityConfig {

    @Bean
    public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {

        return http.csrf().disable()
                .authorizeExchange()
                .pathMatchers("/backoffice/**").hasAuthority("organizer")
                .anyExchange().permitAll()
                .and()
                .oauth2Login()
                .and()
                .oauth2Client()
                .and()
                .build();
    }

    @Bean
    public ReactiveOAuth2UserService<OidcUserRequest, OidcUser> oidcUserService() {
        final OidcReactiveOAuth2UserService delegate = new OidcReactiveOAuth2UserService();

        return (userRequest) -> {
            // Delegate to the default implementation for loading a user
            return delegate.loadUser(userRequest).map(user -> {
                Set<GrantedAuthority> mappedAuthorities = new HashSet<>();

                user.getAuthorities().forEach(authority -> {
                    if (authority instanceof OidcUserAuthority) {
                        OidcUserAuthority oidcUserAuthority = (OidcUserAuthority) authority;
                        mappedAuthorities.addAll(extractAuthorityFromClaims(oidcUserAuthority.getUserInfo().getClaims()));
                    }
                });

                return new DefaultOidcUser(mappedAuthorities, user.getIdToken(), user.getUserInfo());
            });
        };
    }

    public static List<GrantedAuthority> extractAuthorityFromClaims(Map<String, Object> claims) {
        return mapRolesToGrantedAuthorities(getRolesFromClaims(claims));
    }

    private static Collection<String> getRolesFromClaims(Map<String, Object> claims) {

        return (Collection<String>) claims.getOrDefault("roles", new ArrayList<>());
    }

    private static List<GrantedAuthority> mapRolesToGrantedAuthorities(Collection<String> roles) {
        return roles.stream()
                .map(SimpleGrantedAuthority::new)
                .collect(Collectors.toList());
    }

}

```

## Securing our microservices (C4P)

### We need to add some dependecies on pom.xml

```
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-oauth2-resource-server</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-oauth2-jose</artifactId>
        </dependency>
```

Notice that here we need `spring-security-oauth2-resource-server` and `spring-security-oauth2-jose` to secure REST Endpoints hosted by this service.

### Configuring Spring OAuth2 Resource Server through application.properties:

```
spring.security.oauth2.resourceserver.jwt.issuer-uri=http://keycloak/auth/realms/fmtok8s
```

Edit the other services Deployments with the following Environment Variables:

```
$ kubectl edit deploy app-sso-fmtok8s-c4p-rest
```
Look for the env section and add the following variables:

```
        - name: SPRING_PROFILES_ACTIVE
          value: sso
        - name: SPRING_SECURITY_OAUTH2_RESOURCESERVER_JWT_ISSUER_URI
          value: http://keycloak/auth/realms/fmtok8s
```

### Create a class to configure CORS

```
package com.salaboy.conferences.c4p.rest.configuration;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.reactive.config.CorsRegistry;
import org.springframework.web.reactive.config.WebFluxConfigurer;

@Configuration
public class CORSConfig implements WebFluxConfigurer {

    @Override
    public void addCorsMappings(CorsRegistry registry) {
        registry.addMapping("/**").allowCredentials(true).allowedMethods("*");
    }
}
```

### Creating our SecurityConfig

```
package com.salaboy.conferences.c4p.rest.security;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Profile;
import org.springframework.core.convert.converter.Converter;
import org.springframework.http.HttpMethod;
import org.springframework.security.authentication.AbstractAuthenticationToken;
import org.springframework.security.config.annotation.web.reactive.EnableWebFluxSecurity;
import org.springframework.security.config.web.server.ServerHttpSecurity;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.oauth2.jwt.Jwt;
import org.springframework.security.oauth2.server.resource.authentication.JwtAuthenticationConverter;
import org.springframework.security.oauth2.server.resource.authentication.ReactiveJwtAuthenticationConverterAdapter;
import org.springframework.security.web.server.SecurityWebFilterChain;
import reactor.core.publisher.Mono;

import java.util.*;
import java.util.stream.Collectors;

@Profile("sso")
@EnableWebFluxSecurity
public class SecurityConfig {

    @Bean
    public SecurityWebFilterChain securityWebFilterChain(ServerHttpSecurity http) {

        http
                .csrf().disable()
                .authorizeExchange(exchanges ->
                        exchanges
                                .pathMatchers(HttpMethod.POST, "/decide**").hasAuthority("organizer")
                                .pathMatchers(HttpMethod.POST, "/").permitAll()
                                .pathMatchers(HttpMethod.GET, "/actuator/health").permitAll()
                                .pathMatchers(HttpMethod.GET, "/actuator/info").permitAll()
                                .pathMatchers(HttpMethod.GET, "/prometheus").permitAll()
                                .anyExchange().permitAll()

                    )
                .oauth2ResourceServer(oauth2 ->
                        oauth2.jwt(jwt -> jwt.jwtAuthenticationConverter(grantedAuthoritiesExtractor())));

        return http.build();
    }

    Converter<Jwt, Mono<AbstractAuthenticationToken>> grantedAuthoritiesExtractor() {
        JwtAuthenticationConverter jwtAuthenticationConverter =
                new JwtAuthenticationConverter();

        jwtAuthenticationConverter.setJwtGrantedAuthoritiesConverter(new GrantedAuthoritiesExtractor());

        return new ReactiveJwtAuthenticationConverterAdapter(jwtAuthenticationConverter);
    }

    static class GrantedAuthoritiesExtractor implements Converter<Jwt, Collection<GrantedAuthority>> {

        @Override
        public Collection<GrantedAuthority> convert(Jwt jwt) {
            var roles = (List<String>) jwt.getClaims().getOrDefault("roles", Collections.emptyList());

            return roles.stream()
                    .map(SimpleGrantedAuthority::new)
                    .collect(Collectors.toList());
        }
    }
}

```

# Theory

## OAuth2 Concepts

Before you start, I want to speak a bit about OAuth2 concepts:

### OAuth2 Roles

OAuth2 defines four roles:

- Resource Owner

    It is an user that have some resource protected, like your facebook account, Github repositories, Instagram images etc.

    **In our case a Resource Owner is the admin user that approves or rejects a proposal**

- Resource Server

    Provides a protected resource and permits the access through valid access tokens. Examples of Resource Server: Facebook, Github, Instagram etc.

    **In our case a Resource Server will be C4P Service, Email Service and Agenda Service**

- Authorization Server

    Authorization Server provides an API used to autenticates an user and generates an **access token**. Examples of Authorizaton Server: Spring Authorization Server, Okta, Google Identity etc.

    **In our case, Keycloak is our Authorization Server**

- Client

    It is an application, web, SPA, Desktop or mobile, that want to access the resources from **Resource Owner**. A Client needs to be registred on Authorization Server, being identified by a **client id** and a **client secret**.

    **In our case a Client is the API Gateway**

### OAuth2 Grant Types:

A Grant Type is a way that a Client use to give an **access token**, OAuth2 is very flexible and provides four grant types for us:

- Password

    Used when there is a strong relationship from Client and Authorization Server. The user provides your credentials (username and password) directly to Client, that forward (with his client id and client secret) the user's credentials to Authorization Server.

- Client Credentials

    Used when there is not an user involved, it is used when there is a sytem called a protected system, just client's credentials are provides to Authorization Server.

- Authorization Code

    Used when third applications want to access data from a protected resource without the Client see the user's credentials. By example:
    When an user (Resource Owner) permits that the Travis CI (Client) access your repositories from Github (Authorization Server and Resource Owner).

- Implicit

    Is mostly used on Single Page Applications and Mobile Apps.
    The user is redirected to Authorization Server's login page, but the redirect is made directly to user-agent (A browser, by example) with access token. With this way, the SPA or Mobile application knows directly the access token.

It is a brief explanation about OAuth2, to more details [look here](https://oauth.net/2/)

In this workshop we'll use **Authorization Code Grant Types**

**Authorization Server:** *Keycloak*

**Client:** *API Gateway*

**Resourse Owner:** *Admin*

**Resource Server:** *C4P Service, Agenda Service, Email Service*


text:
# Amazon-Prototype
A distributed Amazon Prototype application built using React, Node, Kafka, Redis, MongoDB and MySQL.

## Running

Make sure you have Node and npm installed. Also replace the .env-example in each of the following to .env and add the environment values.

### Frontend

```
cd frontend
npm install
npm start
```

### Backend

- Setup a Kafka cluster with 6 kafka topics: auth, analytics, profile, operations, cart and product.
- Install Redis and librdkafka. On Ubuntu, run the command: `sudo apt install librdkafka-dev redis-server`
- Run the backend server using the following commands:
```
cd backend
npm install
node index.js
```

repository: varshajairam/Amazon-Prototype

repo_name: varshajairam/Amazon-Prototype


text:
# Contributing to DNPLab
We love your input! We want to make contributing to this project as easy
and transparent as possible. The following contributions equally counts:

- Reporting a bug
- Proposing new features
- Improving documentation
- Adding a test case
- Submitting a fix
- Becoming a maintainer

## Bug reports and enhancement requests
We use GitHub issues to track public bugs and enhancement requests:
[opening a new issue](https://github.com/DNPLab/DNPLab/issues/new).

To report a bug, please:

1. Include a short, self-contained Python snippet reproducing the
   problem.
2. Explain why the current behavior is wrong/not desired and what you
   expect instead.

## Working with the code

### Git and Github

We will use git for version control, and github to host the DNPLab code
base.

Some resources for learning Git:
- [Atlassian Git tutorial](https://www.atlassian.com/git/tutorials/what-is-version-control)
- [Pandas's contribution guidance](https://pandas.pydata.org/pandas-docs/stable/development/contributing.html#version-control-git-and-github)

Some resources for learning GitHub:
- [Getting started with GitHub](https://docs.github.com/en/free-pro-team@latest/github/getting-started-with-github)

### Forking and cloning

After [creating your free github account](https://github.com/join), you
can go to the [DNPLab project page](https://github.com/DNPLab/DNPLab)
and click the **Fork** button to creating a copy of the project to your
own Github account.

From now on, we will type commands in terminal if you are using MacOS or
Linux, or in cmd prompt if you are using windows (For Windows 10, make
sure you change to a directory with write permission).

After forking, you want to copy the project from Github to your local
machine by
```
git clone https://github.com/<your-github-user-name>/dnplab dnplab-yourname
cd dnplab-yourname
git remote add upstream https://github.com/dnplab/dnplab.git
```

The `master` branch only hosts the latest release, so you want to be on
the `develop` branch for the latest production-ready development. Type
```
git checkout develop
git pull upstream develop
```

### Creating a development environment

If you are making documentation changes only, you can skip this section.

To test out code changes, you need to set up all the dependencies.

We strongly recommend using virtual environment to avoid messing up with
your existing python environments. You can use conda by doing the
following
1. Install either
   [Anaconda](https://www.anaconda.com/products/individual) or
   [miniconda](https://docs.conda.io/en/latest/miniconda.html)
2. Make sure conda is up-to-date
   ```
   conda update conda
   ```
3. Create environment with Python>=3.6
   ```
   conda create --name environment_name python=3.8
   conda activate environment_name
   ```
4. Install dependencies. First, use `git status` to make sure you are at
   `develop` branch, then type
   ```
   python -m pip install -r requirements.txt
   ```

### Branching, commiting and pushing
When creating new branch, you want to make sure the `develop` is up to
date with DNPLab project. You can do so by
```
git checkout develop
git pull upstream develop
```

You want to branch out from the `develop` when making any change.
```
git branch yourname-gh-##
git checkout yourname-gh-##
```
We strongly recommend using `yourname-gh-##` as the branch name, where
`##` is the corresponding issue or pull request number in the DNPLab
project that you are addressing.

Now you are free to make any change to address corresponding issue. We
strongly recommend breaking tens of lines of changes into multiple
batches of small changes to ease the reviewing process.

After making changes, run the following and make sure no errors pop up
to ensure you are not breaking the code.
```
python -m pytest
```

Then run the following to check syntax error and correct formats
```
python -m flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
python -m black .
```

After all done. Commit your changes following
[pandas: committing your code](https://pandas.pydata.org/pandas-docs/stable/development/contributing.html#committing-your-code)

Push to your Github repository by
```
git push -u origin yourname-gh-##
```

### Pull requests
After reviewing your changes, you can file a pull request for the
maintainer of DNPLab to review and approve. See
[Github creating-a-pull-request](https://docs.github.com/en/free-pro-team@latest/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request)

Make sure you are requesting to merge to `DNPLab/develop` from
`your-github-username/yourname-gh-##`.

Your changes will trigger multiple automatic checkings to ensure it
won't break the package. Then a maintainer from the DNPLab team will
accept or provide revising comments.

## Contributing to documentation

## License
By contributing, you agree that your contributions will be licensed under its MIT License.

## Becoming a maintainer

We strongly welcome and encourage committed individuals to help maintain
DNPLab. You don't have to be a python expert or a DNP expert. Please
contact any of the [current maintainers](http://dnplab.net/) if you are interested.

repository: DNPLab/DNPLab

gha_language: Python

repo_name: DNPLab/DNPLab


text:
---
layout: relation
title: 'parataxis:restart'
shortdef: 'loosely connected clause because of restart'
udver: '2'
---

The `parataxis:restart` subtype of the [parataxis]() relation is used in spoken data for clauses
or clausal fragments that are not syntactically well connected to the previous clause because
the speaker has changed their mind and started talking about something else.

The new (restarted) clause is attached as a dependent of the earlier clause.

~~~ sdparse
poglejte mi smo re [gap] mmm mmm narobe me interpretirate \n look we are re [gap] mmm mmm wrong me you-interpret
parataxis:restart(poglejte, interpretirate)
parataxis:restart(look, you-interpret)
~~~

<!-- Interlanguage links updated Út 9. května 2023, 20:04:32 CEST -->

repository: UniversalDependencies/docs

branch_name: refs/heads/pages-source

repo_name: UniversalDependencies/docs


text:
---
hrs_structure:
  division: '1'
  volume: '6'
  title: '19'
  chapter: 323D
  section: ''
type: chapter
tags:
  - Government
menu:
  hrs:
    identifier: HRS0323D
    parent: title19
    name: Chapter 323D Health Planning and Resources Development and
weight: 19000
title: Health Planning and Resources Development and
full_title: Chapter 323D Health Planning and Resources Development and
---
**CHAPTER 323D**

**HEALTH PLANNING AND RESOURCES DEVELOPMENT AND**

**HEALTH CARE COST CONTROL**

Part I. General Provisions

Section

323D-1 Purpose

323D-2 Definitions

Part II. State Health Planning and Development Program

323D-11 State health planning and development agency

323D-12 Health planning and development functions; state

agency

323D-12.5 Repealed

323D-12.6 State health planning and development special fund;

created; deposits; expenditures; fees

323D-13 Statewide health coordinating council

323D-13.5 Disqualification from position or membership

323D-14 Functions; statewide health coordinating council

323D-15 State health services and facilities plan

323D-16 Repealed

323D-17 Public hearings required

323D-18 Information required of providers

323D-18.5 Access to health and dental insurance data;

mandatory reporting for certain insurers; uses;

confidentiality

323D-18.6 Confidentiality of information

Part III. Subarea Health Planning Councils

323D-21 Subarea health planning councils, established

323D-22 Subarea health planning councils, functions, quorum

and number of members necessary to take valid action

323D-23 Subarea health planning councils, composition,

appointment

323D-24 to 27 Repealed

Part IV. State Medical Facilities--Repealed

323D-31 to 33 Repealed

Part V. Certificate of Need

323D-41 Repealed

323D-42 Review panel

323D-43 Certificates of need

323D-44 Applications for certificates of need

323D-44.5 Administrative review of certain applications for

certificate of need

323D-44.6 Review of certain applications for certificate of

need; waiver

323D-44.7 Monitoring of approved certificates of need

323D-45 Subarea council, review panel, and statewide council

recommendations for issuance or denial of certificates

of need

323D-45.1 Ex parte contacts prohibited

323D-45.2 Repealed

323D-45.3 Approval of applications required to meet safety,

licensure, or accreditation standards

323D-46 Conditional certification

323D-46.1 Repealed

323D-46.2 Withdrawal of a certificate of need

323D-47 Request for reconsideration

323D-48 Judicial review of state agency decisions

323D-49 Certificates of need; licenses and permits

323D-50 Certificates of need, penalties

323D-51 Injunctive relief

323D-52 Letters of intent

323D-53 Periodic reports from health facilities

323D-54 Exemptions from certificate of need requirements

323D-55 Repealed

Part VI. General Administration

323D-61 Personnel

323D-62 Rules

Part VII. Hospital Acquisition

323D-71 Definitions

323D-72 Acquisition of hospital

323D-73 Notice; procedures

323D-74 Hearings

323D-75 Review; decision; rules

323D-76 Acquisition in the public interest; decision of

attorney general

323D-77 Acquisition; decision by agency

323D-78 Revocation; hearing

323D-79 Public interest

323D-80 License renewal

323D-81 Prior acquisitions

323D-82 Maintenance of services

323D-83 Statutory authority

Note

Chapter reenacted by L 1977, c 178, §2.

Chapter heading amended by L 1984, c 267, §1.

Health care workforce shortage map and database; projections through 2020\. L 2007, c 219, §§5, 6.

Interim rules pertaining to health and dental insurance data (effective until June 30, 2017, or rules are adopted pursuant to §323D-18.5(e); reports to 2017-2018 legislature. L 2016, c 139, §§3, 4.

Maui county; expedited reviews for certain certificate of need applications. L 2007, c 219, §3.

Cross References

Conformance with federal law, see §431:2-201.5.

Hawaii health authority, see chapter 322H.

Health maintenance organization act, see chapter 432D.

Hospital sustainability program, see chapter 346G.

Kahuku medical center; designation as a rural hospital, see §346-53.8.

Nursing facility sustainability program, see chapter 346F.

repository: SamMade/BlueAndKrabby

repo_name: SamMade/BlueAndKrabby


text:
# hackathon-live-feed

A dashboard for displaying live-feed activity - Git commits, Tweets, and announcement - of participants in real-time. Built for the [RefactorU](http://www.refactoru.com/) Hackathon, which took place on April 18th, 2015.

**Staging**:
- [https://pacific-beach-3008.herokuapp.com/](https://pacific-beach-3008.herokuapp.com/)
- Dummy admin
    - email<EMAIL_ADDRESS>    - password: admin

[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/RefactorU/hackathon-live-feed?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)

[![Build Status](https://travis-ci.org/RefactorU/hackathon-live-feed.svg?branch=master)](https://travis-ci.org/RefactorU/hackathon-live-feed)

[![Coverage Status](https://coveralls.io/repos/RefactorU/hackathon-live-feed/badge.svg?branch=master)](https://coveralls.io/r/RefactorU/hackathon-live-feed?branch=master)

Here is the [Markdown Cheatsheet](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet)

## Quick Start

1. Clone
1. Install dependencies - `npm install`
1. Add environment variables (see *server/_config.js*)
1. Start the Mongo server
1. Run server - `nodemon`
1. Test - `mocha`
1. Coverage - `npm coverage`
1. Coverage report - `open coverage/lcov-report/index.html`

## Development Workflow

1. Create feature branch
1. Develop/test locally (hack! hack! hack!)
1. Create PR, which triggers Travis-CI
1. After tests pass, merge the PR
1. Tests run again on Travis-CI
1. Once tests pass, code is deployed automatically to staging server on Heroku

> Make sure to add tests with each PR. Your PR must **not** decrease the test coverage percentage.

## Features & Functionalities

* **Github authentication**
  * Sign-in code to limit to those who are at the event

* **Realtime feed of commits, pull requests, merges, new repo's, who's just joined**
  * Github API
  * Distinguish each with a different style because there will be a ton of commits, a bit more pull requests, and only a few merges
  * Throttle commits? i.e. not show ALL commits, just some
  * Anything else we want to show in the Github feed?

* **Integrate Twitter feed to allow guests & coders to Tweet**
  * Twitter API
  * Distinguish the host's posts

* **Personalization (save these to database)**
  * The hackathon host can create a title for the feed and upload a logo
  * Allow host to set a time to open the feed and to close it?

* **Sound effect on update**
  * Option to turn up or mute

* **Infinite scroll**

* **Show recent activity since last login**

* **Data visualization**
  * Number of Github commits / pushes per repo
  * d3
  * Convert the data visualization into images that the host can later use for social media, PR, etc.

* **Open/close settings**
  * Allow host to set a time to open the feed and to close it?

## Stack

* Issue Tracker: Github Issues
* Build System: Grunt, Gulp
* Testing: Mocha, Chai, Travis, Istanbul (coverage)
* Language Runtime: ES5
* Package Mgmt: npm, browserify
* Utility: Underscore
* Async: Bluebird
* Server: Node, Express
* Realtime: SocketIO
* Database: MongoDB/Mongoose
* Front End: Angular
* CSS Framework: Bootstrap
* CSS Preprocessor: Sass
* Templates: [Swig](http://paularmstrong.github.io/swig/)

gha_language: JavaScript


text:
Lahman Database Loader - Node.js
=========

This is a project to create a Node.js utility to load data from the Lahman Baseball Database source files into a variety of databases.

This is a work in progress, but the first three I intend to look at are (in order):
* MongoDB (Yes, I'm aware of mongoimport)
* MariaDB/MySQL
* Postgres

The home of and source data for the Lahman Database can be found here: http://www.seanlahman.com/baseball-archive/statistics/

repository: cdalzell/lahman-dataloader-nodejs

repo_name: cdalzell/lahman-dataloader-nodejs


text:
# RISC-V Processor

This is a verilog code for a 5-stage pipelined RISC-V Processor with forwarding functionality. Here is the circuit diagramme of the processor.

![The circuit diagramme of the processor.](CircuitDiagramme.png)

## Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

### Prerequisites

For simulation purpose, you can install ```ModelSim``` or any other simulation tool that supports Verilog HDL.

### Installing

Once you have ```ModelSim``` launched, change your working directory to this project's directory using the following command in transcript window.

```
cwd "[/path/to/directory]/PipelinedProcessor"
```

And run the simulation by running

```
do run.do
```

After the simulation ends, you can see the simulation waves in the simulator. You can also change the hard-coded instructions from ```Instruction_Memory.v```.

**Note**: Do not check the dependency of a load instruction result on the next instruction, as the architecture does not support stalling.

## License

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

## Acknowledgments

* Habib University for the course on Computer-Architecture
* @hasanbaig for step-by-step well-formatted excercises to build this circuit.


text:
# MountISO.Wmi
Native Windows command line utility to mount an ISO image file, making it appear as a normal disk.

```
MountISO [-?] [-v] -m | -d | -q [drive:][path]filename
  [drive:][path][filename]
                 Specifies path to the ISO file to perform the action on.

  -?             Show this help information.
  -v             Switches on verbose mode to display additional debug information.
  -m             Mounts a previously created ISO disk image, making it appear as a normal disk.
  -d             Dismounts an ISO disk image so that it can no longer be accessed as a disk.
  -q             Gets the drive letter for a previously mounted ISO disk image.
```

If an ISO file is successfully mounted the program's exit code (ERRORLEVEL) is set to the numeric value of the drive letter e.g. 70 = F

The undocumented environment variable %%=ExitCodeAscii%% can then be used to get the ASCII drive letter for the mounted ISO file.

## Example usage:
```bat
@SETLOCAL
@SET INPUT=LOREM_IPSUM.iso
MountIso -v -m %%INPUT%%
@IF ERRORLEVEL 255 @GOTO :END
@SET ISODRVLETTER=%%=ExitCodeAscii%%
@IF \"%%ISODRVLETTER%%\"==\"\" @GOTO :END
@SET ISODRIVE=%%ISODRVLETTER%%:\\
@ECHO.
@ECHO The ISO file %%INPUT%% has been mounted to drive %%ISODRVLETTER%%
@ECHO.
DIR %%ISODRIVE%%
@ECHO.
@ECHO.
@ECHO Ready to Dismount ISO file
@PAUSE
MountIso -d %%INPUT%%
:END
@ENDLOCAL
```


text:
# Liquidity Migrator

The Liquidity Migrator is a smart contract that allows seamlessly swapping the liquidity from one pool to another.

Please follow https://research.soar.fi/liquidity-migrator for detailed information about the mechanism.

repository: soarfi/liquidity-migrator

repo_name: soarfi/liquidity-migrator


text:
# yaclamp [![build status](https://travis-ci.org/kankje/yaclamp.svg?branch=master)](https://travis-ci.org/kankje/yaclamp)

Yet another multi-line clamping package.

Instead of checking element height, we check for width and attempt to re-create the wrapped lines the user sees.

During my tests, yaclamp has been around ~90% faster than [Clamp.js](https://github.com/josephschmitt/Clamp.js) and [shave](https://github.com/dollarshaveclub/shave) when clamping 100+ elements.

## Limitations

- depends on jQuery (though this could be fixed quite easily)
- assumes all elements have the same width and font
- truncates text at the last letter that fits instead of the last word (words can get split)
- requires canvas support (`CanvasRenderingContext2D.measureText`)
- doesn't use `-webkit-line-clamp` even if it's supported

## Usage

```css
.clamp-me {
  margin-bottom: 10px;
  width: 100px;
  font-family: Arial;
  font-size: 12px;
  font-weight: 400;
}
```

```html
<div>
  <div class="clamp-me">Fits single line</div>
  <div class="clamp-me">This sentence fits two lines</div>
  <div class="clamp-me">This is a longer sentence that should be split on four lines</div>
</div>
```

```js
import clamp from 'yaclamp';

clamp('.clamp-me', 2, '...');
```

repository: kankje/yaclamp

repo_name: kankje/yaclamp


text:
<img src="https://lh3.googleusercontent.com/bz_JPiqlFe9X8lGuJD5FhqVkuJ3cOKsMx55ODC7YU-gKt1Jon59V5lV88bxEHEMEXA=w300-rw" height="150" width="auto">

# SeeFood

Hot dog or not Hot dog. Image ML inspired by Silicon Valley Season 4 Hot dog app

Watch the clip here!
https://www.youtube.com/watch?v=ACmydtFDTGs

## Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

### Prerequisites

Have Xcode 9 and above

## Built With

* [Inception v3](https://developer.apple.com/machine-learning/) - Learning Model Used
* [CoreML](https://developer.apple.com/machine-learning/) - Framework

## Contributing

Please read [CONTRIBUTING.md]() for details on our code of conduct, and the process for submitting pull requests to us.

## Authors

* **Johnathan Chen** - *Initial work* - [Github](https://github.com/johnathanachen)

## License

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

## Acknowledgments

* Supreme Pizza

repository: johnathanachen/SeeFood

repo_name: johnathanachen/SeeFood


text:
# ![Tensor Comprehensions](docs/source/_static/img/tc-logo-full-color-with-text-2.png)

# Using Tensor Comprehensions with PyTorch

A **blogpost** on Tensor Comprehensions can be read [here](https://research.fb.com/announcing-tensor-comprehensions/).

Tensor Comprehensions (TC) is a framework agnostic library to *automatically* synthesize high-performance machine learning kernels. TC relies on `Halide's` intermediate representation to express computation and analysis tools to reason about it. TC uses `polyhedral` compilation techniques to (semi-)automatically decide how to perform this computation efficiently on and produce fast code.

**Disclaimer:** Polyhedral compilation is an active research area, new results may affect TC performance and/or behavior

We provide integration of Tensor Comprehensions (TC) with PyTorch for both training
and inference purposes. Using TC, you can express an operator using Einstein notation and get the fast CUDA code for that layer with a few lines of code. By providing TC integration with PyTorch, we hope to make it further easy to write new operations with TC. Here is what the PyTorch-TC package provides:

- inputs and outputs to functions are `torch.*Tensor`s
- Integration with PyTorch `autograd`: if you specify forward and backward functions, you get an autograd function that takes `Variable` as input and returns `Variable` as output.
- autotuner results can be cached to a file (for reuse)

## Installation

To make it easy to use TC, we provide conda packages for it. Follow the instructions at our documentation [here](https://facebookresearch.github.io/TensorComprehensions/framework/pytorch_integration/getting_started.html#installation) for installing the PyTorch TC package.

## Examples and Documentation

In order to explore Tensor Comprehensions (TC), there are few helpful resources to get started:

1. We provide **examples** of TC definitions covering wide range of Deep Learning layers. Please look at `test_python/layers/` for various layers definitions.

2. [TC Documentation](https://facebookresearch.github.io/TensorComprehensions/index.html)
is a very helpful resource to understand how Tensor Comprehensions are expressed. The sections on
[introduction](https://facebookresearch.github.io/TensorComprehensions/introduction.html),
[range inference](https://facebookresearch.github.io/TensorComprehensions/inference.html),
[semantics](https://facebookresearch.github.io/TensorComprehensions/semantics.html), [mapping_options](https://facebookresearch.github.io/TensorComprehensions/mapping_options.html) are particularly helpful to get insights into writing Tensor Comprehensions.

3. **Autotuner**: TC provides an evolutionary search based algorithm to automatically tune the kernel.
You can read briefly about autotuner [here](https://facebookresearch.github.io/TensorComprehensions/framework/pytorch_integration/autotuning_layers.html) and look at various tests at `test_python/layers/test_autotuner.py`.

4. To construct a TC autograd function, `test_python/layers/test_convolution_train.py` is one self-descriptive example.

### A simple Example

```python
import tensor_comprehensions as tc
import torch
lang = """
def matmul(float(M,N) A, float(N,K) B) -> (output) {
  output(i, j) +=! A(i, kk) * B(kk, j)
}
"""
# The name should match the name of the "def" in "lang"
matmul = tc.define(lang, name="matmul")
mat1, mat2 = torch.randn(3, 4).cuda(), torch.randn(4, 5).cuda()
out = matmul(mat1, mat2)
```

**NOTE:** Performance of above kernel will be bad in this case because the mapping options were not chosen and the autotuning was not applied. See the documentation for how to supply mapping options properly.

repository: facebookresearch/TensorComprehensions

repo_name: facebookresearch/TensorComprehensions


text:
# webpack
## 学习资源
* [Webpack傻瓜式指南（一）](https://zhuanlan.zhihu.com/p/20367175)
* [Webpack傻瓜指南（二）开发和部署技巧](https://zhuanlan.zhihu.com/p/20397902)
* [Webpack 初學者教學課程](https://github.com/neighborhood999/WebpackTutorial/tree/master/zh-TW/)
* [webpack examples](https://github.com/webpack/webpack/tree/master/examples)
* [list-of-plugins](http://webpack.github.io/docs/list-of-plugins.html)
* [webpack gitbook](https://wohugb.gitbooks.io/webpack/content/)

repository: mygithut/front-end-note

repo_name: mygithut/front-end-note


text:
[![build status](https://img.shields.io/travis/gcanti/io-ts/master.svg?style=flat-square)](https://travis-ci.org/gcanti/io-ts)
[![dependency status](https://img.shields.io/david/gcanti/io-ts.svg?style=flat-square)](https://david-dm.org/gcanti/io-ts)
![npm downloads](https://img.shields.io/npm/dm/io-ts.svg)
[![Minified Size](https://badgen.net/bundlephobia/minzip/io-ts)](https://bundlephobia.com/result?p=io-ts)

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

- [Installation](#installation)
- [Documentation](#documentation)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

# Installation

To install the stable version:

```sh
npm i io-ts fp-ts
```

Note: [`fp-ts`](https://github.com/gcanti/fp-ts) is a peer dependency for `io-ts`

# Documentation

- [API Reference](https://gcanti.github.io/io-ts/docs/modules)

## Usage

**Experimental features** (version `2.2+`)

- [`Decoder`](Decoder.md)
- [`Encoder`](Encoder.md)
- [`Codec`](Codec.md)
- [`Schema` (advanced feature)](Schema.md)

**Stable** (old)

- [`Type`](Type.md)


text:
Shrink Message Tray
===================

GNOME shell extension to reduce the height of the GNOME message tray.

Install
=======

```
git clone https://github.com/zeroepoch/gnome-shell-extension-shrink-message-tray.git \
<EMAIL_ADDRESS>```