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
| var timeStamper = function() | |
| { | |
| var date = new Date(); | |
| var sec = date.getSeconds(); | |
| if (sec < 10) | |
| sec = '0' + sec; | |
| var min = date.getMinutes(); | |
| if (min < 10) | |
| min = '0' + min; |
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
| /** | |
| * Joey Whelan | |
| * 3 examples on usage of the node crypto module | |
| */ | |
| var crypto = require('crypto'); | |
| var plainText = '1234567812345678'; | |
| try | |
| { |
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
| var crypto = require('crypto'); | |
| var mongodb = require('mongodb'); | |
| var Binary = require('mongodb').Binary; | |
| var userColl = undefined; | |
| var saltLengthBytes = 64; | |
| var hashIterations = 10000; | |
| var keyLengthBytes = 64; | |
| function authenticateUser(id, password, callback) |
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
| /*jshint esversion: 6 */ | |
| 'use strict'; | |
| 'use esversion 6'; | |
| const MongoClient = require('mongodb').MongoClient; | |
| const CONNECTION_URL = 'mongodb://admin:mongo@localhost:27017'; | |
| const DB_NAME = 'testDB'; | |
| const COLLECTION = 'testCollection'; |
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
| /** | |
| * @fileoverview Various function argument and object constructor examples | |
| * @author Joey Whelan | |
| */ | |
| //base example | |
| function example1(p1,p2,p3) { | |
| console.log('example1'); | |
| const params = { |
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
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <hiredis/hiredis.h> | |
| #include <stdbool.h> | |
| #include <unistd.h> | |
| int main (int argc, char **argv) { | |
| redisReply *reply; | |
| redisContext *c; |
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
| echo -e "\n*** Deploy Cloud Provider Kind ***" | |
| docker run -d --rm --name cloud-provider-kind --network kind \ | |
| -v /var/run/docker.sock:/var/run/docker.sock registry.k8s.io/cloud-provider-kind/cloud-controller-manager:v0.4.0 | |
| echo -e "\n*** Deploy Kind Cluster ***" | |
| kind create cluster --config=$PWD/kind/config.yaml --name demo-kind-cluster | |
| if [ -z "$(docker image ls -q ms1:1.0)" ] | |
| then | |
| echo -e "\n*** Build Microservice 1 Container ***" |
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
| echo -e "\n*** Deploy Gloo Gateway ***" | |
| ./glooctl install gateway | |
| echo -e "\n*** Create Routes to Microservices ***" | |
| ./glooctl add route --name vs1 --path-exact /ms1 --dest-name default-ms1-service-8000 --prefix-rewrite /service1 | |
| ./glooctl add route --name vs1 --path-exact /ms2 --dest-name default-ms2-service-9000 --prefix-rewrite /service2 |
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
| echo -e "\n*** Deploy Microservices ***" | |
| kubectl apply -f $PWD/ms1/ms1.yaml | |
| kubectl apply -f $PWD/ms2/ms2.yaml | |
| kubectl rollout status deployment/ms1-app | |
| kubectl rollout status deployment/ms2-app |
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
| re1: | |
| image: redislabs/redis:latest | |
| container_name: re1 | |
| restart: unless-stopped | |
| tty: true | |
| cap_add: | |
| - sys_resource | |
| ports: | |
| - 12000:12000 | |
| - 8443:8443 |
OlderNewer