Start your registry:
docker run -d -p 5000:5000 --restart=always --name registry registry:2| #!/bin/bash | |
| # From https://github.com/thojansen/client-certificates/blob/master/ssl/setup.sh | |
| # create rootCA certificate | |
| openssl genrsa -out rootCA.key 2048 | |
| openssl req -x509 -new -nodes -key rootCA.key -days 1024 -out rootCA.crt -subj "/C=DE/ST=Germany/L=Walldorf/O=SAP SE/OU=Tools/CN=rootCA" | |
| # create server key and certificate | |
| openssl genrsa -out server.key 2048 | |
| openssl req -new -key server.key -out server.csr -subj "/C=DE/ST=Germany/L=Walldorf/O=SAP SE/OU=Tools/CN=localhost" |
| function jsfy(objFromJson: any) { | |
| if (typeof objFromJson === 'undefined') { | |
| return undefined; | |
| } | |
| if (objFromJson === null) { | |
| return null; | |
| } | |
| if (typeof objFromJson === 'string') { | |
| return `'${objFromJson}'`; | |
| } |
| function map(arr, fn) { | |
| console.log('invoked map'); | |
| if (arr) { | |
| return arr.map(fn); | |
| } | |
| return []; | |
| } | |
| function filter(arr, fn) { | |
| console.log('invoked filter'); |
I hereby claim:
To claim this, I am signing this object:
| // asyncMap takes two arguments, a collection of tasks and a callback to run on those tasks | |
| var asyncMap = function (tasks, cb) { | |
| // declare a counter - set it at zero | |
| var counter = 0; | |
| // here we are given tasks as an object | |
| // it's possible tasks is an array | |
| // get number of tasks we need to come back | |
| var numberTask = Object.keys(tasks).length; | |
| // object we will run the final cb on when all tasks have returned | |
| var results = {}; |
| npm init -y && npm install typescript --save-dev && npm install @types/node --save-dev && node ./node_modules/.bin/tsc --init && npm install ts-node --save-dev && npm install nodemon --save-dev |
| function resolve (path, obj) { | |
| return path.split('.').reduce((prev, curr) => { | |
| return prev ? prev[curr] : undefined; | |
| }, obj) | |
| } |
| import Heavy from 'heavy'; | |
| const heavy_instance = new Heavy({ | |
| sampleInterval: 1000, | |
| }); | |
| const min_time_between_log_messages = 1000; | |
| const event_loop_logging_threshold = 5; | |
| let logging_interval; |
Generate a Private Key The Private Key is used to decrypt messages sent to the server. Keep this safe and secret! Use any password when prompted (we’ll remove it later).
openssl genrsa -des3 -out domain.key 1024Generate a Certificate Signing Request (CSR) The CSR contains the Public Key, used to encrypt messages, and information about the application so the end user (visitor) can see, so enter the information accordingly.
openssl req -nodes -newkey rsa:2048 -keyout domain.key -out domain.csr