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
| -- Get Max ID from table | |
| SELECT MAX(id) FROM table; | |
| -- Get Next ID from table | |
| SELECT nextval('table_id_seq'); | |
| -- Set Next ID Value to MAX ID | |
| SELECT setval('table_id_seq', (SELECT MAX(id) FROM table)); |
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
| #!/bin/bash | |
| # Author: Erik Kristensen | |
| # Email: [email protected] | |
| # License: MIT | |
| # Nagios Usage: check_nrpe!check_docker_container!_container_id_ | |
| # Usage: ./check_docker_container.sh _container_id_ | |
| # | |
| # The script checks if a container is running. | |
| # OK - running |
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 fs = require("fs") | |
| var ssl_options = { | |
| key: fs.readFileSync('privatekey.pem'), | |
| cert: fs.readFileSync('certificate.pem') | |
| }; | |
| var port = process.env.PORT || 3000; | |
| var express = require('express'); | |
| var ejs = require('ejs'); | |
| var passport = require('passport') |
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
| #!/bin/bash | |
| # --------------------------------------------------------------------------- | |
| # docker-install.sh - installing docker | |
| # Copyright 2016, <[email protected]> | |
| # All rights reserved. | |
| # Usage: docker-install.sh [-h|--help] [-h|--host hostip] [-i|--interface interface] [-u|--user user] | |
| # Revision history: |
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
| #!/bin/bash | |
| # --------------------------------------------------------------------------- | |
| # docker-install.sh - Install Docker | |
| # Copyright 2016, <[email protected]> | |
| # All rights reserved. | |
| # Usage: docker-install.sh [-h|--help] | |
| # Revision history: |
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
| #!/bin/sh | |
| # check for where the latest version of IDEA is installed | |
| IDEA=`ls -1d /Applications/IntelliJ\ * | tail -n1` | |
| wd=`pwd` | |
| # Setup your working directory. Edit 'work' to your working directory. | |
| working_dir=`ls -1d ~/work/$1 | head -n1` | |
| # were we given a directory? | |
| if [ -d "$1" ]; then |
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 key = 'MySecretKey12345'; | |
| var iv = '1234567890123456'; | |
| var cipher = crypto.createCipheriv('aes-128-cbc', key, iv); | |
| var decipher = crypto.createDecipheriv('aes-128-cbc', key, iv); | |
| var text = 'plain text'; | |
| var encrypted = cipher.update(text, 'utf8', 'binary'); | |
| encrypted += cipher.final('binary'); | |
| hexVal = new Buffer(encrypted, 'binary'); |
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
| name: HadoopSparkFlinkCluster | |
| ec2: | |
| region: us-west-2 | |
| type: m3.xlarge | |
| cookbooks: | |
| hadoop: | |
| branch: master | |
| github: karamel-lab/apache-hadoop-chef | |
| spark: |
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 datetime | |
| import boto.ec2.cloudwatch | |
| import boto.ec2.autoscale | |
| import time | |
| import numpy as np | |
| def gradient(foo): | |
| graient_list = [] |