text:
# mottak
a.k.a. Laks

Prototype application for recieving archives and processing them so they can later be put into storage.

The application allow someone to upload a Noark3 or Noark5 archieve into a s3-like objectstore and run some tests against it. The following tests are run:
 - checksum is matches against the expected checksum
 - the archieve is check for virus using ClamAV (note that clamAV doesn't seem to work against archieves larger than 4GB)
 - arkade5 is run against the archieve and it generates a report
 - if the archieve is processed successfully an email is sent

Requirements:
 - docker containers for each component.
 - Kubernetes with Argo for workflow processing
 - Postgresql for metadata for invitations
 - S3 or similar Objectstore for archieves

How to setup a new enviroment:
 - get a kubernetes cluster and make sure kubectl is operational
 - create a namespace: ```kubectl create name namespace argo```
 - install argo workflow into that namespace: https://github.com/argoproj/argo/blob/master/demo.md
 - test to make sure the argo installation works.
 - Load the secrets, some guidance is found in k8s/load-secrets. You need the following secrets to be set:
   - dns-cred     # for external-dns
   - dsn          # database access string
   - gcs-cred     # Google cloud storage for tusd (the S3 APIs don't work for tusd, yet)
   - invitation   # the string needed for xss protection on the invitation app
   - mailgun      # mailgun API key and domain. we use mailgun for mail
   - s3-cret      # s3 keys for the python containers
 - go into the k8s folder and ```cp patches-template.yaml patches.yaml```
 - edit patches.yaml to suit your needs
 - edit k8s/argo/argo-artifacts.yaml (make sure you replace all the namespace references)
 - deploy (still in the k8s folder):
   - ```kubectl apply -k .```

At this point everything should work.

You can view the Argo UI by setting up a kube proxy:

kubectl -n argo port-forward deployment/argo-ui 8001:8001

Then visit http://localhost:8001/ to view the UI.

repository: msetek/mottak

repo_name: msetek/mottak


text:
### Best Practices
Following are some of the best practices to write an E to E experiment:
- An experiment yaml file can have one or more `kind: Recipe` custom resource(s)
- An experiment yaml file should be built to execute exactly one scenario
- A Recipe can depend on another Recipe via former's `spec.eligible` field
- An experiment yaml file may have only one Recipe with below label:
    - `d-testing.dope.mayadata.io/inference: "true"`
    - This label enables the Recipe to be considered by `inference.yaml`
- `inference.yaml` is used to decide if the ci passed or failed
- `inference.yaml` needs to be modified with every new test scenario
- `inference.yaml` can be used to include `failed`, `error`, `positive`, etc. scenarios
- Experiment yamls meant to run negative testing can be suffixed with `-neg`
    - Where `neg` stands for negative
- A negative test experiment will have its `status.phase` set with `Failed` by dope controller
- Presence of one or more failed test experiments will not fail the E to E
    - `inference.yaml` needs to be updated to include failed test cases
- Presence of one or more error test experiments will not fail the E to E
    - `inference.yaml` needs to be updated to include error test cases

repository: AmitKumarDas/d-operators

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: AmitKumarDas/d-operators


text:
#### Component: AlgorithmButton

|Test Name|Description|Operation|Expected Outcome|
|---------|-----------|---------|----------------|
|should contain title and code|title and code should be shown on the button|null|title and code are found on the button|
|should call onClick|Click the AlogrithmButton will call the onClick function|Click AlogrithmButton|onClick will be called once|
|should match Snapshot|Compare new snapshot with old one| null | Snapshots are the same|

license: MIT

branch_name: refs/heads/main


text:
# HTFD: Harmonic-temporal factor decomposition for unsupservised monaural source separation of harmonic sounds

[**Paper**](https://doi.org/10.1109/TASLP.2020.3037487)
| [**Demo**](https://tomohikonakamura.github.io/Tomohiko-Nakamura/demo/HTFD/)

*Harmonic-temporal factor decomposition (HTFD)* is an unsupervised source separation method of harmonic sounds.
This method can be also applied to music editing systems (e.g., changing from major to minor scales).

HTFD encompasses the well-known three concepts cultivated in the audio signal processing community (computational auditory scene analysis, non-negative matrix factorization, and source-filter model).
Please see our paper [1] for the details.

# How to run
## Requirements
- Ubuntu 16.04 and later
- docker-ce
- Octave (for SDR computation)
- Python
  - cupy
  - coloredlogs
  - librosa
  - matplotlib
  - tqdm
  - pyyaml
  - oct2py

We checked the code with the following computational environment.
- Ubuntu 16.04
- TITAN RTX (24GB RAM)
- docker-ce (Docker version 20.10.3, build 48d30b5)
  - Host's nvidia driver version: 430.6
- Octave
- Python 3.8
  ```
  cupy==8.4.0
  coloredlogs==15.0
  librosa==0.8.0
  matplotlib==3.3.4
  tqdm==4.56.0
  pyyaml==5.4.1
  oct2py==5.2.0
  ```

We recommend the following Docker-based installation for reproducibility.

### Docker
- Install Docker. (If installed, skip this step.)
- Clone this repository and `cd` to it.
- Download the evaluation tool.
  ```
  wget http://bass-db.gforge.inria.fr/bss_eval/bss_eval_2.1.zip && unzip bss_eval_2.1.zip
  ```
- Build and run a container.
  ```bash
  docker build -t htfd .
  docker run --rm -it --gpus all -v "${PWD}:/opt/htfd" htfd:latest bash
  ```
  If `docker-compose` is installed,
  ```bash
  docker-compose build
  docker-compose run --rm htfd
  ```
- Check whether the codes work.
  ```bash
  cd /opt/htfd
  python key_transpose.py -h
  ```

# Examples
## Separate synthetic data
- Download the synthetic dataset and agree the conditions of use from [here](https://docs.google.com/forms/d/e/1FAIpQLSc4lO5FieU6GBT0_z-b9weorHaKn5M0GrcChAmp3P8ibemlYQ/viewform?usp=sf_link). (You can use this dataset **only for academic research projects** and cannot use for any commercial purpose.)
  - This dataset consists of MIDI-synthesized audio signals of 7 music excerpts. These excerpts were obtained from Classic Music No. 1 to 7 from the RWC music database [3].

- Extract the downloaded file to `/path/to/repository/synth_data`.
- Execute separation and evaluation codes for HTFD and SF-HTFD.
  ```bash
  cd /opt/htfd
  # HTFD
  python unsupervised_exp.py -i synth_data/RM-C001 -o results --gpu 0 --methods HTFD --alpha_Us -5 --log_interval 1 --tf_conf conf.yaml
  # SF-HTFD
  python unsupervised_exp.py -i synth_data/RM-C001 -o results --gpu 0 --methods SFHTFD --alpha_Us -2 --log_interval 1 --tf_conf conf.yaml --n_filters 3 --filter_deg 48
  ```
- You can get the csv files of the evaluation result at `results/{HTFD,SFHTFD}_log10alphaU*/RM-C001/summary.txt`.

## Musical key transposition
- Download the Bach10 dataset (please see http://www2.ece.rochester.edu/projects/air/resource.html).
- Unzip the downloaded zip file and extract it as `/path/to/repository/real_data`.
- Execute key transposition by HTFD and SF-HTFD.
  ```bash
  cd /opt/htfd
  # HTFD
  python key_transpose.py -i real_data/01-AchGottundHerr/01-AchGottundHerr.wav --keys "C Major" -o results/real --tf_conf conf.yaml --methods HTFD4Real --gpu 0 --normalize_output
  # SFHTFD
  python key_transpose.py -i real_data/01-AchGottundHerr/01-AchGottundHerr.wav --keys "C Major" -o results/real --tf_conf conf.yaml --methods SFHTFD --gpu 0 --normalize_output
  ```

# Cite
```
@article{TNakamura2020IEEEACMTASLP,
 author={Nakamura, Tomohiko and Kameoka, Hirokazu},
 journal = {IEEE/ACM Transactions on Audio, Speech, and Language Processing},
 title = {Harmonic-Temporal Factor Decomposition for Unsupervised Monaural Separation of Harmonic Sounds},
 year=2020,
 month=nov,
 volume={29},
 number={},
 pages={68--82},
 doi={10.1109/TASLP.2020.3037487}
}
```
If you use only the `pyfacwt` module, please cite [2]. This module performs the fast approximate version of the continuous wavelet transform and its inverse transform.

# License
[MIT License](LICENSE)

# References
[1] Tomohiko Nakamura and Hirokazu Kameoka, "Harmonic-Temporal Factor Decomposition for Unsupervised Monaural Separation of Harmonic Sounds," IEEE/ACM Transactions on Audio, Speech, and Language Processing, vol. 29, pp. 68–82, Nov. 2020.
[2] Tomohiko Nakamura and Hirokazu Kameoka, "Fast Signal Reconstruction from Magnitude Spectrogram of Continuous Wavelet Transform Based on Spectrogram Consistency," in Proceedings of the 17th International Conference on Digital Audio Effects, Sep. 2014, pp. 129–135.
[3] Masataka Goto, "Development of the RWC Music Database," Proceedings of the 18th International Congress on Acoustics, pp.I-553-556, Apr. 2004.

repository: TomohikoNakamura/HTFD

repo_name: TomohikoNakamura/HTFD


text:
cockpit cookbook
====================================

This cookbook installs and configures the [Cockpit server administration interface](http://cockpit-project.org/).

Scope
=====
- Supports RHEL 7.x
- Install and configure Cockpit service with packages from Red Hat Extras repo
- Optionally install Cockpit features - PCP metrics logging and Kubernetes dashboard
- Deploy custom SSL certificate for Cockpit from Chef Vault or a Chef data bag
- Configure firewalld and SELinux policies for Cockpit
- Specify port for Cockpit console

Requirements
============
- Tested to work with Chef 12.7.x or higher
- Requires a system with a valid and active Red Hat Subscription and access to Red Hat repositories from redhat.com or via Satellite / Katello.

Simple Cookbooks
================

This is intended to be the first of a series of simple cookbooks for RHEL 7.x / CentOS 7.x. The idea is to have simple reusable code, minimal dependencies and stick to best practices for RHEL 7.x.

- Always use RPM installs, from official repos where possible
- Include options to configure SELinux, Firewalld, SystemD services
- Common dependencies to support configuration of yum repos, Red Hat subscriptions, manage config files with Augeas, firewalld, and SELinux policies.

Usage
=====
Place a dependency on the `cockpit` cookbook in your
cookbook's metadata.rb:

```ruby
depends 'cockpit', '~> 0.4.0'
```

Or include the default recipe in your run list as ``'recipe[cockpit]'``.

This cookbook depends on the [firewalld cookbook](https://supermarket.chef.io/cookbooks/firewalld), the [augeas cookbook](https://supermarket.chef.io/cookbooks/augeas) and the [Red Hat Subscription Manager cookbook](https://supermarket.chef.io/cookbooks/redhat_subscription_manager).

Attributes
==========

These attributes can be used to customize the Cockpit install.

* `node['cockpit']['port']` - Modify the listen port for Cockpit.
   Defaults to 9090.
* `node['cockpit']['logintitle']` - Set the LoginTitle attribute in cockpit.conf, which is shown on the login page.
* `node['cockpit']['features']['pcp']` - Install the PCP framework to allow Cockpit to store system metrics.
* `node['cockpit']['features']['kubernetes']` - Install the [Kubernetes dashboard](http://cockpit-project.org/guide/latest/feature-kubernetes.html). At the moment this uses the CentOS 7 Extras repo to get the cockpit-kubernetes package.
* `node['cockpit']['configure_repo']` - Configure / enabled yum repositories for Cockpit as specified by `node['cockpit']['repo']`
* `node['cockpit']['repo']` - Three allowed values here:

>>1) `rhel-7-server-extras-rpms` : Use RHEL Extras repo for Cockpit packages, except `cockpit-kubernetes`, if enabled, which has to come form CentOS Extras.

>>2) `centos-extras` : Configure CentOS 7 Extras repo to install Cockpit packages only. It is preferable to use the [`yum-centos` cookbook](https://github.com/chef-cookbooks/yum-centos) instead.

>>3) `cockpit-preview` - Install the latest, bleeding edge versions of Cockpit packages from the [cockpit-preview COPR repo](https://copr.fedorainfracloud.org/coprs/g/cockpit/cockpit-preview/)

Custom SSL certificate
----------------------

A custom SSL certificate and key can be provided as follows:
* `node['cockpit']['ssl_vault']` - Name of data bag or Chef vault
* `node['cockpit']['ssl_item']` - Name of item in vault / data bag containing JSON keys for the certificate (`cert`) and private key (`key`) in the PEM format. See `test/integration/data_bags` for an example.

Testing
=======

Integration tests are written in [BATS](https://github.com/sstephenson/bats)

Contributing
============

1. Fork it ( https://github.com/colourmeamused/cockpit-cookbook )
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 a new Pull Request

repository: colourmeamused/cockpit-cookbook

repo_name: colourmeamused/cockpit-cookbook


text:
# @gulp-utils/gulp-core-build-rollup

`gulp-core-build-rollup` is a `gulp-core-build` subtask which introduces the ability to bundle various source files into a set of bundles, using rollup.

[![npm version](https://badge.fury.io/js/%40gulp-utils%2Fgulp-core-build-rollup.svg)](https://badge.fury.io/js/%40gulp-utils%2Fgulp-core-build-rollup)
[![Dependencies](https://david-dm.org/tnc1997/gulp-utils%3Fpath%3Dlibraries%2Fgulp-core-build-rollup.svg)](https://david-dm.org/tnc1997/gulp-utils?path=libraries/gulp-core-build-rollup)

# Tasks

## RollupTask

### Description
This task invokes rollup on a package, using a consumer-specified `rollup.config.js`.

### Command Line Options
If the `--initrollup` flag is passed to the command line, this task will initialize a `rollup.config.js` which bundles `lib/index.js` into `dist/{packagename}.js` as a UMD module.

### Usage
```javascript
const {rollup} = require("@gulp-utils/gulp-core-build-rollup");
const {tsc} = require("@gulp-utils/gulp-core-build-tsc");
const {initialize, serial, task} = require("@microsoft/gulp-core-build");

rollup.setConfig({
  configPath: "./rollup.config.js"
});

task("default", serial(tsc, rollup));

initialize(require("gulp"));
```

### Config
```typescript
interface IRollupConfig {
    configPath?: string;
    config?: RollupOptions | RollupOptions[];
    suppressWarnings?: (string | RegExp)[];
    rollup?: typeof Rollup;
    printStats?: boolean;
}
```

gha_language: TypeScript

gha_license_id: MIT


text:
# Topic

> 英文總是卡卡的嗎？6 分鐘教你說出一口流利的英文！ (How Fast Can I Become Fluent? 30 days? One Year?)

> Use material that's interesting and real because you want to imitate native speakers.

> 使用有趣且真實的素材，因為你需要模仿母語者的說話方式。

[![Image](https://cdn.voicetube.com/assets/thumbnails/bY7hVunxyN8.jpg)](https://www.youtube.com/embed/bY7hVunxyN8?rel=0&showinfo=0&cc_load_policy=0&controls=1&autoplay=1&iv_load_policy=3&playsinline=1&wmode=transparent&start=200&end=208&enablejsapi=1&origin=https://tw.voicetube.com&widgetid=1)

Host: Ingrid

Today issue: Pronunciation challenge also helps English speaking!

[Host record](https://cdn.voicetube.com/tmp/everyday_records/ingrid.wang_vt_50297/3232.mp3)

## learning points
1. _
	* material [məˋtɪrɪəl] (n.) 材料；素材；資料
		- What kind of material is this blanket made out of this is the softest thing I've ever felt in my life?
			+ 這種毯子是用什麼樣的材料，這是我生命中遇過最溫柔的東西。
		- Material wealth is the most important to Ashley, she spends millions of dollars by expensive cars but she doesn't even know how to drive.
			+ 物質財富對Ashley來說是最重要的，她花了數百萬美元用昂貴的汽車，但她甚至不知道怎麼開車。

2. _
	* imitate [ˋɪmə͵tet] (v.) 模仿；仿效
		- He learned how to imitate different animal sounds to impress girls I assume it didn't work given that he's still single.
			+ 他學會瞭如何模仿不同的動物聲音來給女孩留下深刻的印象，我認為如果他還是單身的話，我認為它不起作用。
		- Everybody stopped laughing at Chris's imitation of the boss when the boss walked in the room with fury on his face.
			+ 當老闆臉上帶著憤怒走進房間時，每個人都嘲笑Chris對老闆的模仿。

3. _
	* native [ˋnetɪv] (adj.) 出生國的；出生地的；土生土長的
		- Andy learned the hard way that not every Asian he sees is a native Chinese person.
			+ Andy得到教訓，他認為並不是每個亞洲人都是中國人。
		- I know you speak French English Spanish and Dutch fluently but which language is your native language?
			+ 我知道你會說流利的法語英語西班牙語和荷蘭語，但哪種語言是你的母語？

4. _
	* speaker [ˋspikɚ] (n.) 發言者；演講者；（說某一特定語言的）說話者；揚聲器；喇叭
		- The speaker today is a former member of Cirque du Soleil you should pay attention since you want to join a circus.
			+ 今天的演講者是太陽馬戲團的前成員你應該注意，因為你想參加馬戲團。
		- She thought the speaker was broken I took a look and found out that it was just not a plugin in.
			+ 她認為喇叭壞了我看了看，發現它只是沒插電。
		- The narrator's deep voice put me to sleep before the play even started.
			+ 講述敘述者的深沉的聲音讓我在戲劇開始之前入睡。


text:
# explorerFilePreview
Enables Windows Explorer file preview for email files (.msg, .eml), without having Outlook installed.

## Notes
For HTML email preview, Renderer is used instead of WebBrowser (seems quite buggy).
If problems occur, discard Setup.msi and test with "Server Manager"; install both x86 and x64 (same DLL). Most times, however, one architecture seems to be enough.

### Debugging
[https://github.com/dwmkerr/sharpshell/wiki/Debugging-&-Diagnostics](https://github.com/dwmkerr/sharpshell/wiki/Debugging-&-Diagnostics)
Log mode has to be configured via srm.exe to be able to see the logs, and must be run in Server Manager via Test Shell.

### Console installation
[https://github.com/dwmkerr/sharpshell/wiki/srm:-Server-Registration-Manager](https://github.com/dwmkerr/sharpshell/wiki/srm:-Server-Registration-Manager)

See Codebase parameter(s).

### NuGet
For a successful install and registering, the DLLs must use "strong names", i.e. be signed. Therefore, an additional NuGet package is needed which signs MimeKit, HTML Renderer etc. after installation: StrongNameSigner.
Note this can cause issues with other NuGet packages (System.Security error etc.); in this case, temporarily uninstall the Signer.

## Other informational Links
[https://github.com/dwmkerr/sharpshell](https://github.com/dwmkerr/sharpshell)

[https://github.com/dwmkerr/sharpshell/issues/159](https://github.com/dwmkerr/sharpshell/issues/159)

[https://www.dxsdata.com/2019/04/explorerfilepreview/](https://www.dxsdata.com/2019/04/explorerfilepreview/)

repository: DXSdata/explorerFilePreview

repo_name: DXSdata/explorerFilePreview


text:
## Introduction to Redis

Redis is an open source (BSD licensed), in-memory data structure store, used as database, cache and message broker.

The data model is **key-value**, but many different kind of values are support。

It supports data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs and geospatial indexes with radius queries.

Redis has built-in replication, Lua scripting, LRU eviction, transactions and different levels of on-disk persistence,

and provides high availability via Redis Sentinel and automatic partitioning with Redis Cluster.

http://redis.io/

https://github.com/antirez/redis

https://github.com/redis

## Installation On Windows

https://github.com/MSOpenTech/redis

You can download the latest unsigned binaries and the unsigned MSI installer from the release page.

https://github.com/MSOpenTech/redis/releases

**redis 3.0.501**

https://github.com/MSOpenTech/redis/releases/download/win-3.0.501/Redis-x64-3.0.501.msi

Run:

Redis-x64-3.0.501.msi

##  Installation on Linux

http://redis.io/download

### Download, extract and compile Redis with:

```
$ wget http://download.redis.io/releases/redis-3.0.7.tar.gz
$ tar xzf redis-3.0.7.tar.gz
$ cd redis-3.0.7
$ make
```

The binaries that are now compiled are available in the src directory. Run Redis with:
```
$ src/redis-server
```
You can interact with Redis using the built-in client:
```
$ src/redis-cli
redis> set foo bar
OK
redis> get foo
"bar"
```

## Redis Python Client

https://github.com/andymccurdy/redis-py

##  Installation

redis-py requires a running Redis server. See Redis's quickstart for installation instructions.

To install redis-py, simply:

Linux

```
$ sudo pip3 install redis
```

Windows

```
>pip install redis
```

## Getting Started

```python
import redis
r = redis.StrictRedis(host='localhost', port=6379, db=0)
r.set('foo', 'bar')
r.get('foo')
```

repository: danielzengky/bootProcessInformation

repo_name: danielzengky/bootProcessInformation


text:
# martini does dotfiles
Your dotfiles are how you personalize your system. These are mine.

As I was working on the dotfiles for Windows I thought; hey why not follow [Jessica Deen's](https://github.com/jldeen) approach and have dotfiles for different environments in the same repo.

So here they are:
  - [dotfiles/wsl](https://github.com/OliverMartini/dotfiles/tree/wsl)
  - [dotfiles/windows](https://github.com/OliverMartini/dotfiles/tree/windows)

## Thanks
I sourced the concepts for my dotfiles from multiple places. Noteworthy are the following:
  - [Jessica Deen's](https://github.com/jldeen) - [dotfiles/wsl](https://github.com/jldeen/dotfiles/tree/wsl)
  - [Zach Holman's](https://github.com/holman) - [dotfiles](https://github.com/holman/dotfiles)
  - [Jay Harris's](https://github.com/jayharris) - [dotfiles-windows](https://github.com/jayharris/dotfiles-windows)

repository: OliverMartini/dotfiles

repo_name: OliverMartini/dotfiles


text:
---
title: Visibility CSS Classes
description: This page describes Visibility CSS Classes.
demo:
  pages:
  - name: All Examples
    slug: example-index
  - name: Multiple classes at once
    slug: example-multiple-visibility-classes
---

The Soho visibility classes allow elements to become conditionally visible or hidden based on breakpoint size.  They also provide a way to conveniently change the CSS `display` property on a per-breakpoint basis.

repository: dmcodrum/enterprise

repo_name: dmcodrum/enterprise


text:
# `celocli governance`

Interact with on-chain governance proposals and hotfixes

## `celocli governance:build-proposal`

Interactively build a governance proposal

```
Interactively build a governance proposal

USAGE
  $ celocli governance:build-proposal

OPTIONS
  --globalHelp     View all available global flags
  --output=output  (required) Path to output

EXAMPLE
  build-proposal --output ./transactions.json
```

_See code: [src/commands/governance/build-proposal.ts](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/src/commands/governance/build-proposal.ts)_

## `celocli governance:dequeue`

Try to dequeue governance proposal

```
Try to dequeue governance proposal

USAGE
  $ celocli governance:dequeue

OPTIONS
  --from=0xc1912fEE45d61C87Cc5EA59DaE31190FFFFf232d  (required) From address
  --globalHelp                                       View all available global flags

EXAMPLE
  dequeue --from 0x5409ed021d9299bf6814279a6a1411a7e866a631
```

_See code: [src/commands/governance/dequeue.ts](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/src/commands/governance/dequeue.ts)_

## `celocli governance:execute`

Execute a passing governance proposal

```
Execute a passing governance proposal

USAGE
  $ celocli governance:execute

OPTIONS
  --from=0xc1912fEE45d61C87Cc5EA59DaE31190FFFFf232d  (required) Executor's address
  --globalHelp                                       View all available global flags

  --proposalID=proposalID                            (required) UUID of proposal to
                                                     execute

EXAMPLE
  execute --proposalID 99 --from 0x5409ed021d9299bf6814279a6a1411a7e866a631
```

_See code: [src/commands/governance/execute.ts](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/src/commands/governance/execute.ts)_

## `celocli governance:executehotfix`

Execute a governance hotfix prepared for the current epoch

```
Execute a governance hotfix prepared for the current epoch

USAGE
  $ celocli governance:executehotfix

OPTIONS
  --from=0xc1912fEE45d61C87Cc5EA59DaE31190FFFFf232d  (required) Executors's address
  --globalHelp                                       View all available global flags

  --jsonTransactions=jsonTransactions                (required) Path to json
                                                     transactions

  --salt=salt                                        (required) Secret salt associated
                                                     with hotfix

EXAMPLE
  executehotfix --jsonTransactions ./transactions.json --salt
  0x614dccb5ac13cba47c2430bdee7829bb8c8f3603a8ace22e7680d317b39e3658 --from
  0x5409ed021d9299bf6814279a6a1411a7e866a631
```

_See code: [src/commands/governance/executehotfix.ts](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/src/commands/governance/executehotfix.ts)_

## `celocli governance:hashhotfix`

Hash a governance hotfix specified by JSON and a salt

```
Hash a governance hotfix specified by JSON and a salt

USAGE
  $ celocli governance:hashhotfix

OPTIONS
  --force                              Skip execution check
  --globalHelp                         View all available global flags

  --jsonTransactions=jsonTransactions  (required) Path to json transactions of the
                                       hotfix

  --salt=salt                          (required) Secret salt associated with hotfix

EXAMPLE
  hashhotfix --jsonTransactions ./transactions.json --salt
  0x614dccb5ac13cba47c2430bdee7829bb8c8f3603a8ace22e7680d317b39e3658
```

_See code: [src/commands/governance/hashhotfix.ts](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/src/commands/governance/hashhotfix.ts)_

## `celocli governance:list`

List live governance proposals (queued and ongoing)

```
List live governance proposals (queued and ongoing)

USAGE
  $ celocli governance:list

OPTIONS
  -x, --extended          show extra columns
  --columns=columns       only show provided columns (comma-separated)
  --csv                   output is csv format [alias: --output=csv]
  --filter=filter         filter property by partial string matching, ex: name=foo
  --globalHelp            View all available global flags
  --no-header             hide table header from output
  --no-truncate           do not truncate output to fit screen
  --output=csv|json|yaml  output in a more machine friendly format
  --sort=sort             property to sort by (prepend '-' for descending)

EXAMPLE
  list
```

_See code: [src/commands/governance/list.ts](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/src/commands/governance/list.ts)_

## `celocli governance:preparehotfix`

Prepare a governance hotfix for execution in the current epoch

```
Prepare a governance hotfix for execution in the current epoch

USAGE
  $ celocli governance:preparehotfix

OPTIONS
  --from=0xc1912fEE45d61C87Cc5EA59DaE31190FFFFf232d  (required) Preparer's address
  --globalHelp                                       View all available global flags

  --hash=hash                                        (required) Hash of hotfix
                                                     transactions

EXAMPLE
  preparehotfix --hash
  0x614dccb5ac13cba47c2430bdee7829bb8c8f3603a8ace22e7680d317b39e3658 --from
  0x5409ed021d9299bf6814279a6a1411a7e866a631
```

_See code: [src/commands/governance/preparehotfix.ts](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/src/commands/governance/preparehotfix.ts)_

## `celocli governance:propose`

Submit a governance proposal

```
Submit a governance proposal

USAGE
  $ celocli governance:propose

OPTIONS
  --deposit=deposit                                  (required) Amount of Gold to attach
                                                     to proposal

  --descriptionURL=descriptionURL                    (required) A URL where further
                                                     information about the proposal can
                                                     be viewed

  --force                                            Skip execution check

  --from=0xc1912fEE45d61C87Cc5EA59DaE31190FFFFf232d  (required) Proposer's address

  --globalHelp                                       View all available global flags

  --jsonTransactions=jsonTransactions                (required) Path to json
                                                     transactions

EXAMPLE
  propose --jsonTransactions ./transactions.json --deposit 10000 --from
  0x5409ed021d9299bf6814279a6a1411a7e866a631 --descriptionURL
  https://gist.github.com/yorhodes/46430eacb8ed2f73f7bf79bef9d58a33
```

_See code: [src/commands/governance/propose.ts](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/src/commands/governance/propose.ts)_

## `celocli governance:revokeupvote`

Revoke upvotes for queued governance proposals

```
Revoke upvotes for queued governance proposals

USAGE
  $ celocli governance:revokeupvote

OPTIONS
  --from=0xc1912fEE45d61C87Cc5EA59DaE31190FFFFf232d  (required) Upvoter's address
  --globalHelp                                       View all available global flags

EXAMPLE
  revokeupvote --from 0x5409ed021d9299bf6814279a6a1411a7e866a631
```

_See code: [src/commands/governance/revokeupvote.ts](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/src/commands/governance/revokeupvote.ts)_

## `celocli governance:show`

Show information about a governance proposal, hotfix, or account.

```
Show information about a governance proposal, hotfix, or account.

USAGE
  $ celocli governance:show

OPTIONS
  --account=account                    Address of account or voter
  --globalHelp                         View all available global flags
  --hotfix=hotfix                      Hash of hotfix proposal
  --jsonTransactions=jsonTransactions  Output proposal JSON to provided file

  --nonwhitelisters                    If set, displays validators that have not
                                       whitelisted the hotfix.

  --notwhitelisted                     List validators who have not whitelisted the
                                       specified hotfix

  --proposalID=proposalID              UUID of proposal to view

  --raw                                Display proposal in raw bytes format

  --whitelisters                       If set, displays validators that have whitelisted
                                       the hotfix.

ALIASES
  $ celocli governance:show
  $ celocli governance:showhotfix
  $ celocli governance:showaccount
  $ celocli governance:view
  $ celocli governance:viewhotfix
  $ celocli governance:viewaccount

EXAMPLES
  show --proposalID 99

  show --proposalID 99 --raw

  show --hotfix 0x614dccb5ac13cba47c2430bdee7829bb8c8f3603a8ace22e7680d317b39e3658

  show --hotfix 0x614dccb5ac13cba47c2430bdee7829bb8c8f3603a8ace22e7680d317b39e3658
  --whitelisters

  show --hotfix 0x614dccb5ac13cba47c2430bdee7829bb8c8f3603a8ace22e7680d317b39e3658
  --nonwhitelisters

  show --account 0x47e172f6cfb6c7d01c1574fa3e2be7cc73269d95
```

_See code: [src/commands/governance/show.ts](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/src/commands/governance/show.ts)_

## `celocli governance:upvote`

Upvote a queued governance proposal

```
Upvote a queued governance proposal

USAGE
  $ celocli governance:upvote

OPTIONS
  --from=0xc1912fEE45d61C87Cc5EA59DaE31190FFFFf232d  (required) Upvoter's address
  --globalHelp                                       View all available global flags

  --proposalID=proposalID                            (required) UUID of proposal to
                                                     upvote

EXAMPLE
  upvote --proposalID 99 --from 0x5409ed021d9299bf6814279a6a1411a7e866a631
```

_See code: [src/commands/governance/upvote.ts](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/src/commands/governance/upvote.ts)_

## `celocli governance:vote`

Vote on an approved governance proposal

```
Vote on an approved governance proposal

USAGE
  $ celocli governance:vote

OPTIONS
  --from=0xc1912fEE45d61C87Cc5EA59DaE31190FFFFf232d  (required) Voter's address
  --globalHelp                                       View all available global flags

  --proposalID=proposalID                            (required) UUID of proposal to vote
                                                     on

  --value=(Abstain|No|Yes)                           (required) Vote

EXAMPLE
  vote --proposalID 99 --value Yes --from 0x5409ed021d9299bf6814279a6a1411a7e866a631
```

_See code: [src/commands/governance/vote.ts](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/src/commands/governance/vote.ts)_

## `celocli governance:whitelisthotfix`

Whitelist a governance hotfix

```
Whitelist a governance hotfix

USAGE
  $ celocli governance:whitelisthotfix

OPTIONS
  --from=0xc1912fEE45d61C87Cc5EA59DaE31190FFFFf232d  (required) Whitelister's address
  --globalHelp                                       View all available global flags

  --hash=hash                                        (required) Hash of hotfix
                                                     transactions

EXAMPLE
  whitelisthotfix --hash
  0x614dccb5ac13cba47c2430bdee7829bb8c8f3603a8ace22e7680d317b39e3658 --from
  0x5409ed021d9299bf6814279a6a1411a7e866a631
```

_See code: [src/commands/governance/whitelisthotfix.ts](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/src/commands/governance/whitelisthotfix.ts)_

## `celocli governance:withdraw`

Withdraw refunded governance proposal deposits.

```
Withdraw refunded governance proposal deposits.

USAGE
  $ celocli governance:withdraw

OPTIONS
  --from=0xc1912fEE45d61C87Cc5EA59DaE31190FFFFf232d  (required) Proposer's address
  --globalHelp                                       View all available global flags

EXAMPLE
  withdraw --from 0x5409ed021d9299bf6814279a6a1411a7e866a631
```

_See code: [src/commands/governance/withdraw.ts](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/src/commands/governance/withdraw.ts)_

repository: yorhodes/celo-monorepo

repo_name: yorhodes/celo-monorepo


text:
---
title: Observability
---

The Observability addon provides system-level monitoring for KubeVela core and business-level monitoring for applications
based on metrics, logging, and tracing data.

The following describes observability capabilities in detail, and how to enable the observability addon and view various
monitoring data.

## Introduction to Observable Capabilities

KubeVela observable capabilities are demonstrated through [Grafana](https://grafana.com/) and provide system-level and
application-level data monitoring.

### Built-in metric category I: KubeVela Core system-level observability

- KubeVela Core resource usage monitoring

1) CPU, memory, and other usage and utilization data

![](../../resources/observability-system-level-summary-of-source-usages.png)

2) Graphical representation of CPU and memory usage and utilization over time (e.g. last three hours), and network bandwidth per second

![](../../resources/observability-system-level-summary-of-source-usages-chart.png)

### Built-in metrics category II: KubeVela Core log monitoring

1) Log statistics

The observable page displays the total number of KubeVela Core logs, as well as the number of `error` occurrences, frequency,
overview of all logs that occur, and details by default.

![](../../resources/observability-system-level-logging-statistics.png)

It also shows the total number and frequency, of `error` log occurrences over time.

![](../../resources/observability-system-level-logging-statistics2.png)

2) Logging filter

You can also filter the logs by filling keywords at the top.

![](../../resources/observability-system-level-logging-search.png)

## Installing the addon

The observability addon is experimental, [Experimental Addon Registry](../addon/intro.md) should be enabled first. The
addon relies on Prometheus, and Prometheus alert manager, and server depend on PersistentVolume. So the size of PV has to be
set, ie, the parameter `disk-size` in the command line `vela addon enable observability`, and the default value is 20GB.
It also depends on StorageClass, so one default Storage has to be set.

### Self-built/regular Kubernetes clusters

Execute the following command to install the observability plugin. The steps are the same for similar clusters, like KinD.

```shell
$ vela addon enable observability disk-size=2
```

### Kubernetes clusters provided by cloud providers

#### Alibaba Cloud ACK

First pick one StorageClass as the default one.

```shell
$ kubectl get storageclass
NAME                       PROVISIONER     RECLAIMPOLICY   VOLUMEBINDINGMODE   ALLOWVOLUMEEXPANSION   AGE
alicloud-disk-available    alicloud/disk   Delete          Immediate           true                   6d
alicloud-disk-efficiency   alicloud/disk   Delete          Immediate           true                   6d
alicloud-disk-essd         alicloud/disk   Delete          Immediate           true                   6d
alicloud-disk-ssd          alicloud/disk   Delete          Immediate           true                   6d

$ kubectl patch storageclass $StorageClass -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'
```

Enable the addon and use the default StorageClass size 20GB.

```shell
$ vela addon enable observability
```

#### Kubernetes clusters offered by other cloud providers

Please set the default StorageClass and `disk-size` for different cloud provider's Kubernetes clusters.

## View monitoring data

### Get an account for the monitoring dashboard

```shell
$ kubectl get secret grafana -o jsonpath="{.data.admin-password}" -n vela-system | base64 --decode ; echo
<password printed here>
```

Using username `admin` and the password above to login to the monitoring dashboard below.

### Get the monitoring url

- Self-built/regular clusters

```shell
$ sudo vela port-forward addon-observability -n vela-system 80:80
```

Visit the Dashboard in the browser tab, which was opened by the command line, to view the various monitoring data introduced earlier.

![](../../resources/observability-system-level-dashboards.png)

- Kubernetes clusters provided by cloud providers

Access the Grafana domain set up above directly to view the various monitoring data described earlier.

### View monitoring data for various categories

On the Grafana home page, click on the console as shown to access the monitoring data for the appropriate category.

The KubeVela Core System Monitoring Dashboard is the KubeVela Core system-level monitoring console.
The KubeVela Core Logging Dashboard is the KubeVela Core logging monitoring console.

 ![](../../resources/observability-dashboards.png)


text:
---
layout: page
title: About
permalink: /about/
---

Follow @fffabs

This is [Fabio Basile](http://fffabs.com/)'s little online notebook. I like to design apps, websites and games for people like you, and I use this space to occasionally talk about them. I am a self-taught digital designer and occasional speaker.

 I hold a combined Bachelor's Degree in software engineering and video game development from [Lancaster University](http://www.lancaster.ac.uk) and the [University of Central Lancashire](http://www.uclan.ac.uk).

I also run [Brotherhood](http://brotherhood.io), with my business and design partner [Jamie](http://www.syke.co). I spend most of my time between the UK, Italy and Japan. I am an advocate of remote work.

----

About the site

This site was made on an [Apple rMBP](http://www.apple.com/uk/) using [Sublime Text 3](http://sublimetext.com/) and [Sketch](http://sketch-app.com/). It's powered by [jekyllrb.com](http://bohemiancoding.com/sketch/). The text is set in [FaktPro](https://www.fontshop.com/families/fakt).


text:
# ZNC on OpenShift

Create a new project:

```bash
oc new-project znc
```

OR switch to an existing one:

```bash
oc project znc
```

Next, create the ZNC app and all its supporting resources:

```bash
oc new-app -f znc-template.yaml
```

Find the public route for your new app:

```bash
oc get route/znc
```

Open the ZNC web console at your route's URL, e.g. `https://znc-myapp.openshift.example.com`. Log in with the default admin account (username/password: `admin`).

## Install thelounge

https://thelounge.github.io/

```bash
oc new-app -f thelounge-template.yaml
```

Find the public route for thelounge:

```bash
oc get route/thelounge
```

repository: jasonmadigan/znc-openshift

repo_name: jasonmadigan/znc-openshift


text:
# US_Bike_share_data_analysis
This Python script mainly deals with the analysis and import of US bike share data and answer interesting questions about it
by computing descriptive statistics.
We explore data related to bike share systems for three major cities in the United States—Chicago, New York City, and Washington.

Over the past decade, bicycle-sharing systems have been growing in number and popularity in cities across the world.
Bicycle-sharing systems allow users to rent bicycles on a very short-term basis for a price. This allows people to borrow a bike
from point A and return it at point B, though they can also return it to the same location if they'd like to just go for a ride.
Regardless, each bike can serve several users per day.
Thanks to the rise in information technologies, it is easy for a user of the system to access a dock within the system to unlock
or return bicycles. These technologies also provide a wealth of data that can be used to explore how these bike-sharing systems
are used.
This Python script will use data provided by "Motivate", a bike share system provider for many major cities in the United States,
to uncover bike share usage patterns, and then will compare the system usage between three large cities: Chicago, New York City, and
Washington, DC.


text:
# Angular in Docker with Nginx, supporting environments, built with multi-stage Docker builds

Here's how to deploy an [Angular](https://angular.io/) app with [Docker](https://www.docker.com/), building it with [Node.js](https://nodejs.org) as you would do locally, but end up with a thin and efficient [Nginx](https://nginx.org/) image, with just the compiled code. Ready for production.

To achieve that, you can use [Docker "multi-stage builds"](https://docs.docker.com/engine/userguide/eng-image/multistage-build/). That will allow you to first build your Angular app inside a (possibly huge) Node JS Docker container that is later discarded in favor of a thin Nginx image with just your compiled app. And your final image will be as thin as the latest layer (Nginx).

Here you will also see how to use that technique but still support [Angular CLI](https://github.com/angular/angular-cli) [environments](https://github.com/angular/angular-cli/wiki/build#build-targets-and-environment-files).

All this removes the need for complex building scripts or the need to add your built app to git (your `dist` directory).

This could also be adapted to any compiled front end framework like [React](https://reactjs.org/). But the main tricks you need are all below.

## TL;DR:

* Create a new Angular project, e.g. "my-angular-project":

```bash
ng new my-angular-project
```

* Enter into your project directory:

```bash
cd my-angular-project
```

* Add a Nginx configuration inside your project directory, named `nginx-custom.conf`, with:

```nginx
server {
  listen 80;
  location / {
    root /usr/share/nginx/html;
    index index.html index.htm;
    try_files $uri $uri/ /index.html =404;
  }
}
```

* Add a `.dockerignore` for `node_modules` with:

```
node_modules
```

* Add a `Dockerfile` in your directory with:

```Dockerfile
# Stage 0, based on Node.js, to build and compile Angular
FROM node:8.6 as node
WORKDIR /app
COPY package.json /app/
RUN npm install
COPY ./ /app/
ARG env=prod
RUN npm run build -- --prod --environment $env

# Stage 1, based on Nginx, to have only the compiled app, ready for production with Nginx
FROM nginx:1.13
COPY --from=node /app/dist/ /usr/share/nginx/html
COPY ./nginx-custom.conf /etc/nginx/conf.d/default.conf
```

* Build your image using the production environment, e.g.:

```bash
docker build -t my-angular-project:prod .
```

* Build your image using the development environment, e.g.:

```bash
docker build -t my-angular-project:dev --build-arg env=dev .
```

* Test your image for the production environment with:

```bash
docker run -p 80:80 my-angular-project:prod
```

* Open your browser in <http://localhost>.

* Test your image for the development environment with:

```bash
docker run -p 80:80 my-angular-project:dev
```

* Open your browser in <http://localhost>.

## Details

*Everything above shows the actual code you need. If you're in a hurry, you could probably just copy all that. If you want to know all the details, continue reading...*

---

When you build an Angular front-end app, you most commonly write it in [TypeScript](http://www.typescriptlang.org/) and then compile it to JavaScript. But you need to have Node.js and several packages to do that.

After you compile your app, you end up with a set of files, normally in a `./dist` directory. Those are the compiled files that you actually use to serve your app. And those files have all the optimizations that you use, for example, AOT (Ahead Of Time compilation).

And those files are the final product that you serve to your users. Your users don't need your source TypeScript files nor any of the packages you use during development, just the compiled files.

So, you need to deploy to production only those files.

These are the options we have, take them as the "motivation" for what we will do next:

### Option 1:

One way to do it is to compile the app locally and add the compiled files to your Git repository. And then, when you are deploying, you just clone your repository and use those compiled files. As we are talking about Docker, you would create an image that copies and uses those compiled files. Your would probably use an [Nginx base image](https://hub.docker.com/_/nginx/) for that.

But you never edit those compiled files directly, they are generated from your source files. They are constantly changing, so your Git repository will grow large just because you are adding compiled code. And if someone in your team works on a feature branch and has one version of those files and he wants to merge the feature to your main (probalby `master`) branch, you might have conflicts in those files, even when the source code doesn't have conflicts. So you would have to be fixing "virtual" conflicts. There are probably other disadvantages too. So, the compiled files don't really belong to your Git repository.

Also, if you forget to compile and commit everything right before deploying, you'll get an old version of the deployed app.

### Option 2:

Another way to do it would be to do not add your compiled code to your Git repository and build your app every time you are going to deploy.

But this would require all your deployment servers or wherever it is that you build your Docker image to have all the tooling to deploy your app. Node.js, TypeScript, all the Angular packages, all the dependencies, etc.

And again, if you forget to compile everything right before deploying, you'll get an old version of the app deployed.

But all the problems that you would have with dependencies by needing to have all the tooling in a server is what Docker is supposed to solve, right?

### Option 3:

You could build the whole app inside your Docker image, and then serve it from the same image.

That would imply that you would start from an [official Node.js base image](https://hub.docker.com/_/node/) to compile everything and then you would have to setup a server with Node.js or install Nginx manually on top of Node.js (or something similar).

If you install Nginx by hand you lose the option to use the [official Nginx base image](https://hub.docker.com/_/nginx/) that is already fine tuned.

Also, you would end up with huge images that all your deployment servers have to download (if you are concerned about size) and a complex environment, with all the Node.js / Angular packages and dependencies.

### Option 4:

You could write a complex script that builds your app in one Docker image using Node.js, then extract the compiled files, and then build a second image based on Nginx with just your compiled files.

We are getting close, but you would have another complex script to debug. Copying files from a Docker container and to another Docker image, etc. Not that promising...

### Option 5:

Use [Docker multi-stage builds](https://docs.docker.com/engine/userguide/eng-image/multistage-build/). With that, you can have a Node.js base image that installs, builds and compiles everything, and then, "discard" all those Node.js specific Docker image layers, and end up with a Nginx image with just your compiled code.

You would have an efficient Nginx server with great performance for your static final (compiled) files. You wouldn't have to add your compiled code to Git, you always get the latest compiled version of your code, you don't have to deal with dependencies outside Docker, etc.

That's great! Docker multi-stage builds solve several problems in one shot. And this option is what is [described in this article: "Create efficient Angular Docker images with Multi Stage Builds"](https://medium.com/@avatsaev/create-efficient-angular-docker-images-with-multi-stage-builds-907e2be3008d). But...

When building your Angular code with [Angular CLI](https://github.com/angular/angular-cli) you have the option to use ["environments"](https://github.com/angular/angular-cli/wiki/build#build-targets-and-environment-files) while building the Angular app. That alows you to, for example, use a production back end API while using the "`prod`" environment and use a testing back end API while using the "`dev`" environment.

But with just the method described above we would have no way to use that feature.

---

So, let's create an "**Option 6**" that combines all of the above and lets us use Angular CLI environments.

## Requirements

* [Angular CLI](https://github.com/angular/angular-cli) (you need to have [Node.js](https://nodejs.org) first)

* [Docker](https://www.docker.com/)

## Angular

If you don't know Angular (Angular 2+) yet, go and do [their tutorials](https://angular.io/docs) first.

If you are building an Angular front-end web app, you probably should create your code with [Angular CLI](https://github.com/angular/angular-cli).

That will help you setting everything up, compiling the app with AOT (Ahead Of Time compilation), serving the app during development with auto-reload, etc.

* So, go ahead and install [Angular CLI](https://github.com/angular/angular-cli).

* To create a new Angular project, e.g. "my-angular-project", run:

```bash
ng new my-angular-project
```

* Enter into your project directory:

```bash
cd my-angular-project
```

* To be able to see the differences between the Angular CLI environments in the final app, edit your component code in `src/app/app.component.ts`, import the `environment`:

```TypeScript
import { environment } from '../environments/environment';

...
```

* Then, add that environment's `production` property as a component property, so that you can use it in your template:

```TypeScript
...

export class AppComponent {

...

  production = environment.production;
}
```

* Your final code might look like:

```TypeScript
import { Component } from '@angular/core';

import { environment } from '../environments/environment';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  title = 'app';

  production = environment.production;
}
```

* Then, edit your template to show your `production` value, for example, add the following:

```html
...

<h2 *ngIf="production">We are running in production!</h2>
<h2 *ngIf="!production">We are running in development...</h2>

...
```

* Your final template might look like:

```html
<div style="text-align:center">
  <h1>
Welcome to {{title}}!
  </h1>
  <h2 *ngIf="production">We are running in production!</h2>
  <h2 *ngIf="!production">We are running in development...</h2>
</div>
```

**Note**: I'm omitting some of the default Angular CLI code for brevity.

* Now, if you run your code locally with the defaults, e.g.:

```bash
ng serve
```

* And open your browser in <http://localhost:4200>

...you will see your code using the `dev` environment. So you might probably see something like:

* But if you run it passing the `--prod` flag (or the more specific `--environment prod`), e.g.:

```bash
ng serve --prod
```

* And open your browser in <http://localhost:4200>

...you will probably see something like:

*notice the "`running in production!`"*.

* To learn more about Angular CLI environments, check [the official Angular CLI documentation](https://github.com/angular/angular-cli/wiki/build#build-targets-and-environment-files).

This is a bare-bones Angular project. Just the basic parts to show the point. There are many ways to improve Angular using modules, etc. But we'll just stick to the basics for now.

## Nginx

Nowadays, Nginx is more or less the "de facto standard" for static content serving. You can search about it and read about its performance. The web is full of articles about it.

So, for our final Docker image, we will need to have a Nginx configuration. You don't really need to know much more about it for now. As the official Docker image will do all the heavy lifting for you.

But we do need to create a basic config file that we'll use later.

* Add a Nginx configuration inside your project directory, named `nginx-custom.conf`, with:

```nginx
server {
  listen 80;
  location / {
    root /usr/share/nginx/html;
    index index.html index.htm;
    try_files $uri $uri/ /index.html =404;
  }
}
```

* The most important part is the:

```nginx
try_files $uri $uri/ /index.html =404;
```

...that tells Nginx to try to match the files it is requested in the URL (URI) with files it has available. That will make it, for example, match the `/main.bundle.js` and return the JavaScript file. But when there's no match, it will default to `index.html`.

That will make it return the `index.html` for any other URL it receives, so, all the Angular router URLs will work, even when going to the URL directly in the browser (not being redirected from an internal section of the app).

Without that, if you had a route like `/app/dashbaord/main`, when you tried to open that URL, Nginx wouldn't find the file `app/dashboard/main` and would return a `404 Not found`, instead of returning the `index.html` and letting the Angular router handle it.

The last part, `=404` tells Nginx to return a `404` if it doesn't even find an `index.html` file. That's the default case. But you will normally always have an `index.html` file.

Save that file, we will use it soon.

This is the minimum Nginx configuration. You could finetune it more, depending on your case. If you want to explore more, read the [Nginx Beginner's Guide](http://nginx.org/en/docs/beginners_guide.html#conf_structure).

## Docker

If you don't know Docker yet, and you do at least some back-end stuff (deploying a front-end app counts), it might change your developer life. So, go ahead, [install Docker](https://docs.docker.com/engine/installation/) and follow the [Get Started guide](https://docs.docker.com/get-started/).

Now, let's assume you already know enough Docker to use it. Let's go to our details.

Here, we'll see how we can use Docker multi-stage builds [Docker build-time `ARG`s](https://docs.docker.com/engine/reference/builder/#arg). That will allow us to pass build-time variables during image creation. And with that, we'll be able to build different images for the different Angular CLI environments, by just passing an argument to `docker`. But we need to do a couple things first.

When you build your image, Docker normally "sends" all the files in the directory to the component of Docker that builds the image. If you have a `node_modules` directory, it will take some time doing sending that as `node_modules` directories tend to be huge and with lots of files.

The same way that you would add `node_modules` to your `.gitignore` file, you can use a `.dockerignore` file.

* Add a `.dockerignore` for `node_modules` with:

```
node_modules
```

Now, let's build our Docker image.

* Add a file named specifically `Dockerfile` in your directory, with:

```Dockerfile
# Stage 0, based on Node.js, to build and compile Angular
FROM node:8.6 as node
WORKDIR /app
COPY package.json /app/
RUN npm install
COPY ./ /app/
ARG env=prod
RUN npm run build -- --prod --environment $env

# Stage 1, based on Nginx, to have only the compiled app, ready for production with Nginx
FROM nginx:1.13
COPY --from=node /app/dist/ /usr/share/nginx/html
COPY ./nginx-custom.conf /etc/nginx/conf.d/default.conf

```

...now, let's check what all that is doing.

* This will tell Docker that we will start with a base [Node.js official image](https://hub.docker.com/_/node/), notice that you won't have to install and configure Node.js or anything, Docker does that for you:

```Dockerfile
FROM node:8.6 as node
```

...we also "named" this stage `node`, with the `as node`. We will use this name later.

* Our working directory will be `/app`, that will create that directory and go in there:

```Dockerfile
WORKDIR /app
```

* Now, copy the `package.json` from your source to inside the container. Just that file, before the rest of the source code, because we want to install everything the first time, but not everytime we change our source code. The next time we change our code, Docker will use the cached layers with everything installed (because the `package.json` hasn't changed) and will only compile our source code:

```Dockerfile
COPY package.json /app/
```

* Install all the dependencies, this will be cached until we change the `package.json` file (changing our dependencies). So it won't take very long installing everything every time we iterate in our source code, just the first time and when we update the dependencies (installed packages):

```Dockerfile
RUN npm install
```

* Now, after installing all the dependencies, we can copy our source code. This section will not be cached that much, because we'll be changing our source code constantly, but we already took advantage of Docker caching for all the package install steps in the commands above. So, let's copy our source code:

```Dockerfile
COPY ./ /app/
```

* And here's the trick that will allow us to use Angular CLI environments. We create an `ARG` that we will pass at build time, with a default value of `prod` (the default value for Angular CLI).

```Dockerfile
ARG env=prod
```

* Inside our container we don't have a global Angular CLI installation, so we cannot just use `ng build`, because it won't find `ng`. But as Angular CLI creates an NPM script that builds everything, we can just use it, with `npm run build`. But we need to pass parameters to `ng` and we cannot pass them directly because `npm` would try to interpret them. So first we add `--` to let `npm` that the next parameters are not for him, but for `ng`. Then, we pass the `--prod` parameter that [sets several things at once](https://github.com/angular/angular-cli/wiki/build#--dev-vs---prod-builds). That will take care of optimizing everything for production. And lastly, we pass the `--environment $env` parameter. See that we are using the "environment variable" `$env` that we created right above. This environment variable won't persist after building (as an environment variable), but we can use it to pass parameters to Docker at build time.

```Dockerfile
RUN npm run build -- --prod --environment $env
```

...that will build our app, to the default directory `./dist`. Which in this case will be `/app/dist/`.

* In the same file, we start another section (another "stage"), like if 2 `Dockerfile`s were concatenated. That's Docker multi-stage building. It almost just looks like concatenating `Dockerfile`s. So, let's start with an [official Nginx base image](https://hub.docker.com/_/nginx/) for this "stage":

```Dockerfile
FROM nginx:1.13
```

...if you were very concerned about disk space (and you didn't have any other image that probably shares the same base layers), or if, for some reason, you are a fan of Alpine Linux, you could change that line and use an [Alpine version of the image](https://hub.docker.com/_/nginx/).

* Here's the Docker multi-stage trick. This is a normal `COPY`, but it has a `--from=node`. That `node` refers to the name we specified above in the `as node`. Here, although we are in an Nginx image, starting from scratch, we can copy files from a previous stage. So, we can just copy the compiled version of our app. That compiled version is based on the latest source code, and that latest compiled version only lives in the previous Docker "stage", for now. But we'll copy it to the Nginx directory, just as static files:

```Dockerfile
COPY --from=node /app/dist/ /usr/share/nginx/html
```

* Now, we'll override the `default.conf` file in Nginx with our custom `nginx-custom.conf` file that lets Angular router take care of it's routes:

```Dockerfile
COPY ./nginx-custom.conf /etc/nginx/conf.d/default.conf
```

...that's it for the `Dockerfile`! Doing that with scripts or any other method would be a lot more cumbersome.

## Build it

Now we can build our image, that will compile everything and create a Nginx image ready for serving our app.

If we just build it normally, it will use the production environment (`prod`).

* Build your image using the production environment, e.g.:

```bash
docker build -t my-angular-project:prod .
```

But we can build an image for each environment we have, by just passing the environment name as an argument to the build process. The same as we would pass it to `ng build --environment`. We just have to use Docker's `--build-arg` parameter.

* Build your image using the development environment, e.g.:

```bash
docker build -t my-angular-project:dev --build-arg env=dev .
```

## Test it

To check that your new Docker images are working, you can start a container based on them and see the results.

* Test your image for the production environment with:

```bash
docker run -p 80:80 my-angular-project:prod
```
* Open your browser in <http://localhost>.

You should see something very similar to:

...notice that it is served by Docker and not by Angular CLI (not in port `4200`). And notice that it says that you are running the "production" version of your front end App.

* Test your image for the development environment with:

```bash
docker run -p 80:80 my-angular-project:dev
```

* Open your browser in <http://localhost>.

You should see something very similar to:

...again, served by Docker and not by Angular CLI (not in port `4200`). And now you are using your "development" environment version.

## Change Docker image installation directory

I added daemon.json to C:\ProgramData\Docker\config and added these lines in it:
`{"graph": "D:\\ProgramData\\Docker"}`

## Troubleshooting

Incase `docker build -t my-angular-project:prod .` doesn't work
Turn on the experimental features in docker > settings > daemon > checkbox experimental
Add `--platform linux` flag like `docker build --platform linux -t my-angular-project:prod .`
Hurray !!!

## Done!

That's it! Angular in Docker, ready for production with great performance (thanks for Nginx). A lot less error prone (thanks to Docker multi-stage builds). Supporting Angular CLI environments, thanks to Docker's `ARG` and `--build-arg`.

You can also automatize that in a continuous integration/delivery environment or whatever you want very easily with those tricks.

There's a demo project with all what I described here in GitHub at: <https://github.com/Humadroid/Angular-Docker-Nginx-Multi-Stage-Builds>. If you have any problem replicating this, check the repo and compare it to your code to see what could be wrong.

And let me know if this was helpful to you!

We just dockerized Angular
😎🏋🏻🙌🏼🌟✨⚡


text:
PHP-MVC-Framework
=================

This is a simple php framework that can be used to develop web applications using the Model-View-Controller pattern.

- Tested with Apache 2 Web Server.
- Require module "mod_rewrite" running on the server.
- Supports MySQL and PostgreSQL DBMS.

Made by Michele Stolfa


text:
# Web Server
A web server for handling general HTTP requests, built with sockets in Java.

# Function
This web server is able to handle HTTP requests from client(web browser) simultaneously. Java sockets are used to accept string-format requests, process them and return string-format responses. So, this web server processes standard HTTP requests and responses at socket level.

# Setup Locally
```bash
git clone https://github.com/jojozhuang/web-server-java.git
```
Open the project in Eclipse, compile and run. Access http://localhost:2540/ in web browser, enjoy!

# Portfolio
Read portfolio [Web Server(Java)](https://jojozhuang.github.io/project/web-server-java) to learn the main functions of this web server.

# Tutorial
Read tutorial [Building Web Server with Java Socket](https://jojozhuang.github.io/programming/building-web-server-with-java-socket) to learn how this web server is built.


text:
# scala-code-formatter package

This Package adds scala formatting capabilities to Atom using the tool [scalafmt](http://scalameta.org/scalafmt).

As a example:

```scala
object NeedsFormat { def too(much:Int, stuff: String, in: Int, a: String, line: Int): String = stuff }
```

will be formatted to:

```scala
object NeedsFormat {
  def too(much: Int, stuff: String, in: Int, a: String, line: Int): String =
    stuff
}
```

## Requirements

* JVM (openjdk, oracle jre)

## Usage

* Format the current scala file (hotkey ctrl-alt-x)

## Configuration

See Scalafmt http://scalameta.org/scalafmt/#Configuration for further details.

## Thanks

* to the scalafmt Team for the awesome tool (scalameta/scalafmt is licensed under the
Apache License 2.0 [licence](https://github.com/scalameta/scalafmt/blob/master/LICENCE.md))

repository: SvenWi/atom-scala-code-formatter

repo_name: SvenWi/atom-scala-code-formatter


text:
# GenoML-core
GenoML is an Automated Machine Learning (AutoML) for Genomic. This is the core package of GenoML.
this repo is under development, please report any issues (bug, performance, documentation) on the [GenoML issues page](https://github.com/GenoML/genoml/issues).

Here are some quick "get started" exmaples, please checkout the additional options and details in the [Usage][] and [CLI][].
In general, use linux or mac with python > 3.5 for best results.

## Install
Run:
~~~~
pip install genoml
~~~~

## Train the ML model
You can use the IPDGC (International Parkinson's Disease Genomics Consortium) test data. This data is a simulation of the genetic and clinical data used for Parkinson's diagnosis in previous publications. You can find it at [IPDGC example data][].

Download and unzip data:
~~~
wget https://github.com/ipdgc/GenoML-Brief-Intro/raw/master/exampleData.zip
unzip exampleData.zip
~~~

To train, run:
~~~~
genoml-train --geno-prefix=./exampleData/training --pheno-file=./exampleData/training.pheno --model-dir=./exampleModel
~~~~

Final tuned model and performance metrics are stored in the ```--model-dir``` directory.

## Using the trained ML model for inference
~~~~
genoml-inference --model-dir=./exampleModel --valid-dir=./exampleData --valid-geno-prefix=./exampleData/validation --valid-pheno-file=./exampleData/validation.pheno
~~~~

Valdiation results and model performance metrics are stored in the ```--valid-dir``` directory.

> For debugging purposes, include the ```-v``` or ```-vvv``` flags at the end of a command.

[usage]: https://genoml.github.io/docs/usage
[CLI]: https://genoml.github.io/docs/cli
[IPDGC example data]: https://github.com/ipdgc/GenoML-Brief-Intro/raw/master/exampleData.zip

## Report issues
Please report any issue or suggestions on the [GenoML issues page](https://github.com/GenoML/genoml/issues).

repository: GenoML/genoml

gha_language: R

repo_name: GenoML/genoml


text:
## This repository has been archived

The files in this repository accompanied an [Adafruit Learning System](https://learn.adafruit.com) tutorial
Adafruit Bluefruit LE Feather Robot Rover
https://learn.adafruit.com/bluefruit-feather-robot

The files were mirrored to https://github.com/adafruit/Adafruit_Learning_System_Guides/tree/master/BLE_Robot_Rover
and this repo was archived.

All code MIT License, please attribute to Adafruit Industries

--------------------------------
## Adafruit Bluefruit LE Feather Robot Rover

Build & control an RC car with a smart phone! Follow the Adafruit learn guide here: https://learn.adafruit.com/bluefruit-feather-robot !

repository: adafruit/BLE-Robot-Rover

repo_name: adafruit/BLE-Robot-Rover


text:
# Instructions

## Running the simulations
The folder `ros-packages` contains a snapshot of all packages used to create the simuation results.
Using [docker](https://www.docker.com/) you can build a docker image to run the simulations in.
First go to the directory where the `Dockerfile` is located (this directory), and build the image.
```bash
docker build -t ros-demo .
```

This can take a while and will download many files. Now you should be able to run the image, and build the ros workspace.
```bash
docker run -it ros-demo /bin/bash
(then inside the container, indicated by a `#`)
# cd /home/catkin_ws
# catkin build
# source devel/setup.bash
# roslaunch demo_table_moveit_config demo.launch
```

(This will not launch rviz, as this is more complicated to do inside docker.)

Now run the simulations from a different terminal.
Use `docker ps` to find the id of the container, something like `c3e672e196ca`.
```bash
docker exec -it <id> /bin/bash
# cd /home/catkin_ws
# source devel/setup.bash
# roslaunch arf_demo demo_table.launch
```

This wil run for a while and write the results to `/home/catkin_ws/src/arf/arf_demo/data`.
To stop the simulation, press `ctrl-c` in the terminal that is running the moveit demo.launch.
Then the simulation will also stop automatically.

## Using a different cost function
There are two cost functions available in arf, `L1NormCost` and `sumSquaredCost`.
To change the one used in the graph search, you have to edit line 122 in `/arf/arf_graph/src/graph.cpp`.

Either use the path length cost function (L1-norm):
```c++
// update neighbors distance
float dist = (*current).shortest_distance + L1NormCost(*nb, *current);
```
or the sum squared cost function.
```c++
// update neighbors distance
float dist = (*current).shortest_distance + sumSquaredCost(*nb, *current);
```


text:
---
title: "Let's Build a Thing! (Part One)"
date: 2019-06-22 09:27:00
comments: true
categories:
  - js
  - creativity
  - front-end
  - hack
  - typescript
  - react
  - vue
  - web

excerpt: "Another JS Framework!! WHY NOT!?"
header:
  overlay_image: /assets/posts/2019-06-22/header.jpg
  overlay_filter: 0.3
  caption: "Photo credit: [Markus Spiske on Pexels](https://pexels.com)"
---

My current run-rate for blogging is _not fantastic._ I have extremely good intentions,
but invariably I either:

- Stop doing "worky" things outside of the working week so that I can give my poor brain a rest.
  This I'm able to with reasonable success of late having learned how _not_ to cope with burnout!

- Get super caught-up in preparation for singing conventions/shows with [my barbershop chorus
  (shameless plug but I don't even care.)](https://cottontownchorus.co.uk)

- Get super caught up in learning a bit of tech to satisfy my own curiosity, or to help me out with
  future client engagements.

So I thought I'd try to use this as last reason as an opportunity to write something cool, and
also see about blogging its progress, too! So let's get down to it. Let's build...

## A FRONT-END FRAMEWORK

Because let's face it, [there aren't enough of them.](https://github.com/collections/front-end-javascript-frameworks).

Given that there are already thousands of fully-mature frameworks out there that allow you to build
beautiful, dynamic single page applications, and that they generally have great community support,
tooling and developer satisfaction; why build another one?

Put simply - because I wanna. I'm not satisfied with the _mysterious voodoo_ that happens behind
the scenes when you render a React app. I'm deeply interested in how the observability of a data
component might cause _only a partial_ re-rendering of a DOM. I'm keen as very keen thing to evolve
a performant web rendering framework from the ground up, and learn heaps about TypeScript, virtual
and shadow DOMs and Web Component architecture. But above all _I just want to_.

- In TypeScript.

- Hosted on NPM.

 So first things first, let's go and do
a Trello thing:

This is quite nice because it seriously helps to order my thoughts. Moving stories/tickets/stickies
across a board is comparable to the lovely little dopamine hit that you get from playing the slots
in Vegas, or from seeing someone :thumbsup: your post on Facebook. Agile is a gateway drug. Discuss!!

Anyways, I digress. What features should I build, then? Well for a start there are a few teeny tech
tasks to work on so that I can get my pen going:

First of all I want to configure Jest (my testing framework of choice!) to play nicely with
TypeScript. Next I'm going to want Webpack to transpile whatever stuff I'm coding into JavaScript.
I estimate this is going to take just a couple of hours of clicking around so let's start with that
right away!

## Configuring the development environment

Rather than spending aaaaages describing how I got to this state, I've created a gist which contains
each of the configuration files that I rolled to support TypeScript transpilation to native
Javascript, and the options for Jest to be able to understand TypeScript at runtime:

## .babelrc

This file configures what kind of transpilation you want to do. Here I'm configuring it to support
the `@babel/typescript` preset, with a bunch of other, sexy plugins which extend the base
functionality

## .jest.config.js

This file details some of the options that are needed to support files with the .ts extension.
Note, too that we're specifying the _root folder_ for Jest to find any test files to run.

## package.json

This snippet just lists the dev dependencies needed for NPM to be able to physically run my new
NPM module.

## tsconfig.json

The presence of a tsconfig.json file in a directory indicates that the directory is the root of a
TypeScript project. This is going to be called under-the-hood by webpack, and contains a few
compiler hints to improve our development experience (basically just a few imports to support
ES16/17).

## webpack.config.js

Finally this webpack configuration file outlines how our transpilation happens, and what the output
of the build is gonna be, where it's going to live etc.

With all the above in place, we can go ahead and write a super-simple failing test!!

    Proof!!

Look, I'm really tired now. But this is all awesome - We've been able to build a simple walking
skelington that's all wired up properly and we can start writing some tests to build our our
functionality!

If you'd like to follow-along with this series of blog posts, there's a repo you can take a look at
[over here!](https://github.com/thesheps/toy-js)

Super.

extension: markdown

gha_language: JavaScript


text:
# go-paddle #

[![go-paddle release (latest SemVer)](https://img.shields.io/github/v/release/Fakerr/go-paddle?sort=semver)](https://github.com/Fakerr/go-paddle/releases)
[![Test Status](https://github.com/Fakerr/go-paddle/actions/workflows/test.yml/badge.svg)](https://github.com/Fakerr/go-paddle/actions/workflows/test.yml)

go-paddle is a Go client library for accessing the [Paddle API](https://developer.paddle.com/api-reference/intro).

## Installation ##

```bash
go get github.com/Fakerr/go-paddle
```

Alternatively the same can be achieved if you use import in a package:

```go
import "github.com/Fakerr/go-paddle"
```

and run `go get` without paramters.

## Usage ##
The package paddle comes with two different clients. A client for the Product, Subscription, Alert APIs that will require
a vendor_id and a vendor_auth_code and a client for the Checkout API.

The services of a client divide the API into logical chunks and correspond to
the structure of the Paddle API documentation at
https://developer.paddle.com/api-reference/.

### Product API, Subscription API, Alert API ###

```go
import "github.com/Fakerr/go-paddle/paddle"
```

Construct a new Paddle client, then use the various services on the client to access different parts of the Paddle API.
The client always requires a vendor_id and a vendor_auth_code arguments that you can get from the Paddle dashboard. For example:

```go
client := paddle.NewClient(vendorId, vendorAuthCode, nil)

// List all users subscribed to any of your subscription plans
users, _, err := client.Users.List(context.Background(), nil)
```

Some API methods have optional parameters that can be passed. For example:

```go
client := paddle.NewClient(vendorId, vendorAuthCode, nil)

// List all users subscribed to any of your subscription plans
opt := &UsersOptions{SubscriptionID: "1"}
users, _, err := client.Users.List(context.Background(), opt)
```

NOTE: Using the [context](https://godoc.org/context) package, one can easily
pass cancelation signals and deadlines to various services of the client for
handling a request. In case there is no context available, then `context.Background()`
can be used as a starting point.

For more sample code snippets, head over to the
[example](https://github.com/fakerr/go-paddle/tree/master/example) directory.

### Checkout API ###

```go
import "github.com/Fakerr/go-paddle/paddle"
```

Construct a new Paddle checkout client, then use the various services on the client to access different parts of the Paddle API.

```go
client := paddle.NewCheckoutClient(nil)

// Retrieve prices for one or multiple products or plans
options := &PricesOptions{CustomerCountry: "tn"}
prices, _, err := client.Prices.Get(context.Background(), "1", options)

```
### Sandbox environment ###
If you want to send requests against a sandbox environment, the package paddle provides two specific clients for that purpose:

```
client := paddle.NewSandboxClient(sandboxVendorId, sandboxVendorAuthCode, nil)
```
or to access the checkout API

```
client := paddle.NewSandboxCheckoutClient(nil)
```

### Pagination ###

Some requests for resource collections (users, webhooks, etc.)
support pagination. Pagination options are described in the
`paddle.ListOptions` struct and passed to the list methods directly or as an
embedded type of a more specific list options struct (for example
`paddle.UsersOptions`).

```go
client := paddle.NewClient(vendorId, vendorAuthCode, nil)

// List all users subscribed to any of your subscription plans
opt := &UsersOptions{
	SubscriptionID: "1",
	ListOptions: ListOptions{Page: 2},
}
users, _, err := client.Users.List(context.Background(), opt)
```
### Webhooks ###
go-paddle comes with helper functions in order to facilitate the validatation and parsing of webhook events.
For recognized event types, a value of the corresponding struct type will be returned.

Example usage:

```go
func PaddleWebhookHandler(w http.ResponseWriter, r *http.Request) {
   payload, err := paddle.ValidatePayload(r, webhookSecretKey)
   if err != nil { ... }

   alert, err := paddle.ParsePayload(payload)
   if err != nil { ... }

   switch alert := alert.(type) {
   case *paddle.SubscriptionCreatedAlert:
       processSubscriptionCreatedAlert(alert)
   case *paddle.SubscriptionCanceledAlert:
       processSubscriptionCanceledAlert(alert)
   ...
   }
}

```

## Todos ##
List of Paddle APIs that are not covered yet or are work in progress:
- [ ] Licenses
- [ ] Transactions

## Contributing ##
Pull requests are welcome, along with any feedback or ideas. The calling pattern is pretty well established, so adding new methods is relatively
straightforward.

## License ##

This library is distributed under the MIT-style license found in the [LICENSE](./LICENSE)
file.

repository: bytieful/go-paddle

repo_name: bytieful/go-paddle


text:
---
layout: post
title: "Thettle"
featured-img: thettle_banner
categories: [Mechanical, Electrical, Entrepreneurship, Design]
---

Thettle is a startup I created along with two other people. Our goal was to make a product that combines an electric kettle with a portable thermos which will allow consumers to make hot beverages wherever they go. I was in charge of designing and manufacturing our product and worked on the business side of our operation as well. We built two prototypes, wrote a business plan, and participated in startup competitions.

[Read the full report (pdf)](/files/Thettle%20Report.pdf)

![Thettle Picture](/assets/img/posts/thettle/thettle.png)

We created the first prototype at the University of Michigan 2017 Makeathon. This was a 48 hour competition where small teams of students build "something". We went into the competition with little knowledge of electrical circuitry and controls. One of the first things we did was try and figure out how to make LED lights blink with an Arduino. At the end, we made the first Thettle. It was powered from a laptop charger, controlled by an Arduino with temperature sensors and relays to regulate temperature, and it was capable of warming water. We came in first place and won the National Instruments Award for Accelerating Innovation, giving us $850 which we invested into future prototypes. Our second prototype was an iteration of this design which used a higher voltage power source and more powerful heating element, which improved heating capabilities and speed.

Thettle competed at the 2017 Accelerate Michigan student competition. This was a pitch contest where we presented our business to a panel of judges for the chance to win $10,000. We were one of the 6 undergraduate teams to make it to the finals out of the dozens who applied.

Our third prototype improves on previous iterations by using more electrical power for faster heating times, a detachable power cord, improved user interface, and a better thermal seal. I designed this prototype and am working to bring it to fruition. It was designed in SolidWorks and I purchased parts to build it off of McMaster and Digikey. I conducted static simulations in SolidWorks Simulation to determine the minimum wall thickness that could handle normal applied loads and designed the circuitry for the prototype in KiCad.

![Thettle Render](/assets/img/posts/thettle/thettle_render.png)


text:
---
layout: page
title: "Workshop 2021"
permalink: /workshops/workshop_2021/
---

The Annual Genral Meeting of ORSO will take place online in 14th-18th June 2021. The purpose of the meeting is to discuss topics of interest to the ORSO community.
The program will consist of scientific anf technical talks together with discussion forums for each of the working groups

## [Registration is now open](https://indico.esss.lu.se/event/2745/overview)

# Agenda:

## Monday 14th June: Plenary Sessions

The pleanry sessions will introduce ORSO abd summarise our activities since the last meeting.
There will also be up to 8 scientific talks on subjects of interest to the ORSO community (speakers to be confirmed).
Since the agenda is scheduled to try to cover all time zones, we acknowledge that it may be difficult to attend all these sessions. We will therefore record the plenary session and post the videos here after the meeting.

### Plenary Session 1
08:00-11:00 (UK), 09:00-12:00 (Europe), 04:00-07:00 (US East coast), 17:00-20:00 (Australia East coast):

#### Confirmed Speakers
- The ORSO Chairs. Summary of progress since the last meeting
- Hiroyuki Aoki, J-PARC, Japan. "Spatially resolved neutron reflectometry by computed tomography"

### Plenary Session 2
18:00-21:00 (UK), 19:00-22:00 (Europe), 13:00-16:00 (US East coast), 03:00-06:00 (Australia East coast):

#### Confirmed Speakers
- The ORSO Chairs. Summary of progress since the last meeting

## [Tuesday 15th June: Data Formats Working Group](/workshops/workshop_2021//Tuesday.md)

## [Wednesday 16th June: Reproducibility Working Group](/workshops/workshop_2021/Wednesday.md/)

## [Thursday 17th June: Data Analysis Working Group](/workshops/workshop_2021//Thursday.md)

## [Friday 18th June: Education and Outreach Working Group](/workshops/workshop_2021//Friday.md)

## Friday 18th June: Concluding Plenary Session

In the final session of the workshop we will summarise the working group discussions and look to the future with some talks on the application of Machine Learning or Artifical Intelligence to Reflectometry (speakers to be confirmed)

20:00-22:00 (UK), 21:00-23:00 (Europe), 15:00-17:00 (US East coast), 05:00-07:00 (Australia East coast):

#### Confirmed Speakers
- Joshanial Cooper, STFC, UK.
- Stefan Kowarik, Graz University of Technology, Austria.

# Registration:

Registration is free and is now [open](https://indico.esss.lu.se/event/2745/overview).


text:
# The Forgotten Ones Source Code

## About
This was initially a total conversion mod for Half-Life 2, when Greenlight came around I decided to give it a try.
Eventually The Forgotten Ones got greenlit and I was probably as surprised as you reading this right now.
It was a major achievement for me, so here I'm years later releasing the source code of this long project.

The game takes place in Germany during the 60's, you play as a detective whose name is Grobuskna Vladinov.
His family suffered deep tragedies during the holocaust and he has been on the hunt for the person(s) responsible ever since.

## Current State
The game has been on Steam for over a year now, the code is quite stable.
However unused stuff such as the Custom Story code might be a bit unpolished.
I have also compiled this on Linux Ubuntu and Mac OSx Yosemite without any issues.

## Navigating
All the game code is under:
- game/client/
- game/server/
- game/shared/

For only The Forgotten Ones stuff:
- game/client/tfo/
- game/server/tfo/
- game/shared/tfo/

I've edited most of the original SDK 2013 files so there's edits pretty much everywhere.
You'll find the most advanced features in the tfo folders tho. Like the inventory stuff.

## Third-Party Libraries
I'm using the FMOD API to allow music during level transitions and in the main menu and an updated version of Steam API.

## Contributing
You're free to make pull requests for bug fixes.

## Features
- A custom GameUI and VGUI structure
- Loading Music
- Custom HUD
- Inventory System + 3D rendered items which you can inspect
- Dialogue System
- Bleeding System
- Custom loading screen which reports the actual loading progress
- Custom NPCs
- Custom Weapons
- Blood rendering on viewmodel when taking damage or if blood splats on you
- Note System
- Achievement & Stat handler
- New VGUI Controls
- Custom Console
- Slot Saving System
- Boss Health Bar
- Thirdperson animations and thirdperson support in general
- The player can be rendered in mirrors while in firstperson
- Radius based glow outline effect which helps the player find important items
- Film Grain
- Dynamic Scope Support
- Ironsights
- Improved vehicles
- Scriptable NPCs
- High Modding Support (including the unused Custom Story code which was removed in V2.9)
- Cross-Platform friendly code
- And much more...

## Documentation
Most of the documentation provided is examples on how to link the scripts with the Hammer World Editor & GUI, for example if you want to add a new inventory item.

## Crediting
I'd appreciate if you'd credit me if you want to use my work.

## Disclaimer
This project started in 2011, I was a rookie at the time so there might be some untidy code here and there.

For V2.9 I refactored and went through all of my code to polish it as good as I could, some parts are still a bit hard coded but it'll do for now.

repository: BerntA/tfo-code

repo_name: BerntA/tfo-code


text:
# mari-bot
This is a bot for our den mother, Mari.

This project uses the discord.js implementation of the discord API. You can learn more and find documentation [on their website](https://discord.js.org).
For the twitch webhooks API, this project uses the [twitch-webhook package](https://www.npmjs.com/package/twitch-webhook).

## Features
* Playback audio clips
* Respond with pre-configured messages
* Add text commands on demand
* Audio on multiple servers at once
* Welcome new users to the server
* User level-up system based on # of messages sent in the server
* Meme collection and re-use
* NEW PHONE WHO DIS

## WIP Features
* Send updates when configured streamers go live
* Role management via commands & reactions
* Send updates when configured users post on twitter

## Setup
1. Install node 12
2. Clone the repo
3. Install  libtool and autoconf
    * for linux, `sudo apt-get install libtool` `sudo apt-get install autoconf`
    * for osx, `brew install libtool` `brew install autoconf`
    * for windows not sure, haven't tried yet
4. Run `npm i` in the root of the repo
5. Request src/config/Tokens.json file from<EMAIL_ADDRESS>or add your own bot tokens
6. Run the bot with `node -r esm src/mari-bot`
    * add `-l` or `--log-to-console` for console logging
    * logs will always be saved to `error.log` and `debug.log`
    * add `-t` or `--twitch-notifications` for twitch streamer notifications (WIP)

repository: tjhutch/mari-bot

repo_name: tjhutch/mari-bot


text:
# Video Encoder Bot
A Telegram bot to convert videos into x265/x264 format via ffmpeg.

### Configuration
Add values in environment variables or add them in [config.env.template](./config.env.template) and rename file to `config.env`.
- `API_ID` - Get it by creating an app on [https://my.telegram.org](https://my.telegram.org)
- `API_HASH` - Get it by creating an app on [https://my.telegram.org](https://my.telegram.org)
- `BOT_TOKEN` - Get it by creating a bot on [https://t.me/BotFather](https://t.me/BotFather)
- `SUDO_USERS` - Chat identifier of the sudo user. For multiple users use space as seperator.
- `DOWNLOAD_DIR` - (Optional) Temporary download directory to keep downloaded files.

### Configuring Encoding Format
To change the ffmpeg profile edit them in [ffmpeg_utils.py](/bot/helper/ffmpeg_utils.py)

### Installing Requirements

### The Easy Way

  [![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/BotZ-TG/Encode-Bot)

#### The Hard Way
Install the required Python Modules in your machine.
```sh
apt-get -qq install ffmpeg
pip3 install -r requirements.txt
```
### Deployment
With python3.7 or later.
```sh
python3 -m bot
```

### Credits
*Thanks To [ShannonScott](https://gist.github.com/ShannonScott) for [transcode_h265.py](https://gist.github.com/ShannonScott/6d807fc59bfa0356eee64fad66f9d9a8)*
*Thanks To [Adnan Ahmed's](https://github.com/viperadnan-git/) [Encoder-Bot](https://github.com/viperadnan-git/video-encoder-bot)
*Thanks To [Heiman-BotZ](https://github.com/HEIMAN-BOTZ/) For Adding Heroku Support

### [License](./LICENSE)

```
Copyright (c) 2021 HEIMAN BOTZ

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.
```

repository: lordrohit/Encode-Bot

repo_name: lordrohit/Encode-Bot


text:
In order to use the example [`train_and_evaluate_custom_model.ipynb`](train_and_evaluate_custom_model.ipynb) two prerequisites are required:

1. You have access to a service key for the SAP AI Busniess Services Document Classification service
2. You need a Jupyterlab instance (below are the instructions for setup locally on your laptop)

### Service key

You will need to have access to SAP Cloud Plattform given via the [SAP Cloud Platform Enterprise Agreement](https://wiki.scn.sap.com/wiki/pages/viewpage.action?pageId=489198716)

In order to get a service key please have a look at this general [SAP Help Portal article](https://help.sap.com/viewer/65de2977205c403bbc107264b8eccf4b/Cloud/en-US/4514a14ab6424d9f84f1b8650df609ce.html)

For our service specific documentation, please have a look at relevant entry in the [SAP Help Portal](https://help.sap.com/viewer/ca60cd2ed44f4261a3ae500234c46f37/SHIP/en-US/88bdee94c7c94bc99de8484f5c2db04a.html).

### Example how to set up local Jupyterlab instance

An example script to set up anaconda and start jupyterlab on your local machine is provided [here](./install_jupyterlab.sh).
This might need modifications based on OS version (example used is based on Ubuntu 16.04).
Please consult the [anaconda installation guide](https://docs.anaconda.com/anaconda/install/) for details regarding your OS.


text:
# ApartmentListInterview2013 Solution

*Contains the problem statement and dictionary file for the interview question posed at the Fall 2013 UC Berkeley Startup Fair*

Your task is to count the size of the social network of the word "LISTY" in the dictionary provided.
We define two words as being friends if the edit distance between them is 1.  For this problem, we will
be using Levenshtein distance (http://en.wikipedia.org/wiki/Levenshtein_distance) as our edit distance.
The size of a word's social network is equal to the number of nodes who are within edit distance 1 from
that word, plus the number of words that are edit distance 1 from all of those words, and so on.  A word
is in its own social network, so if our dictionary is simply [HI] then the size of the social network
for HI is 1.

*For example:*

With dictionary `[HI HERE THERE HER HE SHE HEAR HALLOW]`
The size of the social network for HI is 7.  We calculate this as follows: HE is edit
distance 1 from HI, SHE and HER are edit distance 1 from HE, HERE and HEAR are edit
distance 1 from HER, and THERE is edit distance 1 from HERE. As before, HI is in its
own social network.

` 1 + (1+1) +  (1 + 1) +  1 + 1 = 7`
`HE  SHE HER  HEAR HERE THERE HI`

Please note that we want to see production quality code! Be sure to include any and all tests and
comments in addition to the logic behind your solution. We want to see code that you feel proud of
and would check in to source control and push to production for use in a professional environment.

This readme and the dictionary you will be using is available at http://tiny.cc/LISTY (case sensitive!)
We have included the entire dictionary in dictionary.txt, as well as a few smaller dictionaries for you
to test your code on as you are developing a solution.  For your final answer, we want the size of the
social network for LISTY given the entire 178,692 word dictionary in dictionary.txt

To submit your solution, please send your code and resume to:
<EMAIL_ADDRESS>and put the size of the social network for LISTY in the subject.

Good luck!

repository: tcollier/listy-graph

repo_name: tcollier/listy-graph


text:
# Contributors

This project is the work of numerous individuals and companies. Names are listed below, ordered alphabetically by last name.

Each individual maintains their own description, and if you don't see your name listed here, please open a PR!

Also see the [GitHub contributor stats](https://github.com/typelevel/spotted-leopards/graphs/contributors).

- Comcast Cable Communications Management LLC
- Michael Pilquist

repository: typelevel/spotted-leopards

gha_language: Scala

gha_license_id: NOASSERTION

repo_name: typelevel/spotted-leopards


text:
You cannot connect it easily into an airplane
AC jack or in the airport terminal jack without hogging the adjacent jack.

![yoga adapter in the port](https://lh3.googleusercontent.com/W9wW2UmUjFCyzO2bDkECKfdLPb4UtGoF2rKGRrhhvxUxE8EYOhV3jOGwZQVgP-NkSpyV64Cy=s0 "connection_in_jack.jpg")

The laptop itself is okay. Its fast and cool and is Ubuntu Linux friendly. Keyboard sucks so I use a [Microsoft Keyboard](https://www.amazon.com/Logitech-Mk550-Wireless-Keyboard-Mouse/dp/B003VAHYNC/ref=pd_lpo_147_bs_t_2?_encoding=UTF8&psc=1&refRID=3K77NJZP2FVP2PX37E08)
when I have lots of typing to do.

But this post is about how to make the Yoga 900 adapter travel friendly.

Purchase a [short power extension cord](https://www.amazon.com/gp/product/B002VY53QE/ref=oh_aui_search_detailpage?ie=UTF8&psc=1)
![extension code](https://lh3.googleusercontent.com/lVq9Zpjn2N6uOi0b6NqsWHxUntsQSI6ABkZwYJB-NXnTmYW9cQHFBYx9bYrp0ufODzQVV4jE=s0 "extension cord.jpg")

Its not the best hack, but it works for me.

Also there is no car charging kit for this laptop. Boo!! The Lenovo X1 had one...

Definitely not buying a Lenovo Ultrabook again. Will look at another brand and will consider the following

* Is there a car charging kit?
* Does the power supply travel work nicely in airports?
* How hot does the laptop gets when running several Vagrant instances?

repository: linuxsimba/linuxsimba

gha_language: HTML

repo_name: linuxsimba/linuxsimba


text:
Opencast Studio
===============

[![Build Status](https://travis-ci.com/elan-ev/opencast-studio.svg?branch=master)
](https://travis-ci.com/elan-ev/opencast-studio)

A web-based recording studio for [Opencast](https://opencast.org).

Opencast Studio uses the recording capabilities build into browsers to record
audio and video streams. The recording happens in the user's browser. Finally,
the recording is transferred directly from the users browser to the target
Opencast.

Demo at [studio.opencast.org](https://studio.opencast.org).

Introduction
------------

Record your webcam, microphone, desktop or any mediastream sourced via WebRTC.

1. Configure your Opencast server (gear symbol).
2. Enable the devices you want to record.
3. Click the recording button to start the recording.
4. Click the stop button to finish the recording.
5. Upload the recording.

Allow Studio to interact with your Opencast
-------------------------------------------

For Studio to work with your Opencast, your need to allow this on your Opencast
by serving a special HTTP header. The mechanism used is called Cross-Origin
Resource Sharing .

Here is a list of the required headers Nginx's configuration format:

```
# Basic open CORS for studio.opencast.org
add_header Access-Control-Allow-Origin https://studio.opencast.org;
add_header Access-Control-Allow-Methods 'GET, POST';
add_header Access-Control-Allow-Credentials true;
add_header Access-Control-Allow-Headers 'Origin,Content-Type,Accept,Authorization';
```

For a complete configuration file, take a look at [the test server configuration
](https://github.com/opencast/opencast-project-infrastructure/blob/9f09638e922d623cd4d3c91dd90aca39c421530d/ansible-allinone-demo-vm/roles/nginx/templates/nginx.conf#L158-L162).

repository: chavesdiego/opencast-studio

repo_name: chavesdiego/opencast-studio