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 | |
| matches=() | |
| directory='/opt/graphite/storage/whisper' | |
| for file in $(find $directory -type f -name '*.wsp' -print); do | |
| $(python /usr/local/bin/whisper-info.py $file > /dev/null 2>&1) | |
| retval=$? | |
| echo "checking $file" | |
| [ $retval -ne 0 ] && matches+=($file) |
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 | |
| options=('find' 'delete') | |
| PS3='state your wish: ' | |
| echo -e "\nfind/delete corrupt whisper-files" | |
| select opt in "${options[@]}"; do | |
| case $REPLY in | |
| [12] ) option=$opt; break;; | |
| * ) exit;; |
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 findHandler(err, docs) { | |
| if (!err) { | |
| // Return Success & JSON Content-type | |
| var length = docs.length; | |
| writeMeta(self.res,200,url,length); | |
| // Process results from Mongo | |
| docs.forEach(function(e,i,a) { | |
| //console.log(e,i,a); |
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 findHandler(err, docs) { | |
| if (!err) { | |
| // Return Success & JSON Content-type | |
| var length = docs.length; | |
| writeMeta(self.res,200,url,length); | |
| // Process results from Mongo | |
| docs.forEach(function(e,i,a) { | |
| //console.log(e,i,a); |
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 sys, time, subprocess, socket, telnetlib | |
| from datetime import datetime | |
| from collections import defaultdict | |
| from boto.ec2.cloudwatch import CloudWatchConnection | |
| MAPPINGS = { | |
| # Memcached name: (AWS Name, AWS Metric Type, Calculation Method) | |
| 'uptime': ('Uptime', 'Count', 'gauge'), |
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 parser = document.createElement('a'); | |
| parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
| parser.protocol; // => "http:" | |
| parser.hostname; // => "example.com" | |
| parser.port; // => "3000" | |
| parser.pathname; // => "/pathname/" | |
| parser.search; // => "?search=test" | |
| parser.hash; // => "#hash" | |
| parser.host; // => "example.com:3000" |
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
| for f in $(find $1 -iname "*.wsp"); do | |
| if [ -a $f ]; | |
| then /opt/graphite/bin/whisper-set-aggregation-method.py $f max; | |
| fi; | |
| done |
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
| ############################################################################ | |
| # _ | |
| # | |_ _ __ ___ _ ___ __ | |
| # | __| '_ ` _ \| | | \ \/ / | |
| # | |_| | | | | | |_| |> < | |
| # \__|_| |_| |_|\__,_/_/\_\ | |
| # | |
| # Cheatsheets: | |
| # https://devhints.io/tmux | |
| # `property not found` issue: |
NewerOlder