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
/* | |
* groupBy | |
* ======= | |
* Given array of objects iter, group by object property prop and return | |
*/ | |
function gb(iter,prop) { | |
var r = {}; | |
iter.map(function(e) { | |
console.log(e); | |
(r[e[prop]] = r[e[prop]] || []).push(e); |
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
const readline = require('readline'); | |
const fs = require('fs'); | |
function readLines(devs,callback) { | |
var values = {}; | |
var rs = fs.createReadStream('./partitions'); | |
rs.on('error', function(e) { | |
callback(e); | |
}); |
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 execSync = require('child_process').execSync; | |
var assert = require('assert'); | |
var result = 'GOOD'; | |
var results = { | |
'paritions': '{"sda":[8,0],"sda1":[8,1],"sda2":[8,2],"sda5":[8,5]}' | |
}; | |
try { | |
for (var input of Object.keys(results)) { |
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 readline = require('readline'); | |
function myAssigner(item) { | |
return (item >= 100)? 10: item % 10; | |
} | |
function BucketReport(count,assigner,scorer) { | |
return { | |
buckets: new Array(count).fill(0), | |
add: function(i) { |
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 execSync = require('child_process').execSync; | |
var assert = require('assert'); | |
var result = 'GOOD'; | |
var results = { | |
'input1.dat': '[450,460,470,480,490,500,510,520,530,540,6225]', | |
'input2.dat': '[910,839,1120,1014,1126,900,974,866,1698,1384,10944]', | |
'input3.dat': '[0,108,0,0,0,0,0,0,0,0,0]' | |
}; |
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
#!/usr/bin/env bash | |
# Openstack Swift Basic API tests for check_mk | |
# straill (SwiftStack) 2017/10/16 | |
# | |
# Setup: | |
# - Ensure you have a swift account created - see SWIFT_USER below. | |
# - Then set the config varibles below for your endpoints and password. | |
# - Runs basic functional test set using some (ugly) cURL commands; returns status in check_mk format | |
# - Failures will cause us to immediately bail and return bad status |
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
#!/usr/bin/env bash | |
# Probe for Swiftstack replication cycle times, taken from postgres on controller | |
# straill 2016/11/01 | |
# Arguments: | |
# $1 cluster name | |
# $2 replication type (must be one of 'object', 'container', 'account') | |
CID=$1 | |
RTYPE=$2 |
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
#!/usr/bin/env bash | |
# Probe for Swiftstack replication cycle times, taken from postgres on controller | |
# straill 2016/11/01 | |
# Arguments: | |
# $1 cluster name | |
# $2 replication type (must be one of 'object', 'container', 'account') | |
. /opt/ss/etc/profile.d/01-swiftstack-controller.sh |
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
#!/usr/bin/env bash | |
# Openstack Swift Basic Throughput test | |
# straill (SwiftStack) 2017/10/16 | |
# | |
# Setup: | |
# - Ensure you have a swift account created - see SWIFT_USER below. | |
# - Then set the config varibles below for your endpoints and password. | |
# - Runs a simple PUT with a known size object; returns success levels based on speed | |
# - Runs a simple GET with a known size object; returns success levels based on speed |
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
#!/usr/bin/env bash | |
set -x | |
HOST=$1 | |
if [ -d /etc/pki/ca-trust/source/anchors/ ] ; then | |
echo -n | openssl s_client -connect ${HOST}| sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /etc/pki/ca-trust/source/anchors/ssman.crt | |
update-ca-trust enable | |
update-ca-trust extract | |
elif [ -d /usr/local/share/ca-certificates ] ; then | |
echo -n | openssl s_client -connect ${HOST} | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /usr/local/share/ca-certificates/ssman.crt |
OlderNewer