This file contains 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> | |
<head> | |
<script src="http://code.jquery.com/jquery-2.1.1.min.js"></script> | |
<script src="http://underscorejs.org/underscore-min.js"></script> | |
<script src="http://backbonejs.org/backbone-min.js"></script> | |
<script> | |
var router = Backbone.Router.extend({ | |
routes: { | |
'': 'home' |
This file contains 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 express = require('express'); | |
var http = require('http'); | |
var app = express(); | |
var bodyParser = require('body-parser'); | |
var methodOverride = require('method-override'); | |
var router = require('./server/router'); | |
var morgan = require('morgan'); | |
app.use(bodyParser.urlencoded({extended: true})); |
This file contains 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
// REST methods: | |
// GET returns a list with optional filters | |
// GET :id returns a single document | |
// POST :id {doc} updates a single document | |
// PUT {doc} adds a single document | |
// DELETE :id deletes a single document | |
module.exports = function() { | |
return function(req, res, next) { | |
console.log("routing url " + req.url); |
This file contains 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
module.exports = function(grunt) { | |
require('load-grunt-tasks')(grunt); | |
grunt.loadNpmTasks('grunt-express-server'); | |
grunt.loadNpmTasks('grunt-simple-mocha'); | |
// Project configuration. | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
express: { | |
options: { | |
// Override the command used to start the server. |
This file contains 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 MongoClient = require('mongodb').MongoClient; | |
var url = 'mongodb://localhost:27017/myproject'; | |
MongoClient.connect(url, function(err, db) { | |
if(err) { | |
return done(err); | |
} | |
var collection = db.collection('documents'); | |
collection.drop(function(err, result) { |
This file contains 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 fs = require('fs'); | |
var MongoClient = require('mongodb').MongoClient; | |
var test = JSON.parse(fs.readFileSync('test/test-data.json')); | |
// Connection URL | |
var url = 'mongodb://localhost:27017/myproject'; | |
module.exports = { | |
'load': function(done) { | |
MongoClient.connect(url, function(err, db) { |
This file contains 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 should = require('should'); | |
var request = require('supertest'); | |
var express = require('express'); | |
var bodyParser = require('body-parser'); | |
var methodOverride = require('method-override'); | |
var fs = require('fs'); | |
var morgan = require('morgan'); | |
var router = require('../server/router'); | |
var mongoload = require('../server/mongoload'); |
This file contains 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
openssl genrsa -des3 -out server.key 2048 | |
openssl rsa -in server.key -out server.key.insecure | |
mv server.key server.key.secure | |
mv server.key.insecure server.key | |
openssl req -new -key server.key -out server.csr | |
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt | |
sudo cp server.crt /etc/ssl/certs | |
sudo cp server.key /etc/ssl/private |
This file contains 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
# for google jenkins package | |
helm repo add stable https://kubernetes-charts.storage.googleapis.com | |
helm repo update | |
helm install jenkins stable/jenkins | |
kubectl get secret --namespace default jenkins -o jsonpath="{.data.jenkins-admin-password}" | base64 --decode | |
edit service/jenkins | |
# for bitnami jenkins package | |
helm install jenkins bitnami/jenkins | |
kubectl get secret --namespace default jenkins -o jsonpath="{.data.jenkins-password}" | base64 --decode |
This file contains 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
virt-install --name vm1 --ram=8192 --disk size=10 --vcpus 1 --os-type linux --os-variant ubuntu18.04 --graphics none --location 'http://archive.ubuntu.com/ubuntu/dists/bionic/main/installer-amd64/' --extra-args "console=tty0 console=ttyS0,115200n8" | |
# When prompted, use the vm name for the host name, and be sure to add openssh when asked for software to pre-install | |
# otherwise take defaults or most reasonable options. Follow install instructions till reboot, then ^] | |
virsh domifaddr vm1 # get ip address | |
ssh-copy-id rkamradt@192.168.122.95 # use ip address from previous step |
OlderNewer