text:
# Home Assistant install with LXD (Ubuntu Server 20.10)

[Forked from whiskerz007/proxmox_hassio_lxc](https://github.com/whiskerz007/proxmox_hassio_lxc). **The orginal script was aimed to be installed on Proxmox exclusively - this was modified for LXD on any Debian based Host OS**. It is currently being used on an **Ubuntu Server 20.10 aarch64 host on a RaspberryPi 4 8GB** executing the current upstream supervisor install with all dependencies, also exposing the port (8123) on the host.

TLDR: This is not aimed just at Proxmox but a generic debian based install (only tested on Ubuntu Server right now).

## Current state / how-to:

1. **Adjust MACHINE_TYPE manually** if you want to install it on x86_64 f.e. (it defaults to qemuarm-64, no prompt)
2. **select N upon install to keep network connectivity after reboot** (overwriting will remove eth0 and hence the internet connectivity)

Maybe it's a better idea to rewrite HassOS Buildroot base to something like https://github.com/Linutronix/elbe to get a minimal Debian system as the base where you can properly install other packages in addition to Hass.io ...

## Known issues:

- DNS and Multicast are currently not working, [see this post in the forums](https://community.home-assistant.io/t/running-hassos-as-an-lxd-lxc-virtual-machine/227643/6?u=thiscantbeserious).

- Could be that there's a container restart policy issue.
    ```
    docker update --restart unless-stopped $(docker ps -q)
    ```
----

Original Readme - see here: https://github.com/whiskerz007/proxmox_hassio_lxc/blob/master/README.md


text:
[OS.js](https://www.os-js.org/) is an [open-source](https://raw.githubusercontent.com/os-js/OS.js/master/LICENSE) web desktop platform with a window manager, application APIs, GUI toolkit, filesystem abstractions and much more.

[![Test Coverage](https://api.codeclimate.com/v1/badges/074b81c78fd887a7def5/test_coverage)](https://codeclimate.com/github/os-js/osjs-client/test_coverage)
[![Maintainability](https://api.codeclimate.com/v1/badges/074b81c78fd887a7def5/maintainability)](https://codeclimate.com/github/os-js/osjs-client/maintainability)

[![Support](https://img.shields.io/badge/patreon-support-orange.svg)](https://www.patreon.com/user?u=2978551&ty=h&u=2978551)
[![Support](https://img.shields.io/badge/opencollective-donate-red.svg)](https://opencollective.com/osjs)
[![Donate](https://img.shields.io/badge/liberapay-donate-yellowgreen.svg)](https://liberapay.com/os-js/)
[![Donate](https://img.shields.io/badge/paypal-donate-yellow.svg)](https://paypal.me/andersevenrud)

# OS.js Client Module

This is the main client core component of OS.js.

Contains base services, virtual filesystem, panels and other core services required for operation.

## Usage

### ESM, Webpack, etc.

```javascript
import { Core /*, ... */ } from '@osjs/client';
```

### UMD

```html
<script<EMAIL_ADDRESS>```

```javascript
const { Core /*, ... */ } = osjsClient;
```

## Contribution

* **Sponsor on [Github](https://github.com/sponsors/andersevenrud)**
* **Become a [Patreon](https://www.patreon.com/user?u=2978551&ty=h&u=2978551)**
* **Support on [Open Collective](https://opencollective.com/osjs)**
* [Contribution Guide](https://github.com/os-js/OS.js/blob/master/CONTRIBUTING.md)

## Documentation

See the [Official Manuals](https://manual.os-js.org/) for articles, tutorials and guides.

## Links

* [Official Chat](https://gitter.im/os-js/OS.js)
* [Community Forums and Announcements](https://community.os-js.org/)
* [Homepage](https://os-js.org/)
* [Twitter](https://twitter.com/osjsorg) ([author](https://twitter.com/andersevenrud))
* [Facebook](https://www.facebook.com/os.js.org)
* [Docker Hub](https://hub.docker.com/u/osjs/)

repository: os-js/osjs-client

branch_name: refs/heads/master

extension: md

gha_language: JavaScript

gha_license_id: NOASSERTION

license_type: permissive

repo_name: os-js/osjs-client


text:
# One-variable real-valued function fitting
This project implements the fitting of a continuous and limited real-valued function defined in a closed interval of the reals.
This one-variable real-valued function fitting is implemented using a configurable multilayer perceptron neural network written using TensorFlow 2 & Keras; it requires TensorFlow 2.0.0 or 2.1.0 library and also NumPy and MatPlotLib libraries.

Please visit [here](https://computationalmindset.com/en/neural-networks/one-variable-real-function-fitting-with-tensorflow.html) for concepts about this project.

It contains six python programs:
 - **fx_gen.py** generates a synthetic dataset file invoking a one-variable real-valued function on an real interval.
 - **fx_fit.py** fits a one-variable real-valued function in an interval using a configurable multilayer perceptron.
 - **fx_predict.py** makes a prediction of a one-variable real-valued function modeled with a pretrained multilayer perceptron.
 - **fx_scatter.py** generates two overlapped x/y scatter graphs: the blue one is the input dataset, the red one is the prediction.
 - **fx_diag.py** generates a set of graphs to show the curves of loss function and the curves of metrics (if they are available both on training and validation datasets).
 - **fx_video.py** generates an animated gif that shows the prediction curve computed on an input dataset as the epochs change.

### Predefined examples of usage of the four command in cascade
In the subfolder **examples** there are nine shell scripts to fit nine different one-variable real-valued functions; each script executes the four programs in cascade in order to reach and show the goal.

```bash
$ cd one-variable-function-fitting/examples
$ sh example1.sh
$ sh example2.sh
$ sh example3.sh
$ sh example4.sh
$ sh example5.sh
$ sh example6.sh
$ sh example7.sh
$ sh example8.sh
$ sh example9.sh
```

For details about the four commands and their command line options, please read below.

## fx_gen.py
To get the usage of [fx_gen.py](./fx_gen.py) please run:
```bash
$ python fx_gen.py --help
```

and you get:
```
usage: fx_gen.py [-h]
                 --dsout DS_OUTPUT_FILENAME
                 --fx FUNC_X_BODY
                 [--rbegin RANGE_BEGIN]
                 [--rend RANGE_END]
                 [--rstep RANGE_STEP]

fx_gen.py generates a synthetic dataset file calling a one-variable real-valued function in an interval

optional arguments:
  -h, --help                 show this help message and exit
  --dsout DS_OUTPUT_FILENAME dataset output file (csv format)
  --fx FUNC_X_BODY           f(x) body (lamba format)
  --rbegin RANGE_BEGIN       begin range (default:-5.0)
  --rend RANGE_END           end range (default:+5.0)
  --rstep RANGE_STEP         step range (default: 0.01)
```

Namely:
- **-h or --help** shows the above usage
- **--rbegin** and **--rend** are the limit of the closed interval of reals of independent variable x.
- **--rstep** is the incremental step of independent variable x into the interval.
- **--fx** is the one-variable real-value function to use to compute the value of dependent variable; it is in lamba body format.
- **--dsout** is the target dataset file name. The content of this file is csv (no header at first line) and each line contains a pair of real numbers: the x and the f(x) where x is a value of the interval and f(x) is the value of dependent variable. This argument is mandatory.

### Examples of fx_gen.py usage
```bash
$ python fx_gen.py --dsout mydataset.csv  --fx "np.exp(np.sin(x))" --rbegin -6.0 --rend 6.0 --rstep 0.05

$ python fx_gen.py --dsout mydataset.csv  --fx "np.sqrt(np.abs(x))" --rbegin -5.0 --rend 5.0 --rstep 0.04
```

## fx_fit.py
To get the usage of [fx_fit.py](./fx_fit.py) please run:
```bash
$ python fx_fit.py --help
```

and you get:
```
usage: fx_fit.py [-h]
                 --trainds TRAIN_DATASET_FILENAME
                 --modelout MODEL_PATH
                 [--valds VAL_DATASET_FILENAME]
                 [--bestmodelmonitor BEST_MODEL_MONITOR]
                 [--epochs EPOCHS]
                 [--batch_size BATCH_SIZE]
                 [--hlayers HIDDEN_LAYERS_LAYOUT [HIDDEN_LAYERS_LAYOUT ...]]
                 [--hactivations ACTIVATION_FUNCTIONS [ACTIVATION_FUNCTIONS ...]]
                 [--winitializers KERNEL_INITIALIZERS [KERNEL_INITIALIZERS ...]]
                 [--binitializers BIAS_INITIALIZERS [BIAS_INITIALIZERS ...]]
                 [--optimizer OPTIMIZER]
                 [--loss LOSS]
                 [--metrics METRICS [METRICS ...]]
                 [--dumpout DUMPOUT_PATH]
                 [--logsout LOGSOUT_PATH]
                 [--modelsnapout MODEL_SNAPSHOTS_PATH]
                 [--modelsnapfreq MODEL_SNAPSHOTS_FREQ]

fx_fit.py fits a one-variable real-valued function dataset using a configurable multilayer perceptron network

optional arguments:
  -h, --help                            show this help message and exit
  --trainds TRAIN_DATASET_FILENAME      train dataset file (csv format)
  --valds VAL_DATASET_FILENAME          validation dataset file (csv format)
  --bestmodelmonitor BEST_MODEL_MONITOR quantity to monitor in order to save the best model
  --modelout MODEL_PATH                 output model directory
  --epochs EPOCHS                       number of epochs
  --batch_size BATCH_SIZE               batch size
  --hlayers HIDDEN_LAYERS_LAYOUT [HIDDEN_LAYERS_LAYOUT ...] number of neurons for each hidden layer
  --hactivations ACTIVATION_FUNCTIONS [ACTIVATION_FUNCTIONS ...] activation functions between layer
  --winitializers WEIGHT_INITIALIZERS [WEIGHT_INITIALIZERS ...]] list of initializers (one for each layer) of the weights
  --binitializers BIAS_INITIALIZERS [BIAS_INITIALIZERS ...]]     list of initializers (one for each layer) of the bias
  --optimizer OPTIMIZER                 optimizer algorithm
  --loss LOSS                           loss function
  --metrics METRICS [METRICS ...]       list of metrics to compute
  --dumpout DUMPOUT_PATH                dump directory (directory to store loss and metric values)
  --logsout LOGSOUT_PATH                logs directory for TensorBoard
  --modelsnapout MODEL_SNAPSHOTS_PATH   output model snapshots directory
  --modelsnapfreq MODEL_SNAPSHOTS_FREQ  frequency in epochs to make the snapshot of model
```

Namely:
- **-h or --help** shows the above usage
- **--trainds** is the input training dataset in csv format: a pair of real numbers for each line respectively for x and y (no header at first line). In case you haven't a such real world true dataset, for your experiments you can generate it synthetically using **fx_gen.py**. This argument is mandatory.
- **--valds** is the input validation dataset in csv format (same structure than train dataset) that is used by the program to compute loss function and metrics over it. This argument is optional; if it is not specified, program will not compute loss and metric on any validation dataset, but only on training dataset.
- **--bestmodelmonitor** is the name of the quantity to monitor in order to save the best model; when present the saved model is not the most recent one (namely the model at last epoch time), but the one that is better in according with quantity to monitor. Pay attention: if you specify a quantity that is not available, no model is saved; then if name of quantity to monitor starts for 'val_', the quantity is computed on validation dataset (that must be passed via **--valds**), otherwise quantity is computed on training dataset. Then quantity name 'loss' is always available because of a loss quantity is always present; 'val_loss' is present is valudation dataset is present; any other value requires it is present also in **--metrics** argument.
- **--modelout** is a non-existing directory where the program saves the trained model (in tf native format). This argument is mandatory.
- **--epochs** is the number of epochs of the training process. The default is **500**
- **--batch_size** is the size of the batch used during training. The default is **50**
- **--hlayers** is a sequence of integers: the size of the sequence is the number of hidden layers, each value of the sequence is the number of neurons in the correspondent layer. The default is **100** (that means one only hidden layer with 100 neurons),
- **--hactivations** is a sequence of activation function names: the size of the sequence must be equal to the number of layers and each item of the sequence is the activation function to apply to the output of the neurons of the correspondent layer; please see [TensorFlow 2 activation function reference](https://www.tensorflow.org/api_docs/python/tf/keras/activations) for details and examples at the end of this section.\
  Available activation functions are:
  - elu
  - exponential
  - hard_sigmoid
  - linear
  - relu
  - selu
  - sigmoid
  - softmax
  - softplus
  - softsign
  - tanh\
  The default is **relu** (applied to one only hidden layer; if number of layers is > 1, this argument becomes mandatory).
- **--winitializers** is a list of initializator constructor for the kernel weights matrix: the length of the list of this argument should be equal to the number of layers; if extra initializators are supplied they are ignored; if less initializers are suppliers the last layers will have the default initializer, that is GlorotUniform(); please see [TensorFlow 2 initializer reference](https://www.tensorflow.org/api_docs/python/tf/keras/initializers) for details and examples at the end of this section.\
    Available activation functions are:
    - Constant()
    - GlorotNormal()
    - GlorotUniform()
    - Identity()
    - Ones()
    - Orthogonal()
    - RandomNormal()
    - RandomUniform()
    - TruncatedNormal
    - VarianceScaling
    - Zeros()\
    This argument is optional; if it is missing, all layers have the default kernel weighst matrix initializer for Dense nodes (that is GlorotUniform()).
- **--binitializers** is a list of initializator constructor for the bias; same rules for **--winitializers** are applied for **--binitializers**, except the default initializier that is Zeros() when less initializers than hidden layers are supplier. This argument is optional; if it is missing, all layers have the default bian initializer for Dense nodes (that is Zeros()).
- **--optimizer** is the constructor call of the algorithm used by the training process. You can pass also named arguments between round brackets; please see [TensorFlow 2 optimizer reference](https://www.tensorflow.org/api_docs/python/tf/keras/optimizers) for details about constructor named parameters and examples at the end of this section.\
  Available algorithm constructors are:
  - Adadelta()
  - Adagrad()
  - Adam()
  - Adamax()
  - Ftrl()
  - Nadam()
  - RMSprop()
  - SGD()\
  The default is **Adam()**.
- **--loss** is the constructor call of the loss function used by the training process. You can pass also named arguments between round brackets; please see [TensorFlow 2 loss functions reference](https://www.tensorflow.org/api_docs/python/tf/keras/losses) for details about constructor named parameters and examples at the end of this section.\
  Available loss function construtors are:
  - BinaryCrossentropy()
  - CategoricalCrossentropy()
  - CategoricalHinge()
  - CosineSimilarity()
  - Hinge()
  - Huber()
  - KLDivergence()
  - LogCosh()
  - MeanAbsoluteError()
  - MeanAbsolutePercentageError()
  - MeanSquaredError()
  - MeanSquaredLogarithmicError()
  - Poisson()
  - Reduction()
  - SparseCategoricalCrossentropy()
  - SquaredHinge()\
  The default is **MeanSquaredError()**.
- **--metric** is a sequence of metric names; please see [TensorFlow 2 metrics reference](https://www.tensorflow.org/api_docs/python/tf/keras/metrics/); anyway because the program is implementing a regression the more interesting metrics to use are:
  - mean_squared_error
  - mean_absolute_error
  - mean_absolute_percentage_error
  - cosine_proximity
- **--dumpout** is the directory where program stores (in different csv files) the values of loss function and metrics computed on training dataset and, when passed with **--valds** argument, on validation dataset, too. This program does not clean old content of this folder: it is advisable to delete the dumpout folder before launching this program. This argument is optional.
- **--logsout** is the directory where program stores the logs for TensorBoard; This program does not clean old content of this folder: it is advisable to delete the dumpout folder before launching this program. This argument is optional. To browse the generated log with TensorBoard pass this folder to **--logdir** argument of **tensorboard** program.
- **--modelsnapout**  is the directory where program stores periodically (see **--modelsnapfreq** argument) the snapshots of the model as the epochs change. This program does not clean old content of this folder: it is advisable to delete the modelsnapout folder before launching this program. This argument is optional.
- **--modelsnapfreq** is the frequency in epochs to save the snapshots of current model in **--modelsnapout**. This argument is optional and defaulted to 25 (that means a snapshot of model each 25 epochs); if **--modelsnapout** is not specified, this argument is ignored, otherwise model snapshots are saved in according with this argument as the epochs change and it is ensured that models at first and last epochs are saved whatever the frequency.
 This argument is mandatory.
- **--ds** is the input dataset in csv format (no header at first line): program uses only the x values (first column). In case you haven't a such real world true dataset, for your experiments you can generate it synthetically using **fx_gen.py**. This argument is mandatory.
- **--predictionout** is the file name of prediction values. The content of this file is csv (no header at first line) and each line contains a pair of real numbers: the x value comes from input dataset and the prediction is the value of f(x) computed by multilayer perceptron model on x value; this argument is mandatory.

### Example of fx_predict.py usage
```bash
$ python fx_predict.py --model mymodel --ds mytestds.csv --predictionout myprediction.csv
```

## fx_scatter.py
To get the usage of [fx_scatter.py](./fx_scatter.py) please run
```bash
$ python fx_scatter.py --help
```

and you get:
```
usage: fx_scatter.py [-h]
                  --ds DATASET_FILENAME
                  --prediction PREDICTION_DATA_FILENAME
                  [--title FIGURE_TITLE]
                  [--savefig SAVE_FIGURE_FILENAME]

fx_scatter.py shows two overlapped x/y scatter graphs: the blue one is the dataset, the red one is the prediction one

optional arguments:
  -h, --help            show this help message and exit
  --ds DATASET_FILENAME dataset file (csv format)
  --prediction PREDICTION_DATA_FILENAME  prediction data file (csv format)
  --title FIGURE_TITLE                   if present, it sets the title of the chart
  --savefig SAVE_FIGURE_FILENAME         if present, the chart is saved on a file instead to be shown on screen
```
Namely:
- **-h or --help** shows the above usage
- **--ds** is an input dataset in csv format (no header at first line). Usually this parameter is the test dataset file passed to **fx_predict.py**, but you could pass the training dataset passed to **fx_fit.py**. This argument is mandatory.
- **--prediction** is the file name of prediction values generated by **fx_predict.py** (see **--predictionout** command line parameter of **fx_predict.py**). This argument is mandatory.
- **--title** if this argument is missing, the chart has a default title, otherwise this argument sets the title of the chart.
- **--savefig** if this argument is missing, the chart is shown on screen, otherwise this argument is the png output filename where **fx_scatter.py** saves the chart.

### Examples of fx_scatter.py usage
```bash
$ python fx_scatter.py --ds mytestds.csv --prediction myprediction.csv

$ python fx_scatter.py --ds mytrainds.csv --prediction myprediction.csv --tile "My Title" --savefig mychart.png
```

## fx_diag.py
To get the usage of [fx_diag.py](./fx_diag.py) please run
```bash
$ python fx_diag.py --help
```

and you get:
```
usage: fx_diag.py [-h]
                  --dump DUMP_PATH
                  [--savefigdir SAVE_FIGURE_DIRECTORY]

fx_diag.py shows the loss and metric graphs with data generated by fx_fit.py with argument --dumpout

optional arguments:
  -h, --help   show this help message and exit
  --dump       DUMP_PATH dump directory (generated by fx_fit.py with argument --dumpout)
  --savefigdir SAVE_FIGURE_DIRECTORY if present, the charts are saved on different png files in savefig_dir folder instead to be shown on screen
```
Namely:
- **-h or --help** shows the above usage
- **--dump** is the dump directory generated by fx_fit.py with argument --dumpout. This argument is mandatory.
- **--savefigdir** if this argument is missing, the charts are shown on screen one by one, otherwise this argument is the directory where this program saves the graphs in png files; filenames are self-explanatory.

### Examples of fx_diag.py usage
```bash
$ python fx_diag.py --dump dumps/example1

$ python fx_diag.py --dump dumps/example1 --dumps graphs/example1
```

## fx_video.py
To get the usage of [fx_video.py](./fx_video.py) please run
```bash
$ python fx_video.py --help
```

and you get:
```
usage: fx_video.py [-h]
                   --modelsnap MODEL_SNAPSHOTS_PATH
                   --ds DATASET_FILENAME
                   --savevideo SAVE_GIF_VIDEO
                   [--fps FPS]
                   [--width WIDTH]
                   [--height HEIGHT]

fx_video.py generates an animated git that shows the prediction curve computed on an input dataset as the epochs change

optional arguments:
  -h, --help              show this help message and exit
  --modelsnap MODEL_SNAPSHOTS_PATH model snapshots directory (generated by fx_fit.py with option --modelsnapout)
  --ds DATASET_FILENAME            dataset file (csv format)
  --savevideo SAVE_GIF_VIDEO       the animated .gif file name to generate
  --fps FPS                        frame per seconds
  --width WIDTH                    width of animated git (in inch)
  --height HEIGHT                  height of animated git (in inch)
```
Namely:
- **-h or --help** shows the above usage
- **--modelsnap** is the directory generated by fx_fit.py with argument --modelsnapout. This argument is mandatory. From this folder this program takes the model snapshots at various times of the epochs and apply the x-values of input dataset to them in order to compute the prediction at the time of the epochs. This argument is mandatory.
- **--ds** input dataset applied to model snapshots (coming from *--modelsnap** parameter) in order to compute the prediction at the time of the epochs. This argument is mandatory.
- **--savevideo** is the animated gif file name to generate. Each frame of this video corresponds to an epoch and it is a figure that shows two overlapped x/y scatter graphs: the blue one is the input dataset, the red one is the prediction one at the time of the epoch. This argument is mandatory.
- **--fps** is the number of frames per second in the final video. This argument is optional.
- **--width** is the animated gif width in inch. This argument is optional.
- **--height** is the animated gif height in inch. This argument is optional.

### Examples of fx_video.py usage
```bash
$ fx_video.py --modelsnap snaps/example1 --ds datasets/example1_test.csv --savevideo graphs/example1_test.gif
```

license: MIT


text:
# Grass

Yet another ruby framework

## Installation

Add this line to your application's Gemfile:

    gem 'grass'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install grass

## Usage

to create new app : `grass new PATHNAME`

## Contributing

1. Fork it ( http://github.com/<my-github-username>/grass/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

repository: lemmycaution/grass

repo_name: lemmycaution/grass


text:
# Archived as of 2023-05-19:
I created this repository at a time when I thought that it was too complicated to get started with small TypeScript projects. But today I would probably use something like [Vite's templates](https://vitejs.dev/guide/) over this starter pack. Since I don't have any use for the project myself I have archived it to stop Dependabot from telling me I need to keep it updated.

# TypeScript project starter pack

This is a small starter pack for getting a TypeScript project started using Webpack and ts-loader.
It also contains launch.json and tasks.json files for Visual Studio Code integration.

It is not meant to be super idiomatic or production ready. The goal is to have a base that is simple enough that you can build on top of it with confidence that you wont break something and not understand why.

## Usage

1. Clone this repository.
2. Run `npm install` in the cloned directory.
3. If using TSX but not using React, change the `jsxFactory` property in tsconfig.json.

If using VS Code and Google Chrome:

4. Press `ctrl-shift-p` and type in `Run task`. Press enter. Choose the `npm: start` task.
5. Press F5 to start debugging in Chrome.

Otherwise:

4. Open a terminal and execute `npm run start`
5. Open your web browser and go to http://localhost:8080/

Finally:

6. Start developing. The entry point for the application is src/index.ts.

## Running tests

Use the `start-test` npm task to start a Karma server that will watch files in src/ and test/ and run tests in modified files.

For testing, [Jasmine](https://jasmine.github.io/) + [Karma](https://karma-runner.github.io/2.0/index.html) is used.

## Prettier

[Prettier](https://prettier.io) is installed by default along with [lint-staged](https://github.com/okonet/lint-staged). This ensures that code in the repository has a coherent coding style. When committing to the repository, prettier will be ran against the staged files and will update them if there is any code in the files that violates the coding style.

For Visual Studio Code users, it is recommended to install the [prettier-vscode](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) plugin. This will make the built in format on save functionality use prettier's coding style.

There are some alternatives listed [here](https://prettier.io/docs/en/editors.html) to run prettier on save in other editors.

Prettier is also ran in the `ci` GitHub Action which is included in this repository. The action will fail if you commit code that violates the coding style.

license: Unlicense

repository: JackBister/ts-starter-pack

gha_license_id: Unlicense

repo_name: JackBister/ts-starter-pack


text:
# FakeConsole
FakeConsole - is a simple helper class to help you better test dotnet console apps

# Story of FakeConsole
While playing with online problem solving websites, like [HackRank](https://www.hackerrank.com/). developers need from time to time to test the solution on their PCs to debug any unexpected behaviour.

Most probably developer will do (run the program > manually write inputs to console > check results) many times.

The most time-wasting step is to manually insert inputs to console, **FakeConsole** core purpose is to help in this step. and it also comes with some extra help like validating the final outputs of all Console.WriteLine called during program execution.

# How to use
1. You have to download the [FakeConsole file](https://raw.githubusercontent.com/AhmedMozaly/FakeConsole/master/FakeConsole.cs) and add it to your solution.
2. You need to add `using Console = FakeConsole;` to your program namespaces.
3. You need to set `FakeConsole.ReadLines` field with all of your lines, separated by line breaks.

# Example
```
using System;
using Console = FakeConsole;

class Solution
{

    static void Main(String[] args)
    {
        Console.ReadLines = @"first line
second line
third line";

        //all next lines will be served from FakeConsole, no popups will be needed to ask user for anything
        var line1 = Console.ReadLine();
        var line2 = Console.ReadLine();
        var line3 = Console.ReadLine();
    }
}
```

repository: AhmedMozaly/FakeConsole

repo_name: AhmedMozaly/FakeConsole


text:
---
layout: post
title: SQL Injection
excerpt: "If you look on top 10 of OWASP about Application Security Risks you may find the greatest vulnerabilities on Applications!

The cool thing is that injection is the number one and it may sound weird but there is some website that using SQL (Structured Query Language) and you can attack these website in such type of attack that they really should not work anymore but still does.

Let's look on the SQL injection in details."
tags:
- Injection

---
SQL or Structured Query Language is a way to store and pullout data from database and it's fairly easy because it's like English actually, you can write things like `SELECT * FROM thistable` and every such command will bring up to you results from the database and this was the way to store things in websites and still does for many years.

If we talking about injection you may know that inject some code is not related only to SQL, you can actually to do so with various programing language of course it depend on how the programmer developed that site, but if he or she not care enough about the little things in that code, we may find some way to inject some unwanted code to the website.

In that  article I would like to present and demonstrate the following in order for you have a full picture of what is going on here, so the main goal here is:
- [How SQL work.](#how-sql-work)
- [What is the vulnerability.](#what-is-the-vulnerability)
- [Exploit that vulnerability.](#exploit-that-vulnerability)
- [How to migrate that vulnerability.](#how-to-migrate-that-vulnerability)

### How SQL work

I think that before you five in to SQL you need basic understanding how it works, in this section I'm using Ubuntu server with mysql database, so first of all let's connect to our SQL database.

 To setup mysql in you Ubuntu server you can follow [this documentation](https://help.ubuntu.com/lts/serverguide/mysql.html) or you can just type:

 ```
 sudo apt update
 sudo apt upgrade
 sudo apt install mysql-server
 sudo service mysql start
 sudo service mysql status
```

 The last command will show you what is the status of your sql service, if you have some issue related to that service please search the error you got in [stackoverflow](stackoverflow.com) it is a grate way to solve issues with the community.

 ![sql-injection-001.png](/assets/images/sql-injection-001.png)
 **Figure 1** MySQL server.

 After your sql server are ready to use just connect to the database, if it is you first time you should get aome alert about setup your password, just do the command `sudo mysql -u root -p`

 ![sql-injection-002.png](/assets/images/sql-injection-002.png)
 **Figure 2** Connect to the database.

 Now let's look on the command we have in SQL.

 - `CREATE DATABASE database_name;` - create some database, in that database we will create tables that contain values of our users.

 - `CREATE TABLE table_name;` - creating a table with columns and datatype.

 - `DROP  DATABASE database_name;` - delete the database.

 - `DELETE FROM table_name WHERE column_name=value;` - delete some value in our table base on the column_name name, please notice the `WHERE` statement, if you doesn't specified that WHERE it will delete every value in the table.

 - `ALERT TABLE table_name DROP COLUMN column_name;` - this command will delete the column in the table that we specified.

 - `SELECT * FROM table_name;` - this command will display every value from the table.

 - `SELECT * FROM table_name ORDER BY column_name [ASC/DESC];` - this will display the data ordered by the method we chose, DESC stand for descending and ASC stand for ascending.

 - `ALTER TABLE table_name ADD column_name datatype;` - to add some column to out table.

 - `UPDATE table_name SET column_name = value WHERE column_name = value;` - set some value to some filed base on column_name value.

##### SQL Operators:

| Operator        | Description        |
| ------------- |:---------|
| `=`	        | Equal to      |
| `<>`        | not equal to ( is the same as !=)       |
| `>`	        | Greater than|
| `<`	        | Less than   |
| `#`         | Used for comment on that line (mean that alll character after '#' will be ignored)|
| `%`         | If we use `LIKE` it is used as wildcard character |
| `LIMIT`	    | Limit the query by number |
| `BETWEEN`   | Will give us a rang  |
| `LIKE`      | Matches a pattern  |
| `IS or IS NOT` | Compare to null  |

**Table 1** for more operator refer to [that link.](https://www.w3schools.com/sql/sql_operators.asp)

Let's create new database with table and filled that table with users ID and data.

{% highlight mysql %}
CREATE DATABASE mysite;
USE mysite;
{% endhighlight %}

Please remember that you mush chose database before you create some table.

![sql-injection-003.png](/assets/images/sql-injection-003.png)
**Figure 3** Select database.

{% highlight mysql %}
CREATE TABLE users(
  id INT NOT NULL,
  nickName VARCHAR(255),
  firstName VARCHAR(255),
  lestName VARCHAR(255),
  email VARCHAR(255)
  );
{% endhighlight %}

![sql-injection-004.png](/assets/images/sql-injection-004.png)
**Figure 4** Create table.

So far we created database named "mysite" and add table named users, in that table we have users ID which is must be valuable (NOT NULL) and number (INT which is an integer), in the other values we specified that each value can be long up to 255 characters (VARCHAR(255)), now we need to filled that table up.

{% highlight mysql %}
INSERT INTO users(id, nickName, firstName, lestName, email) VALUES
(1, 'Jimi', 'Johnny', 'Hendrix', 'jhendrix@gmail.com'),
(2, 'Jenni', 'Jennifer', 'Batten', 'jbatten@gmail.com'),
(3, 'Steve', 'Steven', 'Vai', 'svai@gmail.com'),
(4, 'Jim', 'James', 'Morrison', 'jmorrison@gmail.com'),
(5, 'AliceCooper', 'Vincent', 'Furnier', 'vfurnier@gmail.com');
{% endhighlight %}

![sql-injection-005.png](/assets/images/sql-injection-005.png)
**Figure 5** Filled up the tables with values.

To display the all table, just type SELECT and asterisk FROM the table name.
![sql-injection-006.png](/assets/images/sql-injection-006.png)
**Figure 6** Tables with values.

Note that we can insert more that one command in the same raw.
![sql-injection-007.png](/assets/images/sql-injection-007.png)
**Figure 7** More than one command.

Now let's change some email in out table, just type as follow:
![sql-injection-008.png](/assets/images/sql-injection-008.png)
**Figure 8** Chenge email.

So if in some website used SQL to store some data in tables from the user, if some user change his email address, this is what actually append behind the scene.

We can also use some sentence that specified True of False to display something, in the next example I'm use 1=1 which mean True, this is why it display to me all of the values.
![sql-injection-009.png](/assets/images/sql-injection-009.png)
**Figure 9** 1=1 is actually True.

We have a way to use wildcard like the next example:

`SELECT * FROM users WHERE lastName LIKE '%n';`
In that case the query give up the last names that end with `n` which can be helpful to filter stuff.

![sql-injection-010.png](/assets/images/sql-injection-010.png)
**Figure 10** 1=1 is actually True.

### What is the vulnerability

So in SQL the way it's works with website is as follow,  let's assume that we have some filed that ask us username and password, if we type in some value like `guy` and hit enter it will generate some command in SQL to the database like  `SELECT * FROM users WHERE USERNAME = 'guy';`, please note the quotation marks, in this way the database will bring back `"guy"`, the problem is with those quotation marks, it little bit tricky because let's say that the user actually put in that filed quotation marks, something that look like that:
`SELECT * FROM users WHERE USERNAME = 'guy''`

In that case it will failed because the command is not match up, and it will send some error, so it may be annoying, but if we think about that we can do some serious damage in that way because in SQL we have more command like `INSERT` to insert stuff or `UPDATE` to change stuff and `DELETE` to remove data from the database, so if we write on the username filed something more like:
 `guy"; DELETE * FROM table_name;`

The command will work and because it is a SQL it will delete everything that in the table_name.

The way to migrate this issue is called escaping and it's something like the programmer will setup in the code that every time we have quotation marks just put backslash before it, in that way the quotation marks in the filed will be handled as a character and not as quotation marks in the SQL so it may help to migrate the problem with command in SQL in the user input.

For that article I'm going to use DVWA which is great way to learn about vulnerability related to websites, the usual Linux Kali will be used to attack those websites and I hope you will enjoy it.
You can download DVWA from [here](http://www.dvwa.co.uk/), in this web you can find the source code which contain the REDAME.md file that can help you to install the DVWA on your operation system. We going to look on only the SQL injection in that article, I hope you enjoy it! I sure that I will!:]

There is a three type of SQL injection:
- Error base: we make some query to the database and we get some error from it, we can extract information about the server in that way.
- Union base: in that case we use more then one SELECT SQL query in the same statements and get some single result.
- Blind base: in that type of SQL injection we can do more than ask the database true of false question and using whether valid page returned or not, or we can use the time it took for the page to load, we will see how that going on in that article.

### Exploit that vulnerability.

Ok guys, I have done to setup my Ubuntu server with php7.0 and mysql database and the website (DVWA) is live and running. I have Kali Linux machine and from that machine we going to do the coolest stuff!
So my topology look something like that:

![sql-injection-011.png](/assets/images/sql-injection-011.png)
**Figure 11** Topology for our lab.

you can do the same I did if you like, if you have some trouble in the installation process please feel free to leave a comment here or send me an email and I'll be glad to help.

for this kind for lab you actually doesn't need to setup spacial server just for DVWA, you can setup is on you computer and trying to attack from your Kali, or you can attack the website from your computer, it's really doesn't matter, you can also setup the web directly on your Kali which is the best I think.

Ok, let's look on the DVWA website, we going to do every challenge in that web that related to SQL, so let's start from the low level security to high, if you configure everything correctly you should get the following page:
![sql-injection-012.png](/assets/images/sql-injection-012.png)
**Figure 12** Topology for our lab.

The default username is admin and password is password, after you login go to DVWA security tab and select low level and submit it.
![sql-injection-013.png](/assets/images/sql-injection-013.png)
**Figure 13** Topology for our lab.

After that go SQL injection tab, and here we going to do our magic!
As you can see the User ID box and submit button, you can trying to insert some value in that box but nothing will happened, only the URL will be change but it's irrelevant in that point. however if you type sum number in range of 1 to 5 you get some value from the database.

![sql-injection-014.png](/assets/images/sql-injection-014.png)
**Figure 14** Data from the database.

So we can see the users and their surenames, let's play with the box little more, just write a comma `'` sign and click on the submit button it will bring up an error.
![sql-injection-015.png](/assets/images/sql-injection-015.png)
**Figure 15** Data from the database.

So right now we know that the web server is vulnerable for Error base attack, so let's try to play with it more. every query are generate some sentence with quotation marks on the value that the user type, so, in the case we typed 1 in the SQL query it would be something like `SELECT column FROM table WHERE number='1'`, remember we type only 1 without quotation marks, so when we type `1'` it actually look like `number= '1''`, so if we trying to put some query we can put in the filed something like that:

`1' or '0'='0`

In that case the query will look something like that:

`number = '1' or '0'='0'`

In the query case it's put quotation marks,I'll bold it so you can see:

number = **'** 1' or '0'='0 **'**

In that case it look like we add another values to the SQL query and the 0=0 is sort of True query, so the answer we get will be all the values because the existing of the value is true, let's look how is works in the SQL, if we type that query we get the following:

![sql-injection-016.png](/assets/images/sql-injection-016.png)
**Figure 16** SQL query.

Now we extract all users from database because the True statement, every value is True so this is why we get every value from the table.

We can adding UNION to sql statement which mean that we use 2 SELECTED statement at once, so, we can write a brand new command in the input box and maybe the SQL will treat that statement as usual, please remember that if we use UNIUN, we can only use that in SELECT statement, and the SELECT statement must be query of equal column, as example the following:

{% highlight mysql %}
SELECT firstName, lastName, email LIKE '%te%' FROM users UNION SELECT firstName, lastName, email LIKE '%r%' FROM users;
{% endhighlight %}

In this statement we query the firstName and lastName from our mysite table and we display also the  who have email that contain 'te' in it, in the union we do the same but this time the query should display the rows from our table that contain 'r' in the email filed.

![sql-injection-017.png](/assets/images/sql-injection-017.png)
**Figure 17** SQL query with UNION.

Please note that we have a third column that contain `0` or `1`, which specified answer to our query. So if we go back to our Kali machine we can use UNION to display two SELECT at once, just inject the follow:
```
1' union select first_name,last_name from users WHERE user_id='2
```

And this is the SQL answer we get for that query:
![sql-injection-018.png](/assets/images/sql-injection-018.png)
**Figure 18** SQL query with UNION display two users.

Please note that I used `first_name` and `last_name` for my query, you may ask how did I now that the column names are like that? if you check that website you will see the View Source button and if you click on that you will see the php code that contain the query with `first_name` and `last_name`, but please remember that in the real world it doesn't likely you can view some php code of some site, normally the php code used as server side so you never been access to that code directly, you may try to extract that code with XSS or CSRF or any sort of attacks, but in some cases you may guess the query, just remember that the developer may used some common names, so it may be more simple to guess that column names than extract the code that contain the query.

![sql-injection-019.png](/assets/images/sql-injection-019.png)
**Figure 19** Source code.

I want you to new that there is more data that we can find about the database it self and it inportent to know that stuff so just follow me, you can make a SELECT query from the database for find boxes from the table without any value, so let's say that in our table there is some box without value, we can may query to find this boxes as follow:
{% highlight mysql %}
SELECT first_name FROM users WHERE the middle_name IS NULL;
{% endhighlight %}

In that case that query bring us any user that he have no middle name, so that is the main used for NULL, there is another way to use it, but before that there is more things you should know, there is a way to query some data about the database it self, there is some  [functions](https://www.w3schools.com/sql/sql_ref_mysql.asp) that used for check some values related to the database itself or mysql server we working on, as example what is the user we used for mysql, what is the version of mysql database, what is the name of the database we working on it and so on.

{% highlight mysql %}
USE mysite;
SELECT database();
{% endhighlight %}

In that case the database will show us his name after we chose the database, in my case the database name will be 'mysite'.

![sql-injection-024.png](/assets/images/sql-injection-024.png)
**Figure 24** Database function.

So let's think carefully, we have a way to extract data about the database, but if we use injection with `UNION` we must use in our case two SELECT query because the original query that the php code produces include two column, so if we do something like:

{% highlight mysql %}
select
  first_name,
  last_name
  FROM users WHERE user_id='1' or '0'='0'
  UNION
  SELECT database();
{% endhighlight %}

we will get an error.

![sql-injection-025.png](/assets/images/sql-injection-025.png)
**Figure 25** Erorr "different number of columns".

For that matter we need to use other query that contain `UNION SELECT` with two another columns, we can achieve that goal with NULL, to doing so just type the following:

{% highlight mysql %}
select
  first_name,
  last_name
  FROM users WHERE user_id='1' or '0'='0'
  UNION
  SELECT NULL, database();
{% endhighlight %}

So, we can use sort of function query to extract more data about the database and it's important that you new them all or most of them:
{% highlight mysql %}
SELECT NULL, database();
SELECT NULL, user();
SELECT NULL, version();
{% endhighlight %}

![sql-injection-026.png](/assets/images/sql-injection-026.png)
**Figure 26** Select null with function.

Now we know lets do some injection.
![sql-injection-027.png](/assets/images/sql-injection-027.png)
**Figure 27** database() - for seen the database name.

![sql-injection-028.png](/assets/images/sql-injection-028.png)
**Figure 28** version() - for seen the version of our sql database.

![sql-injection-029.png](/assets/images/sql-injection-029.png)
**Figure 29** user() - for seen the user that used fro connection the sql server.

we will use in these commands a lot in this article, it is very important to know such information because let's say in some mysql version you can do more stuff that in older version you can't do, as example the command `ROW_NUMBER()` can be use in mysql version 8.0.2, but not in version 5.5. You can view in detail the [mysqld-version-reference.](https://dev.mysql.com/doc/mysqld-version-reference/en/mysqld-version-reference-opsfuncs.html)

Now let's do the same with SELECT sentence that contain some query for password, the query I need to accomplish should look as follow:
```
SELECT first_name, last_name FROM users WHERE user_id = '1' union SELECT first_name, password FROM users WHERE user_id='1';
```

So the injection code look like that:

```
1' union SELECT first_name, password FROM users WHERE user_id='1
```

![sql-injection-020.png](/assets/images/sql-injection-020.png)
**Figure 20** Extract some password.

Well guys, did you saw that? the password is in the surname filed! it look like sort of hash so we need some tool that can find for us the real value of that hash. There is many hash crack out there, just for reminder, hash is some data that some cryptographic function was run on it and produces output of  160-bit value, please note that this is difference from encryption method, in hashing method you can't extract the original data value from the hashing value because it is [one-way function](https://en.wikipedia.org/wiki/One-way_function), so the way to find some hashing of some value is to take some data and run the hash function on it and compare the output to the hashing value you wanted to, and if there is a match you now know what is the original value.

In our case I guess the hash value is md5 type so we can check in our linux machineand find a match, just type the command as follow:
{% highlight shell %}
echo -n password | md5sum
{% endhighlight %}

![sql-injection-021.png](/assets/images/sql-injection-021.png)
**Figure 21** Hash value.

Now if you compare the output to the hash value we already have from our database, this is the same value! which mean that the password is actually "password". If you want to use some online database of crack hashing you can used this links:
[crackstation](https://crackstation.net/)
[hashkiller](https://hashkiller.co.uk/md5-decrypter.aspx)
[onlinehashcrack](https://www.onlinehashcrack.com/)
I am using them a lot and they very helpful.

So, from that output we know that admin password is 'password'... so typical lol :P

let's try to extract other password from the database, just inject the follow:
{% highlight mysql %}
1' union SELECT first_name, password FROM users WHERE user_id='1' or '0'='0
{% endhighlight %}

And that is it, all we need now is find out what is the real value for that hashs.

![sql-injection-022.png](/assets/images/sql-injection-022.png)
**Figure 22** Hashs passwords.

Let's crack all password with john the ripper, just take the data and past it in some text editor with the following structure:
```
usename:hachPassword
```

I saved the data in text.txt file, then type the following command in your terminal:
```
john --format=raw-MD5 text.txt
```

![sql-injection-023.png](/assets/images/sql-injection-023.png)
**Figure 23** john the ripper.

Please note that so far we used Union base to find the data we needed, we will implement more injection types in this article, just bear with me for a moment.

Now let's go to the higher level, change the security level to medium and go back to SQL Injection page, ![sql-injection-030.png](/assets/images/sql-injection-030.png)
**Figure 30** Security level medium.

Now in the SQL Injection you see that there is no user input, we have some selected box and now we can only select from 1 to 5 and see the user username and surname, so you may ask what we can do now? there no way to inject some query value in that case. You may right but not so quite, there is no input box for the user that true, but now we need some way to make query from the browser and change that query before it will sending to the server, to do so I am going to use burpsuite tool. In that tool we can use local proxy to transfer all our data through burpsuite and then we can change the query before it go to the server.

Before we use burpsuite we need to set our browser to use proxy which will be the burpsuite, just go to the menu in your browser and click on preferences.

![sql-injection-031.png](/assets/images/sql-injection-031.png)
**Figure 31** Security level medium.

Or press F12 on your key board and go to advance>network>setting.
![sql-injection-032.png](/assets/images/sql-injection-032.png)
**Figure 32** Security level medium.

Then change to Menual proxy configuration with http proxy of <IP_ADDRESS> which is localhost and port 8080.
![sql-injection-033.png](/assets/images/sql-injection-033.png)
**Figure 33** Security level medium.

On linux Kali the burpsuite is buildin so just click on the burpsuite icon in the bar slide and then go to proxy>intercept and click on "Intercept is off" button, by pressing that it will change to "Intercept is on", now in the SQL Injection page if we press on submit button we will see in row tab of burpsuite the data that going to be send and all we need to do next is to change it!

![sql-injection-034.png](/assets/images/sql-injection-034.png)
**Figure 34** Security level medium.

Now let's use the Error base technique, we know that we have some query and we don't need to new the database name, but we need to know the number of column in the original query because we want to use UNION and in that case we must to use equal column number for our injected query, for doing so we can use the command ORDER BY column number. ORDER BY used for ordering the value inside the columns, so if we type ORDER BY 1 it will order our request by column 1 in alpha beta form, and if we type ORDER BY 2 it will order our column number 2.

![sql-injection-035.png](/assets/images/sql-injection-035.png)
**Figure 35** ORDER BY example.

In case we type some number that not match the columns we will get some error, so in my case if I type ORDER BY 6 it will bring me an error because I haven't column 6.

![sql-injection-036.png](/assets/images/sql-injection-036.png)
**Figure 36** ORDER BY error.

So, let's try that up in on our target, just type the injection query in the burpsuite as follow and press on forward:
{% highlight mysql %}
1 ORDER BY 1
{% endhighlight %}

![sql-injection-037.png](/assets/images/sql-injection-037.png)
**Figure 37** ORDER BY 1.

We have no error so let's try:
{% highlight mysql %}
1 ORDER BY 3
{% endhighlight %}

![sql-injection-038.png](/assets/images/sql-injection-038.png)
**Figure 38** ORDER BY error.

Cool! we have some error, so this is mean that we have no column 3 in the table, now let's try check column 2, it more likely that it will work.

![sql-injection-039.png](/assets/images/sql-injection-039.png)
**Figure 39** ORDER BY 2.

It work! so now we know that we have 2 column in that table so if we using UNION we need to select two columns in our query, but we still need more data like the columns name and tables name, we can guess it but there is a way to extract that out, for doing so we going to use [information_schema.](https://dev.mysql.com/doc/refman/5.7/en/information-schema.html), this is the way  to provide access to the database metadata so we can make some query about the columns name with that option, just type as follow:

{% highlight mysql %}
1 UNION SELECT null, column_name FROM information_schema.columns
{% endhighlight %}

![sql-injection-040.png](/assets/images/sql-injection-040.png)
**Figure 40** information_schema.columns.

So now we have the name of all the column name from all database that exist in that sql server, and if we scroll down little bit we will find some value that look like what we search so far.

![sql-injection-041.png](/assets/images/sql-injection-041.png)
**Figure 41** Column values name.

New let's check the tables name with information_schema.tables
{% highlight mysql %}
1 UNION SELECT null, table_name FROM information_schema.tables
{% endhighlight %}
![sql-injection-042.png](/assets/images/sql-injection-042.png)
**Figure 42** tables name.

So the users table is what we looking for. Now we can accomplish the command we want in the first place, now inject the following:
{% highlight mysql %}
1 UNION SELECT first_name, password FROM users
{% endhighlight %}

![sql-injection-043.png](/assets/images/sql-injection-043.png)
**Figure 43** users and password.

We did it again guys!!! we won!!! or more likely we own the database!!!! GAME OVER!
![sql-injection-044.png](/assets/images/sql-injection-044.png)
**Figure 44** GAME OVER.

Let's go to the next level! but before that I want you to solve by yourself the the High Level, this time you have all of the knowledge you need to do so, after you finish please step foreword and see how I solved that level, if your solution is different then my, please let me know:) or comment down below.

After you change the level on "DVWA Security" to High Level, you can see that in SQL Injection page, now you have some link that open new window for you type in the ID you want, and if we typed the injection like we done so far it doesn't work for us:

![sql-injection-045.png](/assets/images/sql-injection-045.png)
**Figure 45** The injection doesn't work.

So as you can see we expected to see every user in the table but unfortunately we got 1 error line that not look like sql error, and now if we type some other query that should bring up an error, this is not work as well:
![sql-injection-046.png](/assets/images/sql-injection-046.png)
**Figure 46** No sql error.

As you can see I just add a single quote "**'**" to the query and I got "something went wrong" that mean we have no errors in that level like we saw in other levels.

Again, we need first of all the table name and the column number but we have no way to inject our SQL code and we get no error so let's think what we can do, if you remember in the beginning of that article we saw some of the [SQL operators](#sql-operators) that we can used in our query, and we have "Hash" sign that used for commit in our query like in other programing language so let's see how that go.

![sql-injection-047.png](/assets/images/sql-injection-047.png)
**Figure 47** Query with Hash sign.

So now we know that there is something that deny for us every query, I want you just look in the source code to see how they apply that.

![sql-injection-048.png](/assets/images/sql-injection-048.png)
**Figure 48** Limit in query with Hash sign.

Ok, we know now that the query limit for one query only and the error come from the php code, so keep that in mind that this one way to migrate the injection, but as you saw he have way to make the injection anyway with the Hash sign because in SQL this is treat as comment on the query line so this is why the limit to 1 are ignored.

So now let's inject the usual injection codes. I am going to apply that injection like I have no clue how the original php code look like.
{% highlight mysql %}
1' ORDER BY 1#
1' ORDER BY 2#
1' ORDER BY 3#
1' UNION SELECT null, table_name FROM information_schema.tables#
1' UNION SELECT null, column_name FROM information_schema.columns#
1' UNION SELECT first_name, password FROM users#
{% endhighlight %}

From the first two line we will see that everything work normal but not in the third line, so this is mean that we use only 2 columns, so now I am checking the table name and the columns names that exist in that database, in the last query I am using the columns name on users table in my query and that's it, we have what we need!

![sql-injection-049.png](/assets/images/sql-injection-049.png)
**Figure 49** Injection are working with `#` sign.

Please remember that it still Error base, maybe you can called it Blind base but I doesn't because we have some of error in that level, yeh sure this is not a SQL error, but still we have a way to see here we inject some miss type SQL query.

Now let's go for the "Impossible" level and see how that is going on. Again, I recommend to try that level by yourself, I admit that is difficult one, but maybe you have the knowledge to solve it by yourself and if not you can try anyway and lean through Google more and maybe you will find the answer. After you finish check out what I've done this time, and again, if you find different solution please let me know or leave a commit down below.

Ok, everybody like tools, so this is time to lean some tools. It is very important for you to know how to used that tools if you going to check injection vulnerabilities on some website, in this level we face with blind base, if you try to insert something simple like `1` you will see that it's work fine but if you try to insert something that should cause some error like `1'`, your error will never showed up because the php code prevent from us to get the error value, so if he have some error he will never send it to us, just remember that the code that I am talking about is server side code like we saw earlier in this article, and we would never get an access to server side codes, so just keep that in mind, in our case we can view the source code.

![sql-injection-050.png](/assets/images/sql-injection-050.png)
**Figure 50** Have no error.

So in the source code you can see that we have some `if` statement that treat ID only if it equal to numeric value, but we have no `else` statement that treat ID if it doesn't equal to some number so this is blind base.

![sql-injection-051.png](/assets/images/sql-injection-051.png)
**Figure 51** Blind base.

To work around that case we going to use sqlmap, first of all I want you to read about [sqlmap]()

### How to migrate that vulnerability.
**coming soon**

### Videos in Hebrew about SQL injection:

gha_language: HTML


text:
---
name: Bug Report
about: Report a bug encountered

---
<!-- Please use this template while reporting a bug and provide as much info as possible. Not doing so may result in your bug not being addressed in a timely manner. Thanks!-->

**What happend**:

**What you expected to happen**:

**How to reproduce it (as minimally and precisely as possible)**:

**Anything else we need to know?**:

**Environment**:

- Multus version
  image path and image ID (from 'docker images')
- Kubernetes version (use `kubectl version`):
- Primary CNI for Kubernetes cluster:
- OS (e.g. from /etc/os-release):
- File of '/etc/cni/net.d/'
- File of '/etc/cni/multus/net.d'
- NetworkAttachment info (use `kubectl get net-attach-def -o yaml`)
- Target pod yaml info (with annotation, use `kubectl get pod <podname> -o yaml`)
- Other log outputs (if you use multus logging)

gha_language: Go


text:
# Lab 07 - Blocking lab

So far we have been working with CPU bound code. We have not had to perform any kind of synchronous or blocking actions.
Ratpack is asynchronous and non-blocking from the ground up. Ratpack's APIs are marked as `ratpack.api.NonBlocking` where
appropriate to denote the API's non-blocking and asynchronous nature.

In the real world our existing libraries tend to be blocking and synchronous like the JDBC library.

Ratpack uses a much smaller set of Threads to manage HTTP Request handling, a single thread could be responsible for handling
hundreds of active connections. If you perform a blocking action one of Ratpack's main compute threads you will impede
throughput and prevent other requests from being processed until the blocking code completes.

Ratpack provides a great utility for integrating synchronous/blocking code with Ratpack's Execution Model via
`ratpack.exec.Blocking`. This `Blocking` utility allows users to specify blocking code that will inform Ratpack to
 execute the blocking code on Ratpack's blocking scheduler.

Ratpack provides two constructs for representing an asynchronous units of work: `ratpack.exec.Promise` and `ratpack.exec.Operation`.

The `Blocking` utility creates `Promise` and `Operation` from user supplied code which can then be further mapped or consumed.

## What to do

Make the tests in `BookSpec` pass.

To be able to do that will need to implement the `DefaultBookRepository` to perform blocking database calls.
This lab provides generated jOOQ library that specifies a typed representation of the `book` table.

There are also some TODOs within `Ratpack.groovy`.

## This lab covers

* Working with synchronous/blocking libraries
* Working with Promises and Operations
* Working with Blocking api
* Working with Ratpack's integration with H2 and Hikari
* Parsing incoming JSON

## Sign Posts

[`ratpack.exec.Promise`](https://ratpack.io/manual/current/api/ratpack/exec/Promise.html)

[`ratpack.exec.Operation`](https://ratpack.io/manual/current/api/ratpack/exec/Operation.html)

[`ratpack.exec.Blocking`](https://ratpack.io/manual/current/api/ratpack/exec/Blocking.html)

[`ratpack.handling.Context#parse(Class)`](https://ratpack.io/manual/current/api/ratpack/handling/Context.html#parse-java.lang.Class-)

repository: erdi/ratpack-sandpit

repo_name: erdi/ratpack-sandpit


text:
---
added: 2017-08-31 13:43:32+00:00
creators:
- email: null
  name: Mark Phillips
dates:
- end: '2016-07-14'
  start: '2016-07-05'
published: 2017-08-31
repository: University of North Texas
subjects:
- Police
- Activism
title: Dallas Police Shooting Twitter Dataset
tweets: 7146993
url: https://digital.library.unt.edu/ark:/67531/metadc991469/
---

This dataset contains Twitter JSON data for several Twitter search queries that were collected the week following the shooting of police officers in Dallas, Texas on July 7th 2017, using the twarc (https://github.com/edsu/twarc) package that makes use of Twitter's search API. See included README.txt for additional information.

repository: remagio/catalog

repo_name: remagio/catalog


text:
# ae
ae stands for AWS Erlang

This repo is a prototype repo of for creating AWS with the Erlang [Actor model](https://en.wikipedia.org/wiki/Actor_model)

### Build
```
$ rebar3 compile
```

repository: aaronlelevier/ae

branch_name: refs/heads/main

repo_name: aaronlelevier/ae


text:
# Galatians 04 General Notes
## Structure and formatting

Some translations set each line of poetry farther to the right than the rest of the text to make it easier to read. The ULT does this with verse 27, which is quoted from the Old Testament.

## Special concepts in this chapter

### Sonship
Sonship is a complex issue. Scholars have many views on Israel’s sonship. Paul uses sonship to teach how being under the law differs from being free in Christ. Not all of Abraham’s physical descendants inherited God’s promises to him. Only his descendants through Isaac and Jacob inherited the promises. And God only adopts into his family those who follow Abraham spiritually through faith. They are children of God with an inheritance. Paul calls them “children of promise.” (See: [[../bible/kt/inherit]], [[../bible/kt/promise]], [[../bible/kt/spirit]] and [[../bible/kt/faith]] and [[../bible/kt/adoption]])

## Other possible translation difficulties in this chapter

### Abba, Father
“Abba” is an Aramaic word. In ancient Israel, people used it to informally refer to their fathers. Paul “transliterates” its sounds by writing them with Greek letters. (See: [[translate-transliterate]])

repository: mandolyte/uw-obsidian

repo_name: mandolyte/uw-obsidian


text:
# IAPR TC10/11 Resources

This is a prototype website for dataset and tools listing from IAPR technical committees 10 and 11.

This website is powered by Jekyll and some Bootstrap, Bootwatch.

Copyright TC10/11. Code released under the MIT License.

Please visit https://tc101-demo.github.io to see the live version of the website.

## Website development

### Automated deployment
Thanks to the integration with [GitHub Actions](https://docs.github.com/actions), the website is automatically recompiled and published at https://tc101-demo.github.io when any change is pushed to the master branch.

This can be configured by authorized users under the "Pages" tabs in the setting pages of the repository.

### Local development
It is also possible to build and run the website locally to perform and review changes before publishing them.
To do so, you will need a working Ruby distribution (with dev headers to enable native extensions) to start with, because we rely on the [Jekyll](https://jekyllrb.com/) static site builder.

With Debian/Ubuntu, the command should be:
```shell
sudo apt update
sudo apt install ruby-dev build-essential
```

Then, according to Jekyll documentation, you can install Jekyll and its dependencies with:
```shell
gem install bundler jekyll
```
Build native extensions can take a couple of minutes, but this needs to be done only once.

Before you can compile and run the website, you need to install the website-specific dependencies using:
```shell
cd TC101-demo.github.io
bundle install
```

Finally, you can compile and run a local web server with live-reload enabled using:
```shell
# If not already in the web site root directory
cd TC101-demo.github.io
bundle exec jekyll serve --livereload
```

Voilà! Your local copy of the website should be available at http://<IP_ADDRESS>:4000/.
Any change you make should be reflected in the live version within a couple of seconds.


text:
# cantonese-syllabary
Data preparation for visualizing the Cantonese syllabary in Tableau or other tools

# Data format
The script `readcantofile.py` generates the data in `phonemes.csv`. Currently, the columns currently in `phonemes.csv` (intented for consumption by Tableau) are:
1. jyutping with tone
2. count homophones
3. jyutping without tone
4. initial letter of the jyutping,
5. first homophone character
6. full list of homophone characterss.

Example of a row:
`aat3, 13, aat, 3, a, 壓, 壓歹押遏揠戛頞堨齃恝餲猒閼`

# Original data source
The raw data in `canto-phones-raw.csv` is extracted from files included in the Jyutping IME by Dominic Yu,
which is based on LSHK table and downloadable from [http://blyt.net/domingo2/Chinese.html](http://blyt.net/domingo2/Chinese.html)

# Data visualization
An early prototype of the visualization can be found at [https://public.tableau.com/profile/denise.mak#!/vizhome/CantonesePhonemesv0_1/canto-tone-dash](https://public.tableau.com/profile/denise.mak#!/vizhome/CantonesePhonemesv0_1/canto-tone-dash)
![screenshot of visualization](canto-syl-proto.png)

repository: DeniseMak/cantonese-syllabary

repo_name: DeniseMak/cantonese-syllabary


text:
# Styvio

[![CI Status](https://img.shields.io/travis/jaredcassoutt/Styvio.svg?style=flat)](https://travis-ci.org/jaredcassoutt/Styvio)
[![Version](https://img.shields.io/cocoapods/v/Styvio.svg?style=flat)](https://cocoapods.org/pods/Styvio)
[![License](https://img.shields.io/cocoapods/l/Styvio.svg?style=flat)](https://cocoapods.org/pods/Styvio)
[![Platform](https://img.shields.io/cocoapods/p/Styvio.svg?style=flat)](https://cocoapods.org/pods/Styvio)

## Example

To run the example project, clone the repo, and run `pod install` from the Example directory first.

## Requirements

## Installation

Styvio is available through [CocoaPods](https://cocoapods.org). To install
it, simply add the following line to your Podfile:

```ruby
pod 'Styvio'
```

## Author

jaredcassoutt<EMAIL_ADDRESS>
## License

Styvio is available under the MIT license. See the LICENSE file for more info.

repository: jaredcassoutt/Styvio

repo_name: jaredcassoutt/Styvio


text:
### BLEbee

The MIT License (MIT)
Copyright (c) 2012-2014 Dr. Michael Kroll

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.

### Content

The final design of the BLEBee v1.0.0 Rev.B. looks as on the illustration below. Please use the pinout as illustrated.

[![](https://raw.github.com/michaelkroll/BLEbee/master/docs/BLEBee-v1.0.0-Rev.B.-Pin-Out.png)](https://raw.github.com/michaelkroll/BLEbee/master/docs/BLEBee-v1.0.0-Rev.B.-Pin-Out.png)

http://www.mkroll.mobi

http://forum.mkroll.mobi

This repository contains the eagle design files as well as the firmware source code which are needed modify and rebuild the firmware. The hexfiles are included as well. Moreover I added the Arduino Sketches from my blog to this repository as well.

Notes for BLEbee 1.0.0:
-----

-The Eagle design files are created using Eagle v6.4.0

-The Firmware v1.0.0 for the BLE112 module on the BLEbee was created and compiled for the Bluegiga BLE112 SDK v1.1.1-b71

-The Firmware v1.0.1 for the BLE112 module on the BLEbee was created and compiled for the Bluegiga BLE112 SDK v1.2.1-b91

repository: NormanHung/BLEbee

repo_name: NormanHung/BLEbee


text:
## ![Pushmix](https://www.pushmix.co.uk/media/favicons/favicon-32x32.png) Pushmix Notifications Driver for Laravel 6

[![Latest Version on Packagist](https://img.shields.io/packagist/v/pushmix/laravel-web-notification.svg)](https://packagist.org/packages/pushmix/laravel-web-notification)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](LICENSE.md)
[![StyleCI](https://github.styleci.io/repos/153896598/shield?branch=master)](https://github.styleci.io/repos/153896598)
[![Build Status](https://img.shields.io/travis/pushmix/laravel-web-notification/master.svg)](https://travis-ci.org/lpushmix/laravel-web-notification)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/pushmix/laravel-web-notification/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/pushmix/laravel-web-notification/?branch=master)
[![Code Coverage](https://scrutinizer-ci.com/g/pushmix/laravel-web-notification/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/pushmix/laravel-web-notification/?branch=master)
[![Code Intelligence Status](https://scrutinizer-ci.com/g/pushmix/laravel-web-notification/badges/code-intelligence.svg?b=master)](https://scrutinizer-ci.com/code-intelligence)

## About

This package makes it easy to send [Pushmix notifications](https://www.pushmix.co.uk/docs/laravel-package) with Laravel 6

## Contents

- [Setting up your Pushmix account](#setting-up-your-pushmix-account)
- [Installation](#installation)
	- [Configuration](#configuration)
- [Displaying Opt In Prompt](#displaying-opt-in-prompt)
- [Usage](#usage)
	- [Available Message methods](#all-available-methods)
- [Changelog](#changelog)
- [Testing](#testing)
- [Issues](#issues)
- [Security Vulnerabilities](#security-vulnerabilities)
- [Contributing](#contributing)
- [Credits](#credits)
- [License](#license)

## Setting up your Pushmix account

If you haven't already, sign up for a free account on [pushmix.co.uk](https://dash.pushmix.co.uk/register).

[Create new subscription](https://www.pushmix.co.uk/docs/create-subscription) for your website and choose preferred [integration method](https://www.pushmix.co.uk/docs/installation). Build your subscribers audience via displaying an Opt-In Prompt asking users for permission to send them push notifications.

## Installation

You can install the package via composer:

```bash
$ composer require pushmix/laravel-web-notification:dev-master
```

If you're installing the package in Laravel 5.4 or lower, you must import the service provider:

```php
// config/app.php
'providers' => [
    ...
    Pushmix\WebNotification\PushmixServiceProvider::class,
],
```

## Configuration

Publish package config and view files:

```bash
php artisan vendor:publish --provider="Pushmix\WebNotification\PushmixServiceProvider"
```

Add your Subscription ID into `.env` file:

```bash
PUSHMIX_SUBSCRIPTION_ID=PASTE_YOUR_SUBSCRIPTION_ID_HERE
```

## Displaying Opt In Prompt

To display Opt-In Prompt you will need to include block of JavaScript into your template using Blade `@include` directive.

Alternatively you can copy and paste content of `vendor.pushmix.optin` into template.

```bash
    <body>
        ...

            <div class="content">
                <div class="title m-b-md">
                    Laravel
                </div>
        </div>

        <!-- Including Opt In Prompt in Blade template-->

        @include('vendor.pushmix.optin')

    </body>
    ...
```

## Usage

Now you can use the channel in your `via()` method inside the notification:

``` php
use Pushmix\WebNotification\PushmixChannel;
use Pushmix\WebNotification\PushmixMessage;
use Illuminate\Notifications\Notification;

class AbandonedCart extends Notification
{
    public function via($notifiable)
    {
        return [PushmixChannel::class];
    }

		public function toPushmix($to)
    {

      return PushmixMessage::create($to)
		  /* Required Parameters */
          ->title("You still have items in your Cart!")
          ->body("There's still time to complete your order. Return to your cart?")
          ->url("https://www.pushmix.co.uk")

		  /* Optional Parameters */
          ->button("Return to your cart", "https://www.pushmix.co.uk/docs") // button one
          ->priority("high")
          ->ttl(7200) // time to live
          ->icon("https://www.pushmix.co.uk/media/favicons/apple-touch-icon.png")
          ->badge("https://www.pushmix.co.uk/media/favicons/pm_badge_v2.png")
          ->image("https://www.pushmix.co.uk/media/photos/photo16.jpg");
    }
}
```

The notifications will be sent to the audience, which subscribed via Opt-In Prompt displayed on your website.
Using the `Notification::route` method, you can specify which subscribers group you are targeting.

```php
use Notification;
use App\Notifications\AbandonedCart;
...
// Target All Subscribed Users
Notification::route('Pushmix', 'all')->notify(new AbandonedCart());

// Target Topic One Subscribers
Notification::route('Pushmix', 'one')->notify(new AbandonedCart());

// Target Topic Two Subscribers
Notification::route('Pushmix', 'two')->notify(new AbandonedCart());

```
### All available methods

[Pushmix documentation](https://www.pushmix.co.uk/docs/api)

- `title('')`: Accepts a string value for the title, required*
- `body('')`: Accepts a string value for the notification body,required*
- `url('')`: Accepts an url for the notification click event,required*

- `button('', '')`: Accepts string value for button title and an url for the notification click event. Max 2 buttons can be attached.
- `icon('')`: Accepts an url for the icon.
- `priority('')`: Accepts `high` or `normal` strings.
- `ttl('')`: Accepts an integer, notification life span in seconds,must be from 0 to 2,419,200
- `icon('')`: Accepts an url for the icon.
- `badge('')`: Accepts an url for the badge.
- `image('')`: Accepts an url for the large image.

## Testing

Navigate into the package folder `vendor/pushmix/laravel-web-notification` and issue following command:

```bash
$ composer test
```

## Issues

If you come across any issues please report them [here](https://github.com/pushmix/laravel-web-notification/issues).

## Security Vulnerabilities
If you discover a security vulnerability please send an e-mail to<EMAIL_ADDRESS>
## Contributing

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

## Credits

- [Alexander Pechkarev](https://github.com/alexpechkarev)

## License

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

repository: pushmix/laravel-web-notification

gha_language: PHP

gha_license_id: MIT

repo_name: pushmix/laravel-web-notification


text:
# gsow-stats

## Running

First build:

`docker build -t gsow .`

To login:

`docker run -it gsow`

## Project Goals

* Fix unicode issues
* Define a metric measuring the significance of a change (e.g. include missing hyperlink vs. completely new article written)
* Track the number of page views for edited page of GSoW editors
* Provide exploratory and visual tools to assess and measure the impact of the team's efforts

## Code Overview

Web application files live in `www/`

Backend data retrieval is done by `get-data2.py`

repository: kylepolich/gsow-stats

gha_language: CSS

repo_name: kylepolich/gsow-stats


text:
# Needle in a Haystack: Label-Efficient Evaluation Under Extreme Class Imbalance

This repository contains files required to reproduce the experiments for the
following paper:

> Neil G. Marchant and Benjamin I. P. Rubinstein. 2021.
  Needle in a Haystack: Label-Efficient Evaluation under Extreme Class
  Imbalance.
  In _Proceedings of the 27th ACM SIGKDD Conference on Knowledge Discovery and
  Data Mining (KDD ’21)_,
  ACM, New York, NY, USA, 11 pages.
  DOI: [10.1145/3447548.3467435](https://doi.org/10.1145/3447548.3467435).
  arXiv: [2006.06963](https://arxiv.org/abs/2006.06963).

## Datasets

All seven data sets are included in the `datasets` directory in HDF5 format.
Each data set may contain the following variables:

* `features`: feature vectors
* `labels`: ground truth labels
* `scores`: real-valued classifier scores, e.g. distance from the decision
  boundary for an SVM
* `probs`: classifier probabilities, i.e. estimates of p(y|x)
* `preds`: predicted labels according to the classifier

## Dependencies

The main dependency is the [ActiveEval](https://github.com/ngmarchant/activeeval)
Python package, which implements our method as well as static importance
sampling and passive sampling.
Other dependencies include:

* `numpy`
* `pandas`
* `scipy`
* `matplotlib`
* `seaborn`
* `tables` (for reading HDF files)
* `oasis` (implementation of the OASIS evaluation method)
* `pathos` (for parallelizing experiments)

We recommend managing dependencies in a Python virtual environment using
[Pipenv](https://pipenv.pypa.io). The included `Pipfile` and `Pipfile.lock`
files specify all dependencies and their versions. Assuming Pipenv is
installed, you can initialize the virtual environment by running the
following command from the root of this repository:

```bash
$ pipenv sync
```

## Scripts

The experiments can be reproduced by executing the `run-*.py` scripts in the
root of this repository. First, ensure the virtual environment has been
initialized according to the instructions under "Dependencies". Then enter
the virtual environment by executing the following from the root of
the repository:

```bash
pipenv shell
```

Now you're ready to run the scripts. To run the experiments for F1-score,
execute the following:

```bash
(activeeval-experiments) $ python run_f1-score.py
```

Each script runs the experiments for a different target measure: `accuracy`,
`f1-score` or `pr-curve` (precision-recall curve). Multiple datasets and
methods are evaluated for each measure, with the evaluation for
each measure/dataset/method being repeated 100 times. The repeated
evaluations are parallelized across 4 workers using the `pathos` library.
The number of workers can be changed by modifying the `n_processes` variable
in each script.

### Output
Results are saved in the `results` directory. The results for each target
measure are stored in a different subdirectory, e.g. results for `f1-score`
are stored at `results/f1-score`. Various diagnostic plots are saved under
this subdirectory in PDf format, as well as the complete sampling history
in compressed npz files.

repository: ngmarchant/activeeval-experiments

repo_name: ngmarchant/activeeval-experiments


text:
---
permalink: "/Release-of-Samsung-Internet-Chrome-Extension-v2/"
title: Release of Samsung Internet Chrome Extension v2
category: "Browser Features"
cover: img.jpg
author: Divjot Singh
---

### Release of Samsung Internet Chrome Extension v2

> **Update Oct 2017:** Since the release of v2 (March 2017), we saw a **9.3x increase** in our monthly active users (~8k to 75k). We also observed **35% jump** in the rating. Thank you so much for using & liking our extension, stay tuned for more updates!

![](https://cdn-images-1.medium.com/max/600/1*e16MS4BgBe8e-DtlF666JA.png)

Today we are very glad to release the much awaited [version 2](https://chrome.google.com/webstore/detail/samsung-internet/epejdmjgfibjaffbmojllapapjejipkh) of our Chrome Extension. [Install](https://chrome.google.com/webstore/detail/samsung-internet/epejdmjgfibjaffbmojllapapjejipkh) it today to sync bookmarks across your Chrome browser on PC and Samsung Internet.

The Samsung Internet extension, earlier known as Samsung Sync (v1.4), not only sports a new name but also comes with tonnes of features and a massive UI overhaul. I’ll walk-through the new additions in the article.

* * *

> Drastic improvements to first-sync performance.

First-sync performance was the number one complaint in our web store reviews, usually leaving users to never actually getting around to use our extension. We hit the heart of the issue with a dagger by rewriting several modules and chaining network requests, database queries and DOM updates in a much more optimized manner. With this release, you can now not only see the progress of sync, but also the fetched bookmarks as and when they arrive. We feel this will solve the top complaint and allow users to enjoy the extension.

![](https://cdn-images-1.medium.com/max/800/1*qYPi94TVyTF1p1aX1BCW9g.gif)

> Consistent UI with [Samsung Internet on Android.](https://play.google.com/store/apps/details?id=com.sec.android.app.sbrowser)

We are proud of our UX team’s efforts in offering a very modern look and feel to the extension. The small 600 x 400 screen real estate makes it much harder to add features while keeping the interface user-friendly. After several iterations, I think we’ve pretty much nailed it. From a progress bar to show sync status to modals for bookmark management, the UI even though offering several functionalities doesn’t overwhelm the user.

![](https://cdn-images-1.medium.com/max/800/1*hE8PGhNMYIhyt3WsuEF50Q.png)

Live loading of bookmarks, top requested feature.

> Enhanced bookmark management.

The previous version (1.4) was bit limiting in the sense users could only edit title or delete a bookmark. We felt that the extension can offer much more than that and with today’s release, not only basic create / update / delete / move is supported, but users can also import Chrome bookmarks into their Samsung account. We feel that this brings the control back to the user.

![](https://cdn-images-1.medium.com/max/800/1*d6bWg_Yhi2DyDM0JSZdrjA.png)

Improved Bookmark Management

> And much more…

The feature list just doesn’t stop here ! Some of the other miscellaneous changes:

*   Context menu support to bookmark current tab with a single click.
    _Pro tip: You can use_ **_Ctrl/Cmd + Shift + Y_** _combination to bookmark instantly._
*   Improved internationalization for supported languages.
*   Improved keyboard accessibility, you can tab your way through all items.

> **Update April 2017:** Version 2.0.5 is now released to Chrome Web Store that fixes login related issues faced by certain users with the previous version (2.0.3).

Let us know if you run into issues, or just want to give us some feedback. We’ll follow up soon with our plans for releasing the extension for other browsers. Make sure you follow [Samsung Internet Developers](https://medium.com/samsung-internet-dev) on [twitter](https://twitter.com/samsunginternet).

**Note:** The Sync functionality is only available for phones logged in with a Samsung Account on a stable release of Samsung Internet, which means that it won’t work with [Samsung Internet Beta](https://medium.com/samsung-internet-dev/samsung-internet-beta-now-available-without-sign-up-e0d5d4010838#.ntaxejovf) (v5.4) on non-samsung phones, just yet.

Tagged in [Chrome Extension](https://medium.com/tag/chrome-extension), [Samsung](https://medium.com/tag/samsung), [Browsers](https://medium.com/tag/browsers), [Samsung Internet](https://medium.com/tag/samsung-internet)

By [Divjot Singh](https://medium.com/@bogas04) on [March 9, 2017](https://medium.com/p/644e7b97096e).

[Read this article on Medium](https://medium.com/@bogas04/release-of-samsung-internet-chrome-extension-v2-644e7b97096e)


text:
Quickstart C++ Wrapper Backend Tutorial {#simple_cpp_example}
========================
##Backend Engine addition tutorial
This tutorial details the steps involved in implementing a new backend engine utilizing the C++ wrapper for use with the testing framework.
This guide is intended to be a beginers guide for people who are looking to get a backend with a single test implemented quickly. It is based on using the `api_bridge_example_backend` as a starting point for a new backend implementation which uses the [C++ wrapper](@ref CPP_overview).

For the purposes of this guide we will be creating a very basic backend implementing a benchmark for the **vector element-wise addition** workload, under the **offline** category, with **first operand in plain text and second encrypted**, using Microsoft SEAL to perform Homomorphic Encryption (HE) operations.

Follow the tutorial steps in order to complete it.

## Tutorial steps

Tutorial Home

[Preparation](backend_tutorial_preparation.md)

[Engine Initialization and Benchmark Description](backend_tutorial_init.md)

[Benchmark Implementation](backend_tutorial_impl.md)

[File References](backend_tutorial_files.md)

repository: ajagann/frontend

repo_name: ajagann/frontend


text:
# enqueue

Use `docker-builder enqueue` to push a build for your *current working
directory* to your Docker build server.  To use on localhost, run the server
in one tab and enqueue in another.  For example:

```bash
docker-builder serve &
docker-builder enqueue
```

Or, you may push directly to your build server by setting the
docker-build-server host:

```bash
# via the environment
export DOCKER_BUILDER_HOST="http://localhost:5000"
docker-builder enqueue
```

or

```bash
# via the command line
docker-builder enqueue --host "http://localhost:5000"
```

repository: rafecolton/docker-builder

repo_name: rafecolton/docker-builder


text:
# Interoperability Panel
June  22, 2020

## Attendees

- Justin B.
- Josh C.
- Eric P.

## Agenda

- Ecosystem Proposal - Discuss updates for https://github.com/solid/data-interoperability-panel/issues/45 in this branch - https://github.com/solid/data-interoperability-panel/tree/ecosystem-rdf-types

## Minutes

### Ecosystem Proposal

EP - What is the objective for this proposal? All Solid uses it, some segments use it?

JB - Should be able to have different kinds of client ecosystems that evolve over the core solid protocol. At a minimum it should be one that provides something end to end, and can be iterated upon and improved.

JC - Need something like this to make real applications, though it should evolve and improve over time. Nothing we're doing that precludes people from building their own things their own ways. Wizards can be wizards if they like, but this will allow everyone to use it.

JC - Can we link specifically to shape and shape tree docs from proposal

EP - Don't need some of the type-specific sub-properties. Can use general ones in cases like "hasApplicationRegistry", "hasApplicationRegistration".

EP - Consider different layouts for the Registrar Data Model image (e.g. more of a stacked cascading approach) to better inform the reader.

EP - Move Resources in Pod to the left on Figure 7 and keep shape trees in the middle. Resources -> Shape Trees -> Shapes. (JB - DONE)

JC - Likes data model -> structure and layout progression. Needs links to shape trees and shapes in the documents.

EP - Maybe some fancy mouseover stuff you can do there.

JC - Permission model should swap generic instance names for something more intuitive

EP - Add a footnote that explains control privileges are scoped to the trusted agent subject.

JC - Define Selectively Trusted and Selectively Granted ahead of time.

JB - Permission model still needs some ACL examples to be added.

JB - Target is to have App Registration updated and pulled mid-week, and Data Registration draft for next panel session (next week).

repository: solid/data-interoperability-panel

gha_language: Bikeshed

repo_name: solid/data-interoperability-panel


text:
0.3.6
===

Features:
---

- ```decimal_conv:to_binary/2``` function with ```pretty :: boolean()``` option.
- new ```?d_pretty``` macro option (default is **true**) that changes
```?to_binary``` behavior

Breaking Changes
---

- Droped internal ```decimal_conv:to_binary/1``` function

repository: Nenzyz/decimal

repo_name: Nenzyz/decimal


text:
MyBB Auto Post Updater
======================

This plugin allows certain threads in certain forums to automatically update when there is a new post, getting rid of the need to refresh the page.

I haven't worked on this plugin in ages, it probably has a few issues and code problems.  I'll be working on it again soon.

repository: PenguinPaul/MyBB-Auto-Post-Updater

repo_name: PenguinPaul/MyBB-Auto-Post-Updater


text:
# Changelog

## Version 1.3
- Can create QR code by pressing enter button instead of generate
- Changed input type to number, so you can use numeric keypads - woohoo!
- Added button for add to homescreen logic
- Code cleanup, general housekeeping :bug:

## Version 1.2
- Removed tooltips, they were annoying because they got stuck on a touchscreen
- Re-enabled pull-to-refresh so the app can update. Fixed the offline refresh showing a broken offline screen.
- Implemented deletion of old caches

## Version 1.1
- Added info panel with attributions to QRCode library and Material Design Lite
- Disabled pull-to-refresh
- Added tooltips

## Version 1.0
- Initial version :grin:


text:
# libkt
libkt is a simple Bukkit plugin whose main purpose is to make sure Kotlin and several other
common libraries are on the classpath for other plugins to use. It also provides an API for
allowing plugins to be automatically disabled if a recent enough version of libkt isn't
installed.

## How to use libkt
Simply add `depend: [libkt]` to your `plugin.yml`.

If you would like to libkt to automatically disable your plugin when the libkt build is not
recent enough simply implement [`KPlugin`](src/main/kotlin/com/github/libkt/KPlugin.kt) like
so:

```kotlin
class MyPlugin : JavaPlugin(), KPlugin {

    override val requiredLibktBuild = 1

}
```

## Dependency Information
```
maven repo url: http://repo.onarandombox.com/content/groups/public/
groupId: com.github.libkt
artifactId: libkt
version: 1-1.1
```

repository: libkt/libkt

repo_name: libkt/libkt


text:
---
layout: post
title: Run gsutil from crontab
tags: [bash]
---

Setting up gsutil to sync files over to Google Cloud Storage (on CentOS 6) requires some environment variables to be set, which seems oddly undocumented at the moment. Turning to [Stackoverflow](http://stackoverflow.com/questions/27439326/how-to-properly-run-gsutil-from-crontab/27480249) was the solution, and here’s a summary from that.

<!--more-->

Also, the `-d` flag is required to truly catch all errors/warnings, but on very large data volumes you may want to omit this flag as it generates quite a large log file. The `> gsutil.log 2>&1` pipe is necessary to pipe both stdout and stderr to file. You can change this to `>> gsutil.log 2>&1` if you wish to append to file rather than overwrite a previous sync log.

In the example below, I’m trying to detect any already running instances of gsutil for this particular folder sync, and if such an instance is detected the gsutil command won’t execute.

Please note, you can find the path to your .boto file by running `gsutil -D ls 2>&1 | grep config_file_list` in a regular shell, outside of crontab. Make sure you run this command as the same user you intend to run gsutil with from within crontab.

Before commencing gsutil, a gcloud components update is being performed to ensure that we are using the latest and greatest version of gsutil.

```
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/home/fredrik/google-cloud-sdk/bin
HOME=/home/fredrik
BOTO_CONFIG="/home/fredrik/.config/gcloud/legacy_credentials/[your-email-address]/.boto"

# Example of job definition:
# .---------------- minute (0 - 59)
# |  .------------- hour (0 - 23)
# |  |  .---------- day of month (1 - 31)
# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# |  |  |  |  |
# *  *  *  *  * user-name command to be executed

  0  0 */1 *  * fredrik gcloud components update -q
  5  0 */1 *  * fredrik if (ps -ef | grep -v grep | grep "gs://my-bucket/my-folder/"); then echo "Skipping gsutil sync, it is already running."; else gsutil -d -m rsync -r -C /local-folder/ gs://my-bucket/my-folder/ > /gsutil.log 2>&1; fi
```