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
| //You could use faker.js to generate some testData | |
| function chunk(arr, chunkSize) { | |
| const R = []; | |
| for (let i = 0, len = arr.length; i < len; i += chunkSize) { | |
| R.push(arr.slice(i, i + chunkSize)); | |
| } | |
| return R; | |
| } |
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 faker = require('faker'); | |
| const testData = new Array(100).fill({}).map((v, i) => { | |
| return { | |
| name: faker.name.findName(), | |
| address: faker.address.streetAddress(), | |
| city: faker.address.city(), | |
| state: faker.address.stateAbbr(), | |
| postal: faker.address.zipCode(), | |
| email: '' |
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 crypto = crypto.subtle; | |
| async function sha256(message) { | |
| const msgBuffer = new TextEncoder('utf-8').encode(message); // encode as UTF-8 | |
| const hashBuffer = await crypto.subtle.digest('SHA-256', msgBuffer); // hash the message | |
| const hashArray = Array.from(new Uint8Array(hashBuffer)); // convert ArrayBuffer to Array | |
| const hashHex = hashArray.map(b => ('00' + b.toString(16)).slice(-2)).join(''); // convert bytes to hex string | |
| return hashHex; | |
| } | |
| let randomNumber = window.crypto.getRandomValues(new Uint32Array(1)); //Generate randomNumber and store in local storage. |
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
| <!doctype html> | |
| <html class="no-js" lang="en"> | |
| <head> | |
| <!-- Written by: jgilber (a.k.a., visualjeff on github) --> | |
| <meta charset="utf-8" /> | |
| <meta http-equiv="x-ua-compatible" content="ie=edge"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
| <title>JWT Token Validator</title> |
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
| npm install handlebars form-data node-fetch | |
| s="'use strict'; | |
| const fs = require('fs'); | |
| const path = require('path'); | |
| const handlebars = require('handlebars'); | |
| const source = process.env.source || '.'; | |
| const target = process.env.target || '.'; | |
| const tokens = { |
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
| #!/usr/bin/env node | |
| 'use stict'; | |
| const fetch = require('node-fetch'); | |
| const urls = ['http://jsonplaceholder.typicode.com/posts/1', | |
| 'http://jsonplaceholder.typicode.com/posts/2', | |
| 'http://jsonplaceholder.typicode.com/posts/3', | |
| 'http://jsonplaceholder.typicode.com/posts/a', | |
| 'http://jsonplaceholder.typicode.com/posts/5' |
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
| Edit /etc/rsyslog.conf | |
| sudo vim /etc/rsyslog.conf | |
| Uncomment as needed: | |
| # provides UDP syslog reception | |
| #module(load="imudp") <== Uncomment | |
| #input(type="imudp" port="514") <== Uncomment |
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
| <!doctype html> | |
| <html class="no-js" lang="en"> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <meta http-equiv="x-ua-compatible" content="ie=edge"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
| <title>AAD JWT decode and validation utilities</title> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js" crossorigin="anonymous"></script> | |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/foundation/6.4.1/css/foundation.min.css" crossorigin="anonymous" /> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/foundation/6.4.1/js/foundation.min.js" crossorigin="anonymous"></script> |
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
| # To build: docker build --force-rm=true -t scimgateway-data:latest . | |
| # To run: docker run -d --name scimgateway-data -t scimgateway-data:latest | |
| FROM busybox:latest | |
| MAINTAINER Jeffrey Gilbert | |
| RUN mkdir -p /home/scimgateway/config | |
| VOLUME /home/scimgateway/config | |
| CMD ["echo", "Data container for scimgateway created and will now shutdown. No need to run again."] |
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
| As a workaround, edited file /usr/share/applications/code.desktop | |
| Replacing | |
| Exec=/usr/share/code/code --unity-launch %U | |
| with | |
| Exec=/usr/share/code/code --disable-gpu --unity-launch %U |