curl -Ol https://golang.org/src/crypto/tls/generate_cert.go
go run generate_cert.go -ca --host "192.168.86.47"
cp cert.pem key.pem ~/.minio/certs
mv ~/.minio/certs/cert.pem ~/.minio/certs/public.crt
mv ~/.minio/certs/key.pem ~/.minio/certs/private.key
> cat start-https.sh
export MINIO_ACCESS_KEY="minio"
export MINIO_SECRET_KEY="minio123"
export MINIO_PROMETHEUS_AUTH_TYPE="public"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| String.prototype.chunkBy = function(len) { | |
| var current = len; | |
| var previous = 0; | |
| var stack = []; | |
| while (this[current]) { | |
| if (this[current++].match(/s+/)) { | |
| stack.push(this.substring(previous, current)); | |
| previous = current; | |
| current += len; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const DataContext = React.createContext(); | |
| class DataContextProvider extends Component { | |
| // We want to be able to store multiple sources in the provider, | |
| // so we store an object with unique keys for each data set + | |
| // loading state | |
| state = { | |
| data: {}, | |
| fetch: this.fetch.bind(this) | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class App extends Component { | |
| render () { | |
| return ( | |
| <Suspense fallback={<p>Loading...</p>}> | |
| <DeepNesting> | |
| <ThereMightBeSeveralAsyncComponentsHere /> | |
| </DeepNesting> | |
| </Suspense> | |
| ); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { PropTypes } from 'react'; | |
| import Select from 'react-select'; | |
| import 'react-select/dist/react-select.css'; | |
| RFReactSelect.defaultProps = { | |
| multi: false, | |
| className: "" | |
| }; | |
| RFReactSelect.propTypes = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { useEffect } from 'react'; | |
| const useWhenVisible = (target: Element | undefined, | |
| callback: () => void, | |
| root: Element | undefined = document.body) => { | |
| useEffect(() => { | |
| if (!target || !root) { | |
| return; | |
| } | |
Based on AWS document, we can use a role on AWS to delegate access AWS resources. For example, we can create a role throw IAM console then grant a permission to access S3 bucket without creating a IAM user. Following steps show how to assume a role to access S3 bucket.
Step 1: Create a role to delegate access AWS S3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // enhance the original "$.ajax" with a retry mechanism | |
| $.ajax = (($oldAjax) => { | |
| // on fail, retry by creating a new Ajax deferred | |
| function check(a,b,c){ | |
| var shouldRetry = b != 'success' && b != 'parsererror'; | |
| if( shouldRetry && --this.retries > 0 ) | |
| setTimeout(() => { $.ajax(this) }, this.retryInterval || 100); | |
| } | |
| return settings => $oldAjax(settings).always(check) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| OS: Ubuntu 16.04 | |
| 1. Install nginx : nginx version: nginx/1.10.0 (Ubuntu) | |
| 2. Install Minio: Follow https://github.com/minio/minio | |
| 3. Install MC client: Follow https://github.com/minio/mc | |
| 4. Create a bucket: | |
| $ mc mb myminio/static | |
| Bucket created successfully ‘myminio/static’. |
OlderNewer