text:
# Using TypeScript Project References with ts-loader and webpack

Project References were added to TypeScript in 3.0. The benefits of using project references include:

* Better code organisation
* Logical separation between components
* Faster build times

If you are using TypeScript in your web project you can also use project references to improve your code and build workflow. This article describes some of the ways to set up your project to use references. I am using ts-loader to transpile the TypeScript code to JavaScript and webpack to bundle code.

An example repo using the configuration above is available at the link below:

[https://github.com/appzuka/project-references-example](https://github.com/appzuka/project-references-example)

There are 2 stages to using project references in your project:

1. Configure and build the project references
1. Setup your codebase to consume the compiled projects

To gain an understanding of how project references work, for the first part of this guide we will use tsc to build the project references.  Later on, we will configure ts-loader to do this automatically.

### Configure and build the project references

This stage just involves following the directions from the TypeScript documentation:
[https://www.typescriptlang.org/docs/handbook/project-references.html](https://www.typescriptlang.org/docs/handbook/project-references.html)

There are a few points to note:

1. Referenced projects must have the new composite setting enabled.
1. Each referenced project has its own tsconfig.json
1. There will be a root level tsconfig.json which includes the lower level projects as references. Building this will build all subprojects.
1. You should be using configuration file inheritance ({ “extends”: …}) to avoid duplication in your config.
1. You need to use tsc --build to compile the project.
1. When you compile the project tsc --build will create a file called tsconfig.tsbuildinfo that contains the signatures and timestamps of all files required to build the project. On subsequent builds TypeScript will use that information to detect the least costly way to type-check and emit changes to your project.
1. There is no need to use the incremental compiler option. tsc --build will generate and use tsconfig.tsbuildinfo anyway.
1. If you delete your compiled code and re-run tsc --build the code will **not** be rebuilt unless you also delete the tsconfig.tsbuildinfo file. Use the tsc --build --clean command to do this for you.

1. If you set the declaration and declarationMap settings in tsconfig.json the outDir folder will contain .d.ts and .d.ts.map files alongside the transpiled JavaScript. When you consume the compiled project you should consume the outDir folder, not the src. Even though your root project is in TypeScript it can use full syntax checking without the subproject’s TypeScript source because the outDir folder contains the definitions in the .d.ts file. Vscode (and many other code editors and IDEs) will be able to find the definitions and perform syntax checking in the editor just as if you were not using project references and importing the TypeScript source directly.

### Project Structure

The TypeScript implementation of project references allows you to structure the project in almost any way you wish. Just configure the input and output folders in tsconfig.json to your needs and TypeScript will build it for you.

For a web project you might like a structure similar to the one below. You could put all your project references in a packages folder with the top-level project code in src:
```
    tsconfig.json
    tsconfig-base.json
    src
     - (source code for the main project)
    dist
     - main.js (final bundle produced by webpack)
    packages
     - reference1
       - tsconfig.json (inherits from tsconfig-base.json)
       - src
       - lib
     - reference2
       - tsconfig.json (inherits from tsconfig-base.json)
       - src
       - lib
```
Each project reference has its own tsconfig.json with the source code for each package in a src subfolder. When the project is built the compiled JavaScript for each project will be in its lib subfolder.

The source code for your main project is in a top-level src folder and the final bundle will be in a top-level dist folder. The top-level src folder is not a referenced project — it is normal TypeScript source that webpack will bundle. It imports from the lib folders of the referenced projects built by tsc.

This structure works well because:

* Having packages grouped together under a packages folder organises your codebase nicely.
* Other tools such as yarn workspaces and lerna use and understand this organisation.
* Each package is fully self-contained in its own folder. It contains the source, compiled code, tsconfig.json and (optionally) its own package.json which describes how the package is used.
* You can drop the package into another project, import it with a simple statement and everything will be linked up.

This is just one way to structure your project. Some other options include:

* Not putting the projects references in a packages folder. They could all be at the top level, or a different folder, or nested folders.
* The output folder of each project does not have to be in a lib folder of that project. You could have a top-level lib folder which contains the output of all projects.

Almost any structure is compatible with project references. You have freedom to specify the paths of the referenced projects and their outputs in the tsconfig.json files. You will import the compiled JavaScript files into the main project and some structures make this easier than others, but you have the freedom to choose what works for you.

### Test Build your Projects

You should now check that the building of the projects is successful and produces the code you expect.

In each project reference folder execute tsc --build, check there are no errors and the output is as you expect. Use tsc --build --clean to remove the output and repeat. You can use tsc --build --verbose to see what tsc is doing.

If you have a top-level tsconfig.json similar to:
```
    {
      "files": ["src/index.ts"],
      "references": [
        { "path": "./reference1" },
        { "path": "./reference2" }
      ]
    }
```
Then executing tsc --build in the top-level will compile all of your subprojects with one command. The build process is smart and can manage dependencies between subprojects.

In the final step of this guide we will get ts-loader to do the build automatically when called from webpack, but for now, just make sure that the build process works when using tsc --build manually.

### Setup your codebase to consume the project

Now your subprojects are built you can use them in your root project. Let’s say your reference1 project exports a number:
```
    // packages/reference1/src/index.ts

    export const Meaning = 42;
```
After building the reference with tsc --build the compiled JavaScript will be found in packages/reference1/lib/index.js. In your root project you need to import this. There are several ways you can do this. Let’s start with a naive approach that will work but has severe downsides:
```
    // src/index.ts

    // Don't do this!
    import { Meaning } from '../packages/reference1/lib';
```
This will work because TypeScript and webpack will both find the file. The downsides are:

* The organisation of your root project and components are now intertwined. If you change the internal structure of your subproject you will need to update every import statement in the entire project.

* The import location will depend on the location on the source file. For example, if you want to do the same import from a subfolder in your root project you will need to replace ../packages/reference1/lib with ../../packages/reference1/lib. If you re-organise your project structure you will need to fix every import.

The solution to this is module resolution — how TypeScript and webpack resolve the targets of import statements. You can read about this at the links below:

* [https://www.typescriptlang.org/docs/handbook/module-resolution.html](https://www.typescriptlang.org/docs/handbook/module-resolution.html)
* [https://webpack.js.org/concepts/module-resolution](https://webpack.js.org/concepts/module-resolution)

Module resolution is nothing new and it is not part of project references, but understanding it will be a huge help getting everything working. Some points to note:

* TypeScript and webpack can use different methods to resolve modules. It will help if you can set them up so they are using the same method. (See the example below using alias in webpack and/or tsconfig-paths-webpack-plugin.)
* Resolution works differently for relative (./reference1) and absolute (reference1) imports.
* TypeScript has 2 strategies for module resolution: classic and node. You probably want to use node.
* You can use a webpack plugin tsconfig-paths-webpack-plugin so that you just need to define paths in your tsconfig.json and then don’t need to repeat these in your webpack config.

Using the example above, we would like to just import from packages/reference and have TypeScript and webpack both know that this refers to the actual location.
```
    // src/index.ts

    // Better!
    import { Meaning } from 'packages/reference1/lib';
```
We can achieve this using the paths configuration in tsconfig.json (or better, in tsconfig-base.json so the settings are made once and inherited by all projects):
```
    {
      "compilerOptions": {
        "baseUrl": ".", // This must be specified if "paths" is.
        "paths": {
          "packages/*": ["packages/*"]
        }
      }
    }
```
Now TypeScript understands that when it sees packages/reference1 in an import statement, it should look in ./packages/reference1. The path is relative to the root tsconfig.json so it does not matter where the source file which imports this is located.

Unless you are using tsconfig-paths-webpack-plugin you may need to include a corresponding resolve-alias setting in your webpack.config.js:
```
    const path = require('path');

    module.exports = {
      modules: [
        "node_modules",
        path.resolve(__dirname)
      ],
      resolve: {
        alias: {
          packages: path.resolve(__dirname, 'packages/'),
        }
      }
    };
```
(In this case the path.resolve(__dirname) in the modules section accomplishes the same thing, but depending on your project structure you may need an alias.)

If you are getting module not found errors when you build, knowing whether these are coming from TypeScript or webpack will help you to resolve the issue.

Errors which come from TypeScript when you build the project look similar to the following:
```
    ERROR in ...project-references-demo/src/index.tsx
    ./src/index.tsx
    [tsl] ERROR in ...project-references-demo/src/index.tsx(1,27)
          TS2307: Cannot find module 'mypackages/zoo' or its corresponding type declarations.
```
Note the [tsl] in the message and also the TypeScript error code TS2307. This indicates that the error was passed to webpack by ts-loader when it tried to transpile the file. You can also check whether errors are coming from TypeScript by building your project manually with tsc and checking whether it reports errors.

Errors from webpack look similar to the following:
```
    ERROR in ./src/index.tsx
    Module not found: Error: Can't resolve 'mypackages/zoo' in '...project-references-demo/src'
     @ ./src/index.tsx 6:12-37
```
If you just get these errors it indicates that tsconfig.json is correctly configured and TypeScript is able to resolve your modules, but webpack is not. Look into the resolve section of webpack.config.js and check whether you need to add an alias.

You can use module resolution to make your project work with project references even if your structure is very different from that outlined here. As long as webpack and TypeScript can find the built code it will work.

### Can you import the TypeScript Source instead of the JavaScript?

You can import the TypeScript source from your projects, but you probably should not. If you do set up your project to import the TypeScript, webpack will bundle your project just fine, but then you are not using project references. You have succeeded in organising your codebase but you are not getting the advantage of reducing build time by using the compiled files in lib. In fact, you are slowing down your build by requiring tsc or ts-loader to build the reference and then not using it.

If your project is large you could see a significant benefit from pre-building large sections of code. If your project is not so large you may prefer to just structure your codebase and skip project references.

### Using ts-loader to build project references

Up to this point, we ran tsc --build on its own and then used webpack and ts-loader to build the whole project, importing the references. You can configure ts-loader to build the references for you, which simplifies the build process.

The top-level project in src is TypeScript code, so you will already be using ts-loader to load the TypeScript source into webpack. Just add projectReferences: true to the ts-loader configuration and you no longer need to run tsc in a separate process:
```
    // webpack.config.js

    "module": {
      "rules": [
        {
          "test": /\.tsx?$/,
          "exclude": /node_modules/,
          "use": {
            "loader": "ts-loader",
            "options": {
              "projectReferences": true
            }
          }
        }
      ]
    }
```
When webpack uses ts-loader to process a TypeScript file ts-loader will now check whether any of your project references need rebuilding and rebuild them before webpack proceeds if necessary. This includes when webpack is in watch mode as used by webpack-dev-server.

Setting projectReferences: true in ts-loader alone will not magically convert your code to use project references. All it does is to run tsc --build as part of the build process. You need to configure project references and structure your project to use them as described here.

If you have come this far congratulations — you are now using TypeScript project references in your web project. You can stop here, but in the next section of this guide there are some tips to clean up the project further and create a library of reusable, version-controlled components.

### Using package.json

We can clean this up further by including a package.json in the project reference subfolder. If this contains the following:
```
    //packages/reference1/package.json

    {
      "name": "reference1",
      "version": "1.0.0",
      "description": "Project Reference1",
      "main": "lib/index.js",
      "directories": {
        "lib": "lib"
      },
      "license": "ISC"
    }
```
then you can just import as follows:
```
    // src/index.ts

    import { Meaning } from 'packages/reference1';
```
The module setting in package.json tells the bundler to import from lib/index.js when it sees the import statement above.

### Using node_modules

In the above approach we need to add paths to tsconfig.json so that the module resolution knows where to find our package. But the module resolution system automatically looks in node_modules, so if we link our reference in node_modules we won’t need the paths and aliases:
```
    ln -s ../packages/reference1 node_modules/reference1
    node_modules/reference1 -> packages/reference1
```
It probably makes sense to use npm scopes:
```
    ln -f ../../packages/reference1 node_modules/@myscope/reference1
    node_modules/@myscope/reference1 -> packages/reference1
````
then you can consume the code with:
```
    // src/index.ts

    import { Meaning } from '@myscope/reference1';
```
So you benefit from not having to configure paths and aliases, but you need to create the links in node_modules after cloning the project, unless you use Yarn workspaces.

### Using Yarn Workspaces

If you use yarn workspaces the node_modules links will automatically be created for you when you execute yarn install. Simply include the following in your root level package.json:
``
    {
      "private": true,
      "workspaces": ["packages/*"]
    }
``
In the subproject’s package.json you should use the name of the package you want to be linked in node_modules:
```
    //packages/reference1/package.json

    {
      "name": "@myscope/reference1",
      "version": "1.0.0",
      "module": "lib/index.js
    }
```
When you run yarn install the links in node_modules will be created for you.

You can now use your project references anywhere in your codebase with a simple import statement, exactly like you import npm modules. If you have a more complex application, for example with client and server applications, you can share modules easily.

### Building a Component Library

A common problem in code organisation is how to re-use code in multiple projects. Project references help toward this goal by providing a logical separation between components. This will mean you can drop a component into another project and use it. But there is still the matter of how you do this:

* You could copy the project reference folder into all top-level projects you want to use it in. This has the disadvantage that you end up with multiple copies of code. If you patch or enhance a component you need to copy the patch to all the other projects, rebuild them and test.
* Another approach would be to symlink the component into each top-level project. The downside of this is that once you amend the component you could break all of the projects which depend on it.

A smarter solution is to publish the components as npm packages. You can use semantic versioning each time you publish using a version in the format major.minor.patch. You then add the components to other projects using yarn add @myscope/reference1.

Versioning works exactly the same as any other npm package. You specify in the consuming project’s tsconfig.json what version changes are acceptable:
```
    "@myscope/reference1": "1.0.1",   // Only version 1.0.1 can be used
    "@myscope/reference1": "~1.0.1",  // Patch updates are acceptable
    "@myscope/reference1": "^1.0.1",  // Minor version changes are OK
```
You can then update and publish new versions of the component with new version numbers. The other project will not be broken as it will continue to use the version specified in its package.json. When you are ready to update you can use the same yarn tools you would use to update any package (yarn outdated / upgrade / upgrade-interactive or the npm equivalents).

If you want to keep your packages private you can set up your own private npm repository with [Verdaccio](https://verdaccio.org/) or you can use [Github Packages](https://github.com/features/packages)

### Lerna

If your project references are complex and have their own scripts for testing and building you could use [Lerna](https://lerna.js.org/). This works well with yarn workspaces and the project structure outlined above. If you have a test script in reference1 you could use the following command to execute it:
```
    lerna run --scope=reference1 test
```
The same command without the --scope argument would execute the test scripts in all subprojects.

Yarn workspaces and Lerna introduce more power but also more complexity in the workflow. They are not required to use project references so it is up to you whether the extra learning curve they introduce is worthwhile.

### Build Times in Development

Using ts-loader and webpack-dev-server, when you change a file in one of the project references ts-loader will automatically rebuild the reference and include the change in the new bundle. Rebuilding the reference may take a few seconds. By comparison, when you change a file in the root source (non-reference) webpack will get ts-loader to rebuild just that file and create a new bundle very quickly, typically less than 1 second.

So if you are developing code in a reference and find the few seconds it takes to rebuild the reference too much, you could benefit from importing from the TypeScript source directly. This will be at the expense of longer warm start times as you will not be using the pre-built code for that referenced project.

repository: TypeStrong/ts-loader

repo_name: TypeStrong/ts-loader


text:
# BacterioPop
Population dynamics for abundances calculated from meta-omics sequencing

 Project Background:
* 88 samples: 4 replicates of high oxygen, 4 replicates of low oxygen, and 11 samples per replicate.
* Sequenced for 11 weeks:  week 4 - 14.
* Oxygen conditions were switched for the last 4 samples.
* Organisms "phylogeny" is described by: Kingdom, Phylum, Class	Order, Family, Genus

 Technology Review:
* [Tehcnology Review Presentation](https://docs.google.com/presentation/d/1D-DkrJsDJCglwkg9zL4Mdhlwke5hMF6LYhDwvJKBrQc/edit?ts=56ce5662#slide=id.g11bd0970be_0_17)

 Directory Structure:

 Why we chose the Apache License 2.0:

The Apache License allows us to manage the software package as we please, while providing clear language regarding the terms. It makes it clear that individual contributors grant copyright license to anyone who receives the code, that their contribution is free from patent encumbrances (and if it is not, that they license that patent to anyone who receives the code,) and that use of Trademarks extends only as far as is necessary to use the product. It also includes a patent termination clause, should a lawsuit arise. The Apache licenses encourage open-source development and our software is made better by every person who runs it, files tickets about it, or patches it. This is invaluable contribution – each user is given freedom and respect from the other members of the developer community.

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
---
title: IncreaseSkill
searchTitle: Lua Client IncreaseSkill
weight: 1
hidden: true
menuTitle: IncreaseSkill
---
## IncreaseSkill
```lua
Client:IncreaseSkill(number skill_id, number value); -- void
```

license: MIT

repository: xackery/eqquestapi

repo_name: xackery/eqquestapi


text:
---
layout: post
title:  "Van Den Berg's Thesis "
date:   2019-07-06
excerpt: "Summary of interactions"
image: "https://images.unsplash.com/photo-1505739818593-e7506ebf74c0?ixlib=rb-1.2.1&auto=format&fit=crop&w=1050&q=80"
tag:
- Personal
---
Member PRIV - MLC - RBR - vTQXABXA545*

Context:

Explanation of different wing heights for the dual airfoils - interactions between the wheels.
Parameters explored:

- Ground effect
- Separation and Stagnation points.
- Oil flow analysis

D. Jacques contributions:
- Difference between PIV [Where results are taken from numerous methods] SRANS (Steady Reynolds Averaged Navier-Stokes) &  DES (Detached Eddy Simulation). DNS and RANS have been excluded from the simulation as the object is dynamic in nature.

## Application into F1 Aerodynamics 2021
- Front wing simplification due regulation. Heavy investigation into turbulent flow.
  - Turbulent flow is reduced so that cars are more likely to overtake - 'Dirty air' used to great advantage by Mercedes but loses interest in the sport.
  - DRS may be modified but not in scope of Van den Berg's research.
- Front wing Stagnation effects due regulation, not limited to simplification.
- Adjusting the Front Wing heights for better ground effect and competition, turbulent flow will be dissipated due to a obstacle between high pressure and low pressure areas.
- Wheel profile adjustments so that the ratio of factors that determine the suspension system are rekeyed directly - and is less reliant on the effects of profile deformation performable by the wheel and obstacle.
- Aerodynamical principles exaggerated concerning tyre wake - profile heavily reduced + camber reduction.
- Reduced vortex generation for bluff bodies, as these bodies have a strong disperse effect.

## Re-introduction of the 2021 Ground effect
It is beyond confident, without a doubt that the FIA will re-introduce the ground effect system into Formula One to increase competitive factors (which may subsequently allow for the removal of the dynamic DRS system).

The ground effect was proven to be inconsistent if there existed irregularities in the track. Ground effect was always nullified due to the sudden change of the ground plate when suspension is active.

**This created a potential danger to drivers when irregularities existed near bends** because due the nullification of the ground effect - a large amount of critical downforce will be subsequently lost which is crucial and paramount for the driver when controlling steering factors at bends - the driver may go offtrack as a result.

2021 poses a different approach to the ground effect by creating vanes that secure the airflow and Venturi effect to the bottom of the vehicle - exclusive to the effects of the suspension system. These vanes are directly connected to the suspension vane and do not oscillate with the vehicle when track irregularities occur.

### Disambiguation

In aviation, 'ground effect' occurs when the aircraft wings are close to a fixed surface - generating increased lift and reduced aerodynamic drag.

This is because when the wing is closer to the ground, vortices are interrupted by the ground and therefore reduce in size through dissipation. Downwash is reduced.

**Downwash** is a additional effect on lift for wings in aviation - the pressure differences caused by the "contour of the wing" as mentioned before will produce vortices.

The downstream component of the force is called **induced drag** because it has been "induced" by the action of the tip vortices.

It is important to note that lift is generally perpendicular to the direction of the relative flow of wind because as downwash 'induces' the relative flow downwards, the angle of which lift is affected. For a inverted wing, having the wing as low as possible will induce such effect and produce a downforce component in the direction of the Z plane.

Therefore: **A lower induced drag and lower downwash will create a greater lift vector.** Due to the angle of downstream component.

Van Den Berg's thesis heavily explores the interaction between the ground effect phenomenon and different wing heights and is worthy to read for additional knowledge.
>Generally, induced drag is greater at altitudes - as induced drag is reduced at lower altitudes.

## Interaction of the Ground Effect iss. 2005.

This section is in context of the 2005 F1 Regulation, an application & evaluation of the ground effect system.

The issue with the ground effect in 2005 (where redacted) was due to the irregular amount of downforce being presented at different part of track sessions - Say for an exaggerated example that a city circuit such as Baku had uneven road surfaces, there would be a conclusion that irregular, unexpected downforces were experienced at different stages of the track.

This became a large issue during uneven road surfaces at sharp turns - as a sudden loss of downforce (therefore a reduced grip on the ground) would often put cars into a spiral. This resulted in a lot of safety issues as several injuries occurred over a timespan of a few months. The FIA was left no choice but to immediately ban the use of ground effect.

For 2021 regulations the approach is to introduce a object attached directly to the suspension system to maintain as much as the airflow during track irregularities - therefore such characteristics associated with downforce were kept under control :

### Turning vanes

Characterised as thin, angular and long objects running along the outside of the floor of the vehicle.

These turning vanes attempt to eliminate or reduce the leakage that was originally caused in the 2005 ground effect model, as well as yield positive effects on the efficiency of the ground effect as a multiplier.

Additionally external influence would be reduced due to the availability and coverage of the turning vanes.

## Structural Implications

There were structural implications of the turning vanes, in order to maintain the aerodynamical efficiency of the turning vane as well as reduce weight - these vanes were created as very thin objects.

The attachment of the turning vane into the undercarriage prohibit any intrusions made into the undercarriage as deemed by technical regulations (for unknown purposes). This meant that the vanes must be a extrusion of the undercarriage-suspension system or glued onto the underbody of the car

To maintain integrity from the base of the turning vane (where attachment occurs), it is recommended during manufacturing to include a chamfer immediate to both planes. Manufacturing should also consider to create consistent break points where the production of the vane is vertical as to horizontal.

  Although such production scheme would take much longer to follow - the end result is that the vane would snap off smaller sections instead of larger sections - this meant that in a result of a consequence, the aftermath and effects would be reduced as much as possible to avoid an aerodynamical imbalance.

Turning vanes were exclusive

repository: EXYZED/AerodynamicalCollective

branch_name: refs/heads/gh-pages

gha_language: CSS

gha_license_id: MIT

repo_name: EXYZED/AerodynamicalCollective


text:
Save PowerShell script under Tools:
cp WinRE_RestoreBackup.ps1 $mountdir\sources\recovery\tools\.

Edit launch entry in $mountdir\Windows\System32\winpeshl.ini

For syntax on winpeshl.ini:
https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/winpeshlini-reference-launching-an-app-when-winpe-starts

[For orphaned mount points]
DISM /Cleanup-Mountpoints # Deletes all resources associated with a mounted image that has been corrupted.
DISM /Cleanup-WIM
DISM /UNMOUNT /DISCARD


text:
# Zygosaccharomyces pini Holst, 1936 SPECIES

#### Status
SYNONYM

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

#### Published in
Journal of Agricultural Research 53(7): 515 (1936)

#### Original name
Zygosaccharomyces pini Holst, 1936

### Remarks
null

repository: mdoering/backbone

path: /life/Fungi/Ascomycota/Saccharomycetes/Saccharomycetales/Pichiaceae/Ogataea/Ogataea pini/ Syn. Zygosaccharomyces pini/README.md

repo_name: mdoering/backbone


text:
# Bongodoo
Bongodoo is a memory game that revolutionizes the way young people think, recall events,sessions and people. It tackles aspects of leadership and the impact of leaders  to young poeople towards their success. It covers the wider scope of understanding and visualizing leadership impact to them by making them recall people, objects and instances around their geographic surroundings.

# Installation Guidelines.
This app works on android mobile devices and Android Things Kits.
To install this app on your phone :
Locate Bongodoo (It is a bundle file from android studio):
[Bongo Doo](https://github.com/bensalcie/Bongodoo/blob/master/IEEEMADC2019/app.aab)
or [Bongo Doo](https://drive.google.com/open?id=1BEv35Ey2b0Evsl-wfNJQjFNTDPsO6_rq),
in this repository and download it on your android device, then locate it on your phone and install it.

To install in on Android things :
 Clone or download the project , then import it into your android studio.
 Connect your android things kit and make sure it is updated correctly, the run the app via android studio by tapping 'RUN'

 # Promotional Video
 This application provides an opportunity to train your brain in the best manner possible by prompting you to identify the resemblace of the people who are close or near you, objects near you and so on.

  [![Bongo Doo -Demo video ](https://img.youtube.com/vi/VID/0.jpg)]( https://youtu.be/BXvrEdJ8Gq8)

The video above will show you how get started with the game, once installed on your phone and the various difficulties to help you challenge your mind.
 This includes:
  1. Home page with menus
  2. Privacy policy for components within the app
  3. About me
  4. Various levels for one to explore
  5. Game selection area

# Description
How often have we fallen into the norm of forgetting things in the young age?, In fact.. studies show that people aged 18 to 34 forget alot  (15%) than those above age 55(7%).  This has gone further into the levels of education and it is a mutation that had made the younger geneation of today not be too productive in schools. No more inventions ever exist, no more struggle as it were previously. This is the most fundamental reason as to why we came up with Bongo Doo application, that helps young people to think, enhance their brain and develope a bigger memory capacity.

Whats my goal here?

"Memory is a record of your personal experience. It is a record of trial and error, defeat and success. Past failures will warn you against repeating them. "
-Wilfred Peterson

Our goal here is to enhance the memory of young people in a diverse way, a way to help them see wrong and good. To be able to recall their mentors, leaders,successes and failures. 15% of young people are prone to forgetting more much in this current society. This has ntern led to low levels of perfonces in schools, a scenario where students rely too much on their tutors during and even reasoning. This, for a devoping country means :no future innovations, no future outgoers, no future brighter minds and inventors.Kenya being our area of study, we realized that majority young people dont actually know and recall there leaders, this then gives them a hard experience requesting for resource allocation and funding for their proposals.

Bongodoo overcomes this problem by engaging users of the application in a more interactive way, a way that helps these young people to see,evaluate, think and remember. This game gives each individual user a timing from 60 seconds, 120 seconds and 180 seconds depending on the level of difficulty involved as the user advances on various levels.

We look forward towards enhancing young peoples memory boost and more importantly be able to impact the nortion of them understanding and learning about leadership and leadership roles by thinking, remembering and solving prolems.

  # Screenshots

  # Disclaimer
  Bongo Doo is a product developed by Panthers. All the photos and libraries used are open source and are subject to change with requirements specifications.

  # License

Copyright (c) 2019 Benard Ngoda

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

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

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

## Contact information
For personal feedback or questions feel free to contact me via the mail address, which is mentioned on my [Github profile](https://github.com/bensalcie).
If you have found any bugs or want to post a feature request please use the [bugtracker](https://github.com/bensalcie/Bongodoo/issues) to report them.

#### Developer
* Homepage: [@Personal Portal](http://bensalcie.likesyou.org/)
* Twitter: [@ibensalcie](https://twitter.com/ibensalcie )

### Summary
| [Bongo Doo](https://github.com/bensalcie/Bongodoo/blob/master/IEEEMADC2019/app.aab) | Team Name: Panthers | Bongodoo is a memory game that revolutionizes the way young persons think, recall events,sessions and people. It tackles aspects of leadership and the impact of leaders  to young poeople towards their success | [LICENSE](https://github.com/bensalcie/Bongodoo/blob/master/LICENSE) | Kenya | [Benard Ngoda](https://github.com/bensalcie)

[![Open Source Love](https://badges.frapsoft.com/os/v2/open-source-200x33.png?v=103)](https://github.com/ellerbrock/open-source-badge/)

repository: IEEEmadC/IEEEmadC-wiki

repo_name: IEEEmadC/IEEEmadC-wiki


text:
[![CircleCI](https://circleci.com/gh/cybergoatpsyops/microservicesProject.svg?style=svg)](https://circleci.com/gh/cybergoatpsyops/microservicesProject)

## Deployment

environment setup
clone repo
git clone https://github.com/cybergoatpsyops/microservicesProject
cd microservicesProject

activate venv
python3 -m venv ~/.devops
source ~/.devops/bin/activate

make install

Other Libraries to Install

Docker
Hadolint
Kubernets (Minikube)

brew install hadolint
make lint

brew cask install minikube

./run_docker.sh
./upload_docker.sh

minikube start
./run_kubernetes.sh

minikube delete
minikube stop

## Built With

* [Visual Stuido Code](https://code.visualstudio.com/) - Code Editor
* [iTerm2](https://iterm2.com/) - macOS Terminal Emulator
* [AWS CLI](https://aws.amazon.com/cli/) - AWS Command Line Interface
* [Git](https://git-scm.com/) - Version Control System

## Contributing

Please read [CONTRIBUTING.md](https://gist.github.com/PurpleBooth/b24679402957c63ec426) for details on our code of conduct, and the process for submitting pull requests to us.

## Versioning

We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/your/project/tags).

## Authors

* **Billie Thompson** - *Initial work* - [PurpleBooth](https://github.com/PurpleBooth)

See also the list of [contributors](https://github.com/your/project/contributors) who participated in this project.

* **Leo B** - *Forked* -

## License

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

## Acknowledgments

TBD

repository: cybergoatpsyops/microservicesProject

gha_language: Python

repo_name: cybergoatpsyops/microservicesProject


text:
# Python Development Environment 2022 Edition [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome)

Just a collection of tips and tools to improve your python development
experience inspired by
[this blogpost](https://jacobian.org/2019/nov/11/python-environment-2020/).

Since the escape key is back, it's now possible to use macbooks as development
machines again. So I got one and had to redo my python development setup. After
some time I thought that I should write down the required steps, because
otherwise I would have to google this stuff all over again next time. After
some more time I thought that it might be a good idea to publish those steps.
Because I clearly have no clue what I'm doing and just asking for help wouldn't
be as effective as posting the wrong answer and waiting for a poor soul to take
the bait. So here we are :).

# macOS

The macOS specific stuff has a [page on it's own](macOS.md).

# Shell

## Package Manager

Using a package manager for your shell makes things a lot easier. You
can get [oh-my-fish](https://github.com/oh-my-fish/oh-my-fish) by typing:

```shell
$ curl -L https://get.oh-my.fish | fish
```

Update your packages and install one:

```shell
$ omf update
$ omf install bobthefish
```

Use a theme from [this list](https://github.com/oh-my-fish/oh-my-fish/blob/master/docs/Themes.md)
of available themes.

```shell
$ omf theme bobthefish
```

If you see strange character appearing in your prompt, you probably have to
installed a powerline patched font. You can install one line this:

```shell
$ omf install fonts
$ fonts install --powerline Inconsolata
```

Maybe you have to restart iTerm and change your font setting for your iTerm profile, too.

## Config

To start the web based fish configuration call:

```shell
$ fish_config
```

# Python

## Update Python

Make sure pyenv is up to date:

```shell
$ cd ~/.pyenv
$ git pull
```

Install pipx:

```shell
$ python -m pip install --user pipx
```

Install new python version:

```shell
$ pyenv install new.version.number
```

Uninstall virtualfish
```shell
$ vf uninstall
$ pipx uninstall virtualfish
```

Use new python version:
```shell
$ pyenv global new.version.number
```

Upgrade pipx
```shell
$ pipx upgrade-all
```

Maybe reinstall all if some interpreters are missing.
```shell
$ pipx reinstall-all
```

Install virtualfish
```shell
$ pipx install virtualfish
$ vf install compat_aliases projects environment auto_activation
```

## Outdated Stuff
Installing python on macOS (or any other OS I know of) is much more difficult
than you would expect. After using a mixture of system provided python, python
installed by homebrew and python installed by conda I finally settled
using [pyenv](https://github.com/pyenv/pyenv). With pyenv it's easy to install a lot of
different python versions. After that you are able to define which python
version should be used per directory. Even things like pypy or miniconda are
possible. Together with [pyenv-virtualenv](https://github.com/pyenv/pyenv-virtualenv) I
use it for my data science conda environments and my web development
virtualenvs. Environments are automatically switched by entering the respective
project directory:

When installing miniconda3-latest, make sure PYTHON_CONFIGURE_OPTS="--enable-framework"
is not set (you might need this for some vim plugins etc.) otherwise miniconda installation
will fail.

```shell
$ brew install xz pyenv pyenv-virtualenv
```

There should be something like this in .config/fish/config.fish:

```shell
    # pyenv / pyenv-virtualenv
    set -gx PYENV_ROOT $HOME/.pyenv
    set -gx PATH $PYENV_ROOT/bin $PATH
    status --is-interactive; and source (pyenv init -|psub)
    status --is-interactive; and source (pyenv virtualenv-init -|psub)
```

Use a recent python version as system python:

```shell
$ pyenv global 3.10.5
```

### Caveats

* pyenv shims are masking system commands (ffmpeg/ffprobe for me) - I found [pyenv-which-ext](get_rendition_or_not_found) helpful

## Using poetry for packages and dependency management

Install poetry:

```shell
$ curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python3
```

If you used pyenv to create your virtualenv, you have to activate it.
Otherwise poetry will create an own virtualenv on poetry install.

```shell
$ pyenv activate your_env
```

# Getting A Django Project Up And Running

## Database

At first you also have to install postgres via homebrew:

```shell
$ brew install postgresql
$ brew services start postgresql   # to have launchd start postgres
```

To simplify the creation of databases for my projects I created a little helper
fish function and put it into ~/.config/fish/functions:

```shell
function init_django_db
  set user $argv[1]
  set dbname $argv[2]
  dropdb $dbname
  dropuser $user
  createdb $dbname
  createuser $user
  psql -d $dbname -c "GRANT ALL PRIVILEGES ON DATABASE $dbname to $user;"
end
```

Recreating a database and user with access to this database is just a call to
this function:

```shell
$ init_django_db username dbname
```

## Environment Variables

There are usually a lot of environment variables that need to be set for each
project. I usually keep them in an .env file in the root project directory. Now
I only have to make sure those variables get set when I enter the projects
directory and this is done by the following function
in ~/.config/fish/config.fish:

```shell
# on pwd change look for env file and load it
function load_env --on-variable PWD
  if test -e .env
    export (grep -Ev '^\s*$|^\s*\#' .env)
  end
end
```

Yeah, I know about
[autoenv](https://github.com/inishchith/autoenv) and [direnv](https://direnv.net/),
but I'm also
using [python-dotenv](https://github.com/theskumar/python-dotenv) and need to
resolve some compatibility issues first.

## Virtualenv

You should now be able to just clone one of your old django projects from
github for example, create a new virtualenv and install the requirements:

```shell
$ pyenv virtualenv 3.8.1 venv_name
$ cd projects/project_name
$ pyenv local venv_name    # store the name of the venv you like to use for this dir in .python-version
$ pyenv virtualenvs        # check the right virtualenv is activated on entering project directory
$ pip install -r requirements/local.txt
```

Create the database and run the development server:

```shell
$ ./manage.py migrate
$ ./manage.py runserver <IP_ADDRESS>:8000
```

# Getting A Data Science Project Up And Running

To activate a conda environment automatically on entering a directory
containing an environment.yml file, I use a small function
in .config/fish/config.fish:

```shell
# on pwd change look for conda environment.yml and activate conda env
function activate_conda_env --on-variable PWD
  if test -e environment.yml
    pyenv activate (pyenv virtualenvs | grep miniconda | cut -d " " -f 3)
    conda activate (grep name environment.yml | cut -d " " -f 2)
  end
end
```

Setting up the virtual environment:

``` shell
$ pyenv activate miniconda3-latest
$ conda env create        # after creating an environment.yml
$ conda deactivate
$ cd
$ cd projects/project_dir
$ conda env list             # right environment should be activated
```

# Using fzf

[fzf](https://github.com/junegunn/fzf) is a really great tool, and the
most enjoyed recent addition to my toolbelt.

Install it with:

```shell
$ brew install fzf
/opt/fzf/install  # install useful key bindings and fuzzy completion
```

You can put some helpful environment variables in ~/.config/fish/config.fish:
```shell
# fzf
set -gx FZF_DEFAULT_COMMAND "fd --type f"
set -gx FZF_DEFAULT_OPTS "-layout=reverse --inline-info"
```

Here are some examples on how to use it:

```shell
$ vim (fzf)  # search for file and open in vim
$ history | fzf +s --tac  # search in history in reverse order and dont sort result
$ fzf --preview 'bat --style=numbers --color=always {} | head -500'  # use fzf with bat preview
```

## macOS quirks

On OS X, Alt-c (Option-c) types ç by default. In iTerm2, you can send the right
escape sequence with Esc-c. If you configure the option key to act as +Esc
(iTerm2 Preferences > Profiles > Default > Keys > Left option (⌥) acts as: >
+Esc), then alt-c will work for fzf as documented

# Fixing Vim

Use homebrew to install vim:

```shell
$ brew install vim
```

## Install Vundle

```shell
$ git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
```

List of vim plugins I like to use:

* [fugitive.vim](https://github.com/tpope/vim-fugitive) interacting with git from vim
* [jedi-vim](https://github.com/davidhalter/jedi-vim) autocompletion and code navigation
* [Command-T](https://github.com/wincent/command-t) fuzzy search/open files from vim
* [supertab](https://github.com/ervandew/supertab) configure <tab> behaviour
* [YouCompleteMe](https://github.com/ycm-core/YouCompleteMe) code completion engine
* [psf/black](https://github.com/psf/black) vim plugin for python formatting :BlackUpgrade to update

[Awesome list](https://vimawesome.com/) of vim plugins.

# Useful Command Line Tools
* [bat](https://github.com/sharkdp/bat)
* [tree](http://mama.indstate.edu/users/ice/tree/)
* [ripgrep](https://github.com/BurntSushi/ripgrep)
* [fd](https://github.com/sharkdp/fd)
* [fzf](https://github.com/junegunn/fzf)
* git-flow brew install git-flow
* [wget](https://www.gnu.org/software/wget/)
* [tldr](https://github.com/tldr-pages/tldr-cpp-client)
* [asciinema](https://asciinema.org/)
* [multitail](https://www.vanheusden.com/multitail/)
* [ntop](https://www.ntop.org/products/traffic-analysis/ntop/) (brew install ntopng)
* slurm brew install slurm
* [gitversion](https://github.com/GitTools/GitVersion)
* [gource](https://gource.io/)
* [pandoc](https://pandoc.org/)
* [tmux](https://github.com/tmux/tmux/wiki)
* [neofetch](https://github.com/dylanaraps/neofetch)

repository: ephes/awesome-python-devenv

branch_name: refs/heads/main

repo_name: ephes/awesome-python-devenv


text:
# PHP Chain
[![Build Status](https://travis-ci.org/ocrampete16/php-chain.svg?branch=master)](https://travis-ci.org/ocrampete16/php-chain)
[![StyleCI](https://styleci.io/repos/83728346/shield?branch=master)](https://styleci.io/repos/83728346)
[![Maintainability](https://api.codeclimate.com/v1/badges/5b1aa7f182ab817af568/maintainability)](https://codeclimate.com/github/ocrampete16/php-chain/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/5b1aa7f182ab817af568/test_coverage)](https://codeclimate.com/github/ocrampete16/php-chain/test_coverage)

An implementation of the _chain-of-responsibility pattern_ in PHP.

## Installation
```
composer require marcopetersen/php-chain
```

## Usage
```php
<?php

use MarcoPetersen\Chain\Chain;
use MarcoPetersen\Chain\Link;

// First we define the links that will be part of our chain...
class AddOne extends Link
{
    public function execute($number)
    {
        return $this->next($number + 1);
    }
}

class EndChain extends Link
{
    public function execute($payload)
    {
        return $payload;
    }
}

// ...after which we chain them up together.
$chain = (new Chain())
    ->then(new AddOne()) // you can pass in instances...
    ->then(AddOne::class) // ...or just the FQCN, if you prefer.
    ->then(EndChain::class) // To end the chain, just don't call `next`.
    ->then(AddOne::class) // This won't get called.

$chain->execute(1); // 3
```

extension: markdown

gha_language: PHP


text:
# velocileptors/LPT

The Lagrangian PT branch of the velocileptors code.

This code computes the real- and redshift-space power spectra and
correlation functions of biased tracers using 1-loop perturbation
theory (with effective field theory counter terms and up to cubic
biasing) as well as the real-space pairwise velocity moments.

For most situations computing the power spectrum wedges or multipoles
is as simple as:

```
from moment_expansion_fftw import MomentExpansion

mome        = MomentExpansion(klin,pklin,threads=nthreads)
kw,pkw      = mome.compute_redshift_space_power_at_mu(pars,f,mu,reduced=True)
kl,p0,p2,p4 = mome.compute_redshift_space_power_multipoles(pars,f,reduced=True)
```

The core rsd modules are:

(1) moment_expansion_fftw.py: this computes real- and redshift-space power
spectra using the moment expansion approach.

(2) gaussian_streaming_model_fftw.py: this computes real- and redshift-space
correlation functions using the Gaussian streaming model.

(3) fourier_streaming_model_fftw.py: this computes redshift-space
power spectra using the Fourier streaming model.

(4) lpt_rsd_fftw.py: this computes the power spectrum in redshift space via direct Lagrangian expansion.

All the models except (4) use velocity spectra from velocity_moments_fftw.py,
which itself inherits the real-space power spectrum module cleft_fftw.py. The model
in (4) is described in arXiv:XXXX.

For the most common case of computing the redshift-space power spectrum
one can use a a _reduced set_ of parameters and beyond_gauss=False:

pars = [b1,b2,bs,b3] +  [alpha0,alpha2,alpha4] +  [sn,sn2]

where

(1) b1, b2, bs, b3:  the bias parameters up to cubic order

(2) alpha0,alpha2,alpha4: counter terms of the form mu^n.

(3) sn, sn2: stochastic contributions to P_real(k) and sigma^2
    [e.g. shot-noise and finger-of-god dispersion].

---

If the beyond_gauss setting is True in (1)-(3) or if using (4), then the parameters are instead

pars = [b1,b2,bs,b3] +  [alpha0,alpha2,alpha4,alpha6] +  [sn,sn2,sn4]

However, for most purposes the extra parameters can be set to zero with little effect.

---

If you additionally want access to the velocity statistics, then the
full set of parameters is

pars = [b1, b2, bs, b3] +  [alpha, alpha_v, alpha_s0, alpha_s2] +  [sn, sv, s0]

where the parameters are:

(1) b1, b2, bs, b3: the bias parameters up to cubic order

(2) alpha, alpha_v, alpha_s0, alpha_s2: the one-loop counterterms
for each velocity component

(3) sn, sv, s0: the stochastic contributions to the velocities

Since the expansion for realistic samples is saturated at the third moment,
for most practical purposes one can set beyond_gauss = False, in which
case the code only uses up to sigma(k), and uses a counterterm ansatz
for the third and fourth moments. In this case the parameters
alpha_g1, alpha_g3, alpha_k2, and s4 are not used and can safely be set
to zero.

More details can be found in Chen, Vlah & White (2020).

---

This code is related to the configuration-space based code https://github.com/martinjameswhite/CLEFT_GSM.


text:
---
title: Timestamping
nav_order: 4
---

## Timestamping

Requests to private endpoints on the Binance API are required to have a timestamp parameter. Binance will check to see if the received timestamp of a request is within a certain timespan vs the Binance server time. The timespan of how much the timestamp parameter is allowed to  differ can be specified using the `recvWindow` parameter on requests to private endpoints.

Because not all computers have exactly the same time this mechanism can cause errors. If for example the client time is 2 minutes earlier than the server time the server will think the request was sent 2 minutes ago since (server time on receive - message timestamp = 2 minutes). This will make Binance reject the message.

To fix this the `AutoTimestamp` client options was introduced, which requests the server time and compares it to the local client time. The offset this produces will be used to offset the timestamp which is sent to the server in authenticated requests. This works 90% of the time.

Another option is to sync the operating system time more often. For Windows users have reported success using the SP TimeSync tool.

gha_language: C#


text:
---
title: "CVE-2020-1170 - Microsoft Windows Defender Elevation of Privilege Vulnerability"
layout: "post"
categories: "Windows"
tags: ["Research", "Vulnerability", "Privilege Escalation", "Exploit"]
---

Here is my writeup about [CVE-2020-1170](https://portal.msrc.microsoft.com/en-us/security-guidance/advisory/CVE-2020-1170), an elevation of privilege bug in Windows Defender. Finding a vulnerability in a security-oriented product is quite satisfying. Though, there was nothing groundbreaking. It's quite the opposite actually and I'm surprised nobody else reported it before me.

## Introduction

Before diving into the technical details of this vulnerability, I want to say a quick word about the timeline. I initially reported this vulnerability through the Zero Day Initiative (ZDI) program around 8 months ago. After sending them my report, I received a reply stating that they weren't interested in purchasing this vulnerability. At the time, I had only a few weeks of experience in Windows security research so I kind of relied on their judgement and left this finding aside. I even completely forgot about it in the following months.

Five months later, in late March 2020, I eventually went through my notes again and saw this report but, this time, my mindset was different. I had gained some experience because of a few other reports that I had sent to Microsoft directly. So, I knew that it was potentially eligible and I decided to spend a bit more time on it. It was a good decision because I even found a better way of triggering the vulnerability. I reported it to Microsoft in early April and it was acknowledged a few weeks later.

## The Initial Thought Process

In the [advisory](https://portal.msrc.microsoft.com/en-us/security-guidance/advisory/CVE-2020-1170) published by Microsoft, you can read:

> _An elevation of privilege vulnerability exists in Windows Defender that leads to arbitrary file deletion on the system._

As usual, the description is quite generic. You'll see that there is more to it than just an "_arbitrary file deletion_".

The issue I found is related to the way Windows Defender log files are handled. In case you don't know, Windows Defender uses 2 log files - `MpCmdRun.log` and `MpSigStub.log` - which are both located in `C:\Windows\Temp`. This directory is the default temp folder of the SYSTEM account but that's also a folder where every user has Write access.

Althouth that may sound bad, it isn't _that_ bad because the permissions of the files are properly set (obviously?). By default, Administrators and SYSTEM have Full Control over these files, whereas normal users can’t even read them.

![](/assets/posts/2020-06-21-cve-2020-1170-windows-defender-eop/01_log-file-perms.png)

Here is an extract from a sample log file. As you can see, it is used to log events such as Signature Updates, but you can also find some entries related to Antivirus scans.

![](/assets/posts/2020-06-21-cve-2020-1170-windows-defender-eop/02_log-file-content.png)

Signatures updates are automatically done on a regular basis but they can also be triggered manually using the `Update-MpSignature` PowerShell command for example, which doesn’t require any particular privileges. Therefore, these updates can be triggered as a normal user, as shown on the screenshot below.

![](/assets/posts/2020-06-21-cve-2020-1170-windows-defender-eop/03_signature-update.png)

During the process, we can see that some information is being written to `C:\Windows\Temp\MpCmdRun.log` by Windows Defender (as `NT AUTHORITY\SYSTEM`).

![](/assets/posts/2020-06-21-cve-2020-1170-windows-defender-eop/04_log-file-write-procmon.png)

What this means is that, as a low-privileged user, we can trigger a log file write operation by a process running as `NT AUTHORITY\SYSTEM`. Though we don't have access to the file and we can't control its content. We don't even have Write access on the Temp folder itself so we wouldn't be able to set it as a mount point either. I can't think of a more useless attack vector right now. :laughing:

Though, following my experience with [CVE-2020-0668](https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2020-0668) (again...) - _[A Trivial Privilege Escalation Bug in Windows Service Tracing](https://itm4n.github.io/cve-2020-0668-windows-service-tracing-eop/)_ - I knew that there was potentially more to it than just a log file write.

Think about it for a second, each time a Signature Update is done (which happens quite often), a new entry is added to the file, which represents around 1 KB. That's not much, right? But how much would it represent after several months or even years? In such case, log rotation mechanisms are often implemented so that old logs are compressed, archived or simply deleted. So, I wondered if such mechanism was also implemented to handle the `MpCmdRun.log` file. If so, there is probably some place for a privileged file operation abuse...

## Searching for a Log Rotation Mechanism

In order to find a potential log rotation mechanism, I began by reversing the `MpCmdRun.exe` executable itself. After opening the file in IDA, the very first thing I did was search for occurrences of the `MpCmdRun` string. My initial objective was to see how the log file was handled. Looking at the `Strings` window is usually a good way to start.

![](/assets/posts/2020-06-21-cve-2020-1170-windows-defender-eop/05_ida-strings.png)

Not surprisingly, the first result was `MpCmdRun.log`. Though, another very interesting result came out of this search: `MpCmdRun_MaxLogSize`. I was looking for a log rotation mechanism and this string was clearly the equivalent of "_Follow the white rabbit_". Obviously, I took the red pill and went down the rabbit hole. :sunglasses:

Looking at the `Xrefs` of `MpCmdRun_MaxLogSize` , I found that it was used in only one function: `MpCommonConfigGetValue()`.

![](/assets/posts/2020-06-21-cve-2020-1170-windows-defender-eop/06_ida-string-xrefs.png)

The `MpCommonConfigGetValue()` function itself is called from `MpCommonConfigLookupDword()`.

![](/assets/posts/2020-06-21-cve-2020-1170-windows-defender-eop/07_ida-func-xrefs.png)

Finally, `MpCommonConfigLookupDword()` is called from the `CLogHandle::Flush()` method.

![](/assets/posts/2020-06-21-cve-2020-1170-windows-defender-eop/08_ida-func-xrefs.png)

The following part of `CLogHandle::Flush()` is particularly interesting because it’s responsible for writing to the log file.

![](/assets/posts/2020-06-21-cve-2020-1170-windows-defender-eop/09_filesize.png)

First, we can see that `GetFileSizeEx()` is called on `hObject` (1), which is a handle pointing to the log file (`MpCmdRun.log`) at this point. The result of this function is returned in `FileSize`, which is a `LARGE_INTEGER` structure.

```c
typedef union _LARGE_INTEGER {
  struct {
    DWORD LowPart;
    LONG  HighPart;
  } DUMMYSTRUCTNAME;
  struct {
    DWORD LowPart;
    LONG  HighPart;
  } u;
  LONGLONG QuadPart;
} LARGE_INTEGER;
```

Since `MpCmdRun.exe` is a 64-bit executable here, `QuadPart` is used to get the file size as a `LONGLONG` directly. This value is stored in `v11` and is then compared against the value returned by `MpCommonConfigLookupDword()` (2). If the file size is greater than this value, the `PurgeLog()` function is called.

So, before going any further, we need to get the value returned by `MpCommonConfigLookupDword()`. To do so, the easiest way I found was to put a breakpoint right after this function call and get the result from the `RAX` register.

![](/assets/posts/2020-06-21-cve-2020-1170-windows-defender-eop/10_ida-breakpoint.png)

Here is what it looks like once the breakpoint is hit:

![](/assets/posts/2020-06-21-cve-2020-1170-windows-defender-eop/11_ida-debugger.png)

Therefore, we now know that the maximum file size is `0x1000000`, i.e. __16,777,216 bytes (16MB)__.

The next logical question would then be: _what happens when the log file size exceeds this value?_ As we saw earlier, when the size of the log file exceeds 16MB, the `PurgeLog()` function is called. Based on the name, we may assume that we will probably find the answer to this second question inside this function.

![](/assets/posts/2020-06-21-cve-2020-1170-windows-defender-eop/12_ida-purgelog.png)

When this function is called, a new filename is first prepared by concatenating the original filename and `.bak`. Then, the original file is moved, which means that `MpCmdRun.log` is renamed as `MpCmdRun.log.bak`. Now we have our answer: a log rotation mechanism is indeed implemented.

Here, I could have continued the reverse engineering process but I had something else in mind. Considering that knowledge, I wanted to adopt a simpler approach. The idea was to check the behavior of this mechanism under various conditions and observe the result using _Procmon_.

## The Vulnerability

Here is what we know and what we have learnt so far:

- Windows Defender writes some log events to `C:\Windows\Temp\MpCmdRun.log` (e.g.: Signature Updates).
- Any user can create files and directories in `C:\Windows\Temp\`.
- A log rotation mechanism prevents the log file from exceeding 16MB by moving it to `C:\Windows\Temp\MpCmdRun.log.bak` and creating a new one.

Do you see where I'm going here? Can you spot the potential issue? What would happen if there was already something named `MpCmdRun.log.bak` in `C:\Windows\Temp\`? :thinking:

To answer this question, I considered the following _test protocol_:

1. Create _something_ called `MpCmdRun.log.bak` in `C:\Windows\Temp\`.
2. Fill `C:\Windows\Temp\MpCmdRun.log` with arbitrary data so that its size is close to 16MB.
3. Trigger a Signature Update
4. Observe the result with _Procmon_

If `MpCmdRun.log.bak` is an existing file, it is simply overwritten. We may assume that it's the intendend behavior so this test isn't very conclusive. Rather, the very first test case scenario that came to my mind was: _what if `MpCmdRun.log.bak` is a directory?_

If `MpCmdRun.log.bak` isn't a simple file, we may assume that it cannot be simply overwritten. So, my initial assumption was that the log rotation would simply fail. Instead of creating a backup of the original log file, it would just be overwritten. Though, the behavior I observed with _Procmon_ was far more interesting than that. __Defender actually deleted the directory__ and then proceeded with the normal log rotation. So, I decided to redo this test but, this time, I also created files and directories inside `C:\Windows\Temp\MpCmdRun.log.bak\`. It turns out that the deletetion was actually __recursive__!

That's interesting! Now, the question is: _can we redirect this file operation with a junction_?

Here is the initial setup for this test case:

- A dummy target directory is created: `C:\ZZ_SANDBOX\target`.
- `MpCmdRun.log.bak` is created as a directory and is set as a mountpoint to this directory.
- The `MpCmdRun.log` file is filled with 16,777,002 bytes of arbitrary data.

![](/assets/posts/2020-06-21-cve-2020-1170-windows-defender-eop/13_test-case-setup.png)

The target directory of the mountpoint contains a folder and a file.

![](/assets/posts/2020-06-21-cve-2020-1170-windows-defender-eop/14_test-case-target-folder-content.png)

And here is what I observed in _Procmon_ after executing the `Update-MpSignature` PowerShell command:

![](/assets/posts/2020-06-21-cve-2020-1170-windows-defender-eop/15_test-case-procmon-result.png)

Defender followed the mountpoint, deleted each files and folders recursively and finally deleted the folder `C:\Windows\Temp\MpCmdRun.log.bak\` itself. Nice! This means that, as a normal user, we can trick this service into deleting any file or folder we want on the filesystem...

## Exploitability

As we saw in the previous part, exploitation is quite straightforward. The only thing we would have to do is create the directory `C:\Windows\Temp\MpCmdRun.log.bak\` and set it as a mountpoint to another location on the filesystem.

__Note:__ actually it's not that simple because an additional trick is required if we want to perform a targeted file or directory deletion but I won't discuss this here.

We face one practical issue though: _how much time would it require to fill the log file until its size exceeds 16MB_, which is quite a high value for a simple log file. Therefore, I did several tests and measured the time required by each command. Then, I extrapolated the results in order to estimate the overall time it would take. It should be noted that the `Update-MpSignature` command cannot be run multiple times in parallel (which makes sense for an update process).

__Test #1__

As a first test, I chose a naive approach. I ran the `Update-MpSignature` command a hundred times and measured the overall time it would take.

![](/assets/posts/2020-06-21-cve-2020-1170-windows-defender-eop/16_test1-powershell.png)

![](/assets/posts/2020-06-21-cve-2020-1170-windows-defender-eop/17_test1-log-file-size.png)

Here is the result of this first test. With this technique, it would take __more than 22 hours__ to fill the file and trigger the vulnerability if we ran the `Update-MpSignature` command in a loop.

| DESCRIPTION | TIME | FILE SIZE | # OF CALLS |
| --- | :---: | :---: | :---: |
| Raw data for 100 calls | 650s (10m 50s) | 136,230 bytes | 100 |
| Estimated time to reach the target file size | __80,050s (22h 14m 10s)__ | __16,777,216 bytes__ | __12,316__ |

That's not very practical, to say the least.

__Test #2__

After test #1, I checked the documentation of the `Update-MpSignature` command to see if it could be tweaked in order to speed up the entire process. This command has a very limited set of options but one of them caught my eye.

![](/assets/posts/2020-06-21-cve-2020-1170-windows-defender-eop/18_powershell-help-options.png)

This command accepts an `UpdateSource` as a parameter, which is actually an enumeration as we can see on the previous screenshot. When using most of the available values, an error message is immediately returned and nothing is written to the log file so they would be useless for this exploit scenario.

Though, when using the `InternalDefinitionUpdateServer` value, I observed an interesting result.

![](/assets/posts/2020-06-21-cve-2020-1170-windows-defender-eop/19_test2-updatesource-option.png)

Since my VM is a standalone installation of Windows, it isn't configured to use an "internal server" for the updates. Instead, they are received directly from MS servers, hence the error message.

The main benefit of this method is that the error message is returned almost instantly but the event is still written to the log file, which makes it a very good candidate for the exploit in this particular scenario.

![](/assets/posts/2020-06-21-cve-2020-1170-windows-defender-eop/20_test2-logfile-result.png)

Therefore, I ran this command a hundred times as well and observed the result.

![](/assets/posts/2020-06-21-cve-2020-1170-windows-defender-eop/21_test2-powershell.png)

This time, the 100 calls took less than 4 seconds to complete. This wasn't enough for calculating relevant stats so I ran the same test with 10,000 calls this time.

![](/assets/posts/2020-06-21-cve-2020-1170-windows-defender-eop/22_test2-powershell2.png)

Here is the result of this second test.

| DESCRIPTION | TIME | FILE SIZE | # OF CALLS |
| --- | :---: | :---: | :---: |
| Raw data for 10,000 calls | 363s (6m 2s) | 2,441,120 bytes | 10,000 |
| Estimated time to reach the target file size | __2,495s (41m 35s)__ | __16,777,216 bytes__ | __68,728__ |

With this slight adjustment, the overall operation would take __around 40 minutes__, instead of more than 22 hours with the previous command. This would therefore drastically reduce the amount of time required to fill the log file. It should also be noted that these values correspond to the worst-case scenario, where the log file would initially be empty.

I considered that this value was acceptable so I implemented this trick in a Proof-of-Concept. Here is a screenshot showing the result.

![](/assets/posts/2020-06-21-cve-2020-1170-windows-defender-eop/25_poc-run.png)

Starting from an empty log file, the PoC took around __38 minutes to complete__, which is very close to the estimation I had made previously.

As a side note, if you paid attention to the last screenshot, you probably noticed that I specified `C:\ProgramData\Microsoft\Windows\WER` as the target directory to delete. I didn't choose this path randomly. I chose this one because, once this folder has been removed, you can get code execution as `NT AUTHORITY\SYSTEM` as explained by [@jonaslyk](https://twitter.com/jonaslyk) in this post: [From directory deletion to SYSTEM shell](https://secret.club/2020/04/23/directory-deletion-shell.html).

## Conclusion

This is probably the last blog post in which I write about this kind of privileged file operation abuse. In an email sent to all vulnerability researchers, Microsoft announced that they changed the scope of their bounty. Therefore, such exploit is no longer eligible. This decision is justified by the fact that a generic patch is in development and will address this entire bug class.

I have to say that this decision sounds a bit premature. It would be understandable if this patch was already implemented in the latest Insider Preview build of Windows 10 but that's not the case. I would assume that this is more of an economic decision than a pure technical matter as such bounty program probably represents a cost of hundreds of thousands of dollars per month.

## Links & Resources

- CVE-2020-1170 | Microsoft Windows Defender Elevation of Privilege Vulnerability
[https://portal.msrc.microsoft.com/en-us/security-guidance/advisory/CVE-2020-1170](https://portal.msrc.microsoft.com/en-us/security-guidance/advisory/CVE-2020-1170)

- SECRET CLUB - From directory deletion to SYSTEM shell
[https://secret.club/2020/04/23/directory-deletion-shell.html](https://secret.club/2020/04/23/directory-deletion-shell.html)


text:
# Bref Runtime

Deploy an application with AWS Lambda using Bref.

We support all kinds of applications. See the following sections for details.

1. [Installation and usage](#installation)
1. [Symfony application](#symfony-application)
1. [Laravel application](#laravel-application)
1. [PSR-15 application](#psr-15-application)
1. [Console application](#console-application)
1. [PSR-11 container application](#psr-11-container)
    1. [Invoke handlers locally](#invoke-handlers-locally)
    1. [Simplify serverless.yml](#simplify-serverlessyml)
    1. [Typed handlers](#typed-handlers)
    1. [Symfony Messenger integration](#symfony-messenger-integration)

If you are new to the Symfony Runtime component, read more in the
[main readme](https://github.com/php-runtime/runtime).

## Installation

```
composer require runtime/bref
```

To get started, we need a `serverless.yml` file in our projects root. We also
use the `./vendor/runtime/bref-layer` plugin. Now we can tell AWS that we want
to use a "layer" called `${runtime-bref:php-80}` to run our application on.

Next we need to define the environment variable `APP_RUNTIME` so the Runtime component
knows what runtime to use.

```yaml
# serverless.yml
service: my-app-name

plugins:
    - ./vendor/runtime/bref-layer # <----- Add the extra Serverless plugin

provider:
    name: aws
    region: eu-central-1
    runtime: provided.al2
    memorySize: 1792
    environment:
       APP_ENV: prod
       APP_RUNTIME: Runtime\Bref\Runtime
       BREF_LOOP_MAX: 100 # Optional

functions:
    website:
        handler: public/index.php
        layers:
            - ${runtime-bref:php-80}
        events:
            # Specify that we want HTTP requests
            -   httpApi: '*'
```

That is really it!

We use this file for all kinds of applications. The only thing we change in the
`events`. Imagine that we want to listen to changes to S3 or new SQS messages.
Or we could let this function to be invoked by another application in our system
using a `Bref\Event\Handler`.

## Symfony application

You need some extra features from Bref. Install it with

```
composer req bref/bref
```

Use the standard Symfony 5.3+ `public/index.php`.

```php
// public/index.php

use App\Kernel;

require_once dirname(__DIR__).'/vendor/autoload_runtime.php';

return function (array $context) {
    return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
};
```

There is nothing special you need to do.

Here is [an example application](https://github.com/Nyholm/bref-runtime-demo).
With this runtime you may use the exact same application for in local development
and in production.

## Laravel application

You need some extra features from Bref. Install it with

```
composer req bref/bref
```

To run a Laravel application, you need to update your front controller to look
similar to this:

```php
// public/index.php

use Illuminate\Contracts\Http\Kernel;

define('LARAVEL_START', microtime(true));

require_once dirname(__DIR__).'/vendor/autoload_runtime.php';

return function (): Kernel {
    static $app;

    if (null === $app) {
        $app = require dirname(__DIR__).'/bootstrap/app.php';
    }

    return $app->make(Kernel::class);
};

```

Now you are up and running on AWS Lambda!

See [`runtime/laravel`](https://github.com/php-runtime/laravel) on how to run
this locally.

## PSR-15 application

You need some extra features from Bref. Install it with

```
composer req bref/bref
```

Bref is using [`nyholm/psr7`](https://github.com/nyholm/psr7) to provide a PSR-7
and PSR-15 experience. See [`runtime/psr-nyholm`](https://github.com/php-runtime/psr-nyholm)
how to run your application locally.

The following code is an example PSR-15 application with the Runtime component.
If it works locally it will also with on AWS Lambda.

```php
// public/index.php

use Nyholm\Psr7\Response;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;

require_once dirname(__DIR__).'/vendor/autoload_runtime.php';

return function () {
    return new class implements RequestHandlerInterface {
        public function handle(ServerRequestInterface $request): ResponseInterface
        {
            $name = $request->getQueryParams()['name'] ?? 'world';

            return new Response(200, [], "Hello $name");
        }
    };
};
```

## Console application

Use the standard Symfony 5.3+ `bin/console`.

```php
// bin/console

use App\Kernel;
use Symfony\Bundle\FrameworkBundle\Console\Application;

require_once dirname(__DIR__).'/vendor/autoload_runtime.php';

return function (array $context) {
    $kernel = new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);

    return new Application($kernel);
};
```

```yaml
# serverless.yml

# ...

functions:
    console:
        handler: bin/console
        timeout: 120
        layers:
           - ${runtime-bref:php-80}
        events:
            - schedule:
                rate: rate(30 minutes)
                input: '"app:invoice:send"'
```

## PSR-11 Container

The PSR-11 container is great. It really shines in internal microservices where
you dont have to deal with HTTP or security. Your application just call your microservice
using an AWS Lambda api client (ie `aws/aws-sdk-php` or `async-aws/lambda`).
It is also great for reacting to S3 or SQS events.

The first thing we need is a file that returns a PSR-11 container. See below
for an example for Symfony.

```php
// bin/container.php

use App\Kernel;

require_once dirname(__DIR__).'/vendor/autoload_runtime.php';

return function (array $context) {
    $kernel =  new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
    $kernel->boot();

    return $kernel->getContainer();
};
```

Now we write a class/service that implements `Bref\Event\Handler`.

```php
namespace App\Lambda;

use Bref\Context\Context;
use Bref\Event\Handler;

class HelloWorld implements Handler
{
    public function handle($event, Context $context)
    {
        return 'Hello ' . $event['name'];
    }
}
```

Now we need to update serverless.yml to say "Use bin/container.php to get the container
and then load service App\Lambda\HelloWorld".

```yaml
# serverless.yml

# ...

functions:
    hello:
        handler: bin/container.php:App\Lambda\HelloWorld
        layers:
            - ${runtime-bref:php-80}

```

When this is deployed it can be invoked by

```
serverless invoke --function hello --data '{"name":"Tobias"}'
```

### Invoke handlers locally

Using a service from the container makes the handlers very simple to unit test.
However, if you are lazy, you may want to invoke them locally from CLI.

Run the following command to invoke the `App\Lambda\HelloWorld` service.

```cli
./vendor/bin/bref-local-handler.php ./bin/container.php:App\\Lambda\\HelloWorld
```

If your service expects some event data, add it as a JSON string or a path to a
file containing JSON.

```cli
./vendor/bin/bref-local-handler.php ./bin/container.php:App\\Lambda\\HelloWorld '{"foo":"bar"}'

./vendor/bin/bref-local-handler.php ./bin/container.php:App\\Lambda\\HelloWorld example/input.json
```

### Simplify serverless.yml

The syntax `handler: bin/container.php:App\Lambda\HelloWorld` might be a bit weird to write,
but you may add an environment variable called `FALLBACK_CONTAINER_FILE` which
includes the file to where we can get the PSR-11 container. This may help the
serverless.yml file to read more natually.

```diff
 # serverless.yml

 provider:
     name: aws
     runtime: provided.al2
     # ...
     environment:
        APP_ENV: prod
        APP_RUNTIME: Runtime\Bref\Runtime
+       FALLBACK_CONTAINER_FILE: bin/container.php
        BREF_LOOP_MAX: 100 # Optional

 functions:
     hello:
-        handler: bin/container.php:App\Lambda\HelloWorld
+        handler: App\Lambda\HelloWorld
         layers:
           - ${runtime-bref:php-80}

```

### Typed handlers

To better integrate with different AWS events, one can use "typed handlers".
These are classes that implements `Bref\Event\Handler` and provides some helper
methods or classes.

To use them, you need to install Bref:

```
composer req bref/bref
```

We use the same PSR-11 configuration from above and write custom handler like:

```php
namespace App\Lambda;

use Bref\Context\Context;
use Bref\Event\S3\S3Event;
use Bref\Event\S3\S3Handler;

class S3FileCreated extends S3Handler
{
    public function handleS3(S3Event $event, Context $context): void
    {
        $bucketName = $event->getRecords()[0]->getBucket()->getName();
        $fileName = $event->getRecords()[0]->getObject()->getKey();

        // do something with the file
    }
}
```

```yaml
# serverless.yml

# ...

functions:
    s3_photos:
        handler: bin/container.php:App\Lambda\S3FileCreated
        layers:
            - ${runtime-bref:php-80}
        events:
            - s3:
                  bucket: photos
                  event: s3:ObjectCreated:*
```

Read more about different typed handlers at [Bref's documentation](https://bref.sh/docs/function/handlers.html).

### Symfony Messenger integration

Similar to the typed handlers above, if you use [`bref/symfony-messenger`](https://github.com/brefphp/symfony-messenger)
you may also want to define a worker function.

```yaml
# serverless.yml

# ...

functions:
    worker:
        handler: bin/container.php:Bref\Symfony\Messenger\Service\Sqs\SqsConsumer
        timeout: 120
        layers:
            - ${runtime-bref:php-80}
        events:
            - sqs:
                  batchSize: 1 # Only 1 item at a time to simplify error handling
                  arn: !GetAtt workqueue.Arn

resources:
    Resources:
        workqueue:
            Type: "AWS::SQS::Queue"
            Properties:
                QueueName: ${self:service}-workqueue
                VisibilityTimeout: 600
```

repository: siddthartha/runtime

repo_name: siddthartha/runtime


text:
---
title: "Spring League Leaderboard Update: Week 3 - Fan Favorites, Fast Facts and Funny Names"
authors:
- Andrew
---

![](./img/SpringLeague2022Update-Headers_Week-3.png)

With three weeks of competition down the leaderboard continues to be dominated by a trio of top tier bhumbas, and the battle is on for the hearts of the Battlesnake Community in the [2022 Spring League competition](https://play.battlesnake.com/arena/spring-league-2022/).

![](./img/image.png)

## Who are the Top Tier Bhumba's of the Week?

A quick glance at the leaderboard this week shows little has changed in the top 3 positions, with [Jaguar Meets Snake](https://play.battlesnake.com/u/waryferryman/jaguar-meets-snake/), [Combat Reptile](https://play.battlesnake.com/u/ambadoom/combat-reptile/) and [Shapeshifter ](https://play.battlesnake.com/u/jonathanarns/shapeshifter-stop-putins-war/)continuing to fight for Spring League supremacy, putting even more distance between themselves and the remaining Elite Tier Battlesnakes.

![](./img/gif.gif)

A recent game featuring **Jaguar Meets Snake**, **Combat Reptile** and **Shapeshifter**

Despite that distance, however, there is little doubt that the leaderboard is full of some highly competitive Battlesnakes. And so, we thought this week would be a good opportunity to take a look at a few of the talented (yet less well-known) developers and their newly minted Spring League snakes.

### Meet [pettso](https://play.battlesnake.com/u/pettso/)

Developer of [Kakemonsteret](https://play.battlesnake.com/u/pettso/kakemonsteret/) (17th place overall in [Spring League](https://play.battlesnake.com/arena/spring-league-2022/)):

![](./img/image-17.png)

:::info

**Games**: 2,061 | **Wins**: 586 | **Losses**: 1,475 | **Win Rate**: 28.43%

**Location:** Norway 🇳🇴

**Battlesnaking since:** October 2021 (5 months)

:::

**Preferred Technologies:**

- AWS
- Go
- Self-Hosted

**Additional Battlesnakes:**

- [Banana](https://play.battlesnake.com/u/pettso/banana/)
- [dev-a](https://play.battlesnake.com/u/pettso/dev-a/)
- [dev-b](https://play.battlesnake.com/u/pettso/dev-b/)
- [Kakemonsteret-DEV](https://play.battlesnake.com/u/pettso/kakemonsteret-dev/)
- [lokal](https://play.battlesnake.com/u/pettso/lokal/)
- [Snakes on a plane](https://play.battlesnake.com/u/pettso/snakes-on-a-plane/)

**Fast Fact:**

- Spring League marks the first time [pettso](https://play.battlesnake.com/u/pettso/) has placed in the Platinum Tier, with their previous personal best being Silver in the 2021 Fall League 🥈.

### Meet [freethrill](https://play.battlesnake.com/u/freethrill)

Developer of [CoolerSnake!](https://play.battlesnake.com/u/freethrill/coolersnake/) (21st place overall in [Spring League](https://play.battlesnake.com/arena/spring-league-2022/)):

![](./img/image-18.png)

:::info

**Games**: 2,107 | **Wins**: 598 | **Losses**: 1,509 | **Win Rat**e: 28.38%

**Location:** Unknown 🌎

**Battlesnaking since:** September 2021 (6 months)
:::

**Preferred Technologies:**

- GCP
- Python

**Additional Battlesnakes:**

- [CoolSnake!](https://play.battlesnake.com/u/freethrill/coolsnake/)

**Fast Fact:**

- Spring League marks the first time [freethrill](https://play.battlesnake.com/u/freethrill) has placed in the Platinum Tier, with their previous personal best being Bronze in the 2021 Fall League 🥉.

### Meet [ClarityCoders](https://play.battlesnake.com/u/claritycoders)

Developer of [ClarityIce](https://play.battlesnake.com/u/claritycoders/clarityice/) (23rd place overall in [Spring League](https://play.battlesnake.com/arena/spring-league-2022/)):

![](./img/image-14.png)

:::info
**Games**: 2,050 | **Wins**: 573 | **Losses**: 1,477 | **Win Rate**: 27.95%

**Location:** USA 🇺🇸

**Battlesnaking since:** January 2021 (2 months)

:::

**Preferred Technologies:**

- Python

**Current Battlesnakes**

- [AwesomeTest](https://play.battlesnake.com/u/claritycoders/awesometest/)
- [ClarityBeefy](https://play.battlesnake.com/u/claritycoders/claritybeefy/)
- [ClarityEyes-GOLD](https://play.battlesnake.com/u/claritycoders/clarityeyes-gold/)
- [Controlled Chaos](https://play.battlesnake.com/u/claritycoders/controlled-chaos/)

**Fast Fact:**

- ClarityCoders runs a software development focused [YouTube Channel](https://YouTube.com/claritycoders), and has even featured Battlesnake in a tutorial which you can checkout below 👇

### Who are the current Spring League Fan Favorites?

After a bit of back-and-forth over the past few weeks between [Hovering Hobbs](https://play.battlesnake.com/u/coreyja/hovering-hobbs/) and [BwukMaxi](https://play.battlesnake.com/u/bwuk/bwukmaxi/), a new competitor entered the mix this week, with [Pea Eater](https://play.battlesnake.com/u/alxv/pea-eater/) making it a three way race for fan favorite and setting 17 as the number of Cheers to beat.

![](./img/image-5.png)

![](./img/image-4.png)

![](./img/image-3.png)

Will [BwukMaxi](https://play.battlesnake.com/u/bwuk/bwukmaxi/) be able to regain their lead, or will they and [Hovering Hobbs](https://play.battlesnake.com/u/coreyja/hovering-hobbs/) be forced to concede to this newcomer in the Fan Favorite race?

:::warning Have your say!
 [Cheer](https://play.battlesnake.com/arena/spring-league-2022/) for your favorite Battlesnake today!
:::

### What are some of the best Battlesnake names?

While we may never know what sets the current fan favorites apart, there is little doubt about what brings fame, fortune and popularity to many Battlesnakes during the competitive season: **an amazing name!**

Below are a few of our favorite names so far this season, and we can't wait to see what fun and fabulously punny names are store for the rest of 2022.

![](./img/image-11.png)

![](./img/image-8.png)

![](./img/image-10.png)

![](./img/image-7.png)

A special shoutout goes to [Tiger_The_Cat](https://play.battlesnake.com/u/tiger_the_cat/), creator of [Wheat Bread](https://play.battlesnake.com/u/tiger_the_cat/wheat-bread/) and four other culinarily-themed Battlesnakes who you may have seen around the competitive circuit over the past year.

*"All of my battlesnakes are named after ingredients. If you put all of these ingredients together, you would get a very good sandwich."*

![](./img/image-9.png)

### What's happening this week in Battlesnake

While you can always stay up to date by checking out (or subscribing to) the [Battlesnake Community Calendar](https://play.battlesnake.com/schedule/), we wanted to be sure to give you a quick update on what is happening this week on [Battlesnake.TV](https://battlesnake.tv/).

![](./img/image-12.png)

**Deep Learning **- Thur**s**, Mar **10th** at 1**p**m PT / **4**pm ET****

Join Aurora for the first ever Battlesnake 'Book Club' as she explores the book '[Thinking in Systems](https://www.amazon.ca/Thinking-Systems-Primer-Donella-Meadows/dp/1603580557)' by Donella H. Meadows live on [Battlesnake.TV](https://battlesnake.tv/).

**Casters Cup Tournament** - **Sat**, Mar **12** at **9a**m PT / **12pm** ET****

Its North America versus Europe this Saturday on [Battlesnake.TV](https://battlesnake.tv/) as the Snake Pit Live! team brings you the exciting conclusion to the 2022 Spring Caster Cup.

![](./img/image-13.png)

Check out the Tournament brackets for yourself over at [play.battlesnake.com](https://play.battlesnake.com/competitions/caster-cup-spring-2022)

### Good Luck and Happy Battlesnaking!

As always, before we close off this update we want to thank you for reading and to wish good luck to all the [Spring League](https://play.battlesnake.com/league/spring-league-2022/) competitors!

We'd also like to send a huge thank you to our amazing Community, and to our wonderful 2022 partners at [RBC](https://play.battlesnake.com/partner/rbc), [New Relic](https://play.battlesnake.com/partner/newrelic), [DigitalOcean](https://play.battlesnake.com/partner/digitalocean) and [Twilio](https://play.battlesnake.com/partner/twilio) who make these competitions possible ❤

![](./img/image-25.png)

repository: BattlesnakeOfficial/docs

gha_language: JavaScript

repo_name: BattlesnakeOfficial/docs


text:
Puppet megaraid Module
=========================

[![Build Status](https://travis-ci.org/jhoblitt/puppet-megaraid.png)](https://travis-ci.org/jhoblitt/puppet-megaraid)

Description
-----------

Installs the LSI MegaRAID Storage Manager and MegaCLI RAID controller
management software.

It has been tested on:

 - el6.x

This module is intended to directly install the RPMs LSI packages up with their
own Linux installer, without using the provided install scripts.  It is assumed
that these RPMs have been extracted and made available as a Yum repo.

Obtaining the RPMs
------------------

The Storage Manager and CLI packages are provided via the [LSI](http://www.lsi.com/) website.

Here is a guided example starting at the [9285-8e](http://www.lsi.com/products/storagecomponents/Pages/MegaRAIDSAS9285-8e.aspx) product page.

  * click on the SUPPORT & DOWNLOADS tab
  * expand the MANAGEMENT SOFTWARE AND TOOLS section
  * download [MegaRAID Storage Manager - Linux 64 bit - 5.4](http://www.lsi.com/downloads/Public/MegaRAID%20Common%20Files/<IP_ADDRESS>_Linux_x64_MSM.tar.gz)
  * download [MegaCLI - 5.3 ](http://www.lsi.com/downloads/Public/MegaRAID%20Common%20Files/8.04.07_MegaCLI.zip)

Note that both of those direct links redirect to a page that requires you to
accept an EULA.

    $ tar -xf <IP_ADDRESS>_Linux_x64_MSM.tar.gz
    $ ls
    <IP_ADDRESS>_Linux_x64_MSM.tar.gz  disk
    $ cd disk
    $ ls *.rpm
    Lib_Utils-1.00-09.noarch.rpm
    Lib_Utils2-1.00-04.noarch.rpm
    MegaRAID_Storage_Manager-12.08.03-03.noarch.rpm
    sas_ir_snmp-12.08-0303.x86_64.rpm
    sas_snmp-12.08-0303.x86_64.rpm

    $ unzip 8.04.07_MegaCLI.zip
    Archive:  8.04.07_MegaCLI.zip
     extracting: Win_CliKL_8.04.07.zip
      inflating: 8.04.07_MegaCLI.txt
     extracting: CLI_DOS_8.04.07.zip
     extracting: CLI_FreeBSD_8.04.07.zip
     extracting: CLI_Lin_8.04.07.zip
     extracting: CLI_Solaris_8.04.07.zip
     extracting: CLI_VMWare_8.04.07.zip
     extracting: CLI_VMWare_MN_8.04.07.zip
     extracting: CLI_Win_8.04.07.zip
     extracting: Lin_CliKL_8.04.07.zip
    $ unzip CLI_Lin_8.04.07.zip
    Archive:  CLI_Lin_8.04.07.zip
     extracting: MegaCliLin.zip
      inflating: readme.txt
    $ unzip MegaCliLin.zip
    Archive:  MegaCliLin.zip
      inflating: Lib_Utils-1.00-09.noarch.rpm
      inflating: MegaCli-8.04.07-1.noarch.rpm
    $ ls *.rpm
    Lib_Utils-1.00-09.noarch.rpm  MegaCli-8.04.07-1.noarch.rpm

All of those RPMs should be copied into a repo and that yum is configured to
install from.  Here is an example [Yum repo
skeleton](https://github.com/jhoblitt/yum-repo-skel) on github.

Examples
--------

    class{ 'megaraid: }

Support
-------

Please log tickets and issues at [github](https://github.com/jhoblitt/puppet-megaraid/issues)

Copyright
---------

Copyright (C) 2012-2013 Joshua Hoblitt<EMAIL_ADDRESS>

repository: jhoblitt/puppet-megaraid

gha_language: Ruby

repo_name: jhoblitt/puppet-megaraid


text:
# Scala.js typings for hast-util-is-element

Typings are for version 2.1.2

## Library description:
hast utility to check if a node is a (certain) element

|                    |                 |
| ------------------ | :-------------: |
| Full name          | hast-util-is-element |
| Keywords           | unist, hast, hast-util, util, utility, html, is, element |
| # releases         | 5 |
| # dependents       | 0.0 |
| # downloads        | 2887603.6666666665 |
| # stars            | 8.0 |

## Links
- [Homepage](https://github.com/syntax-tree/hast-util-is-element#readme)
- [Bugs](https://github.com/syntax-tree/hast-util-is-element/issues)
- [Repository](https://github.com/syntax-tree/hast-util-is-element)
- [Npm](https://www.npmjs.com/package/hast-util-is-element)

## Note
This library has been generated from typescript code from first party type definitions.

Provided with :purple_heart: from [ScalablyTyped](https://github.com/oyvindberg/ScalablyTyped)

## Usage
See [the main readme](../../readme.md) for instructions.

repository: ScalablyTyped/Distribution

repo_name: ScalablyTyped/Distribution


text:
# How to contribute

You're considering to contribute work to this project? Sounds great, help is always welcome.

Please keep in mind that the objectives of this project needs to be kept:

- Very fast
- RFC 4180 compliant
- No third party libraries
- Small footprint

If unsure, create an issue for further discussion before sending a pull request.

## Steps to take

- Fork
- Code
- Add test(s)
- Commit
- Send me a pull request

repository: nstanger/FastCSV

repo_name: nstanger/FastCSV