cat <<EOF > /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=http://yum.kubernetes.io/repos/kubernetes-el7-x86_64
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
| # https://github.com/kennethreitz/requests/blob/master/requests/exceptions.py | |
| class RequestException(IOError): | |
| """There was an ambiguous exception that occurred while handling your | |
| request. | |
| """ | |
| def __init__(self, *args, **kwargs): | |
| """Initialize RequestException with `request` and `response` objects.""" | |
| response = kwargs.pop('response', None) | |
| self.response = response |
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
| /* Polyfill indexOf. */ | |
| var indexOf; | |
| if (typeof Array.prototype.indexOf === 'function') { | |
| indexOf = function (haystack, needle) { | |
| return haystack.indexOf(needle); | |
| }; | |
| } else { | |
| indexOf = function (haystack, needle) { | |
| var i = 0, length = haystack.length, idx = -1, found = false; |
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
| 'use strict'; | |
| var crypto = require('crypto'); | |
| /** | |
| * generates random string of characters i.e salt | |
| * @function | |
| * @param {number} length - Length of the random string. | |
| */ | |
| var genRandomString = function(length){ | |
| return crypto.randomBytes(Math.ceil(length/2)) |
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
| function convert_to_utc (today){ | |
| var localoffset = -(today.getTimezoneOffset()/60); | |
| //var destoffset = -4; | |
| //var offset = destoffset-localoffset; | |
| var offset = localoffset; | |
| var d = new Date( today.getTime() + offset * 3600 * 1000); | |
| return d; | |
| } | |
NewerOlder