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
Log onto bad mongo primary | |
Use mongotop to find bad database | |
Run this to find long running queries | |
db.currentOp()['inprog'].filter(function (t){return t.secs_running > 10}).map(function (t){return t.opid}) | |
Kill bad ops with | |
db.killOp(<opid>) |
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
$stack, $draws = [], {} | |
def method_missing *args | |
return if args[0][/^to_/] | |
$stack << args.map { |a| a or $stack.pop } | |
$draws[$stack.pop(2)[0][0]] = args[1] if args[0] == :< | |
end | |
class Array | |
def +@ |
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
gg_replace() { | |
if [[ "$#" == "0" ]]; then | |
echo 'Usage:' | |
echo ' gg_replace term replacement file_mask' | |
echo | |
echo 'Example:' | |
echo ' gg_replace cappuchino cappuccino *.html' | |
echo | |
else | |
find=$1; shift |