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
print(new Date() + ' Script launched'); | |
const dbName = ""; | |
const inputCollection = ""; | |
const outputCollection = ""; | |
let conn = new Mongo({w:1, journal:false, safe: true}); | |
let dbConn = conn.getDB(dbName); | |
let collIn = dbConn[inputCollection]; |
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
use admin | |
var threshold = 500; | |
db.aggregate([ | |
{ $currentOp : { allUsers: true } }, | |
{ $match: { "secs_running" : { $gt: threshold } , "ns" : { $not : /oplog/ } } }, | |
{ $group : { | |
_id: '$shard', | |
"n_query": { $sum: 1 }, |
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
#!/bin/bash | |
ansible -i 'localhost,' all -m setup | sed '1c {' | jq '.ansible_facts.ansible_all_ipv4_addresses[] | { address: . }' --compact-output |
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
- name: OPEN VM TOOLS | Checking how many matches are there for the lines exclude and open-vm-tools | |
shell: (grep -oP "(^exclude=|open-vm-tools)" /etc/yum.conf | wc -l) || true | |
register: test_grep | |
# 0 matches: will add the exclude line with open-vm-tools | |
# 1 match: only exclude present, unless it's a badly formatted /etc/yum.conf or the second pattern is in some comment | |
# 2 matches: both patterns present, will do nothing | |
- debug: | |
msg: "Matches: {{ test_grep.stdout }}" |
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
if ENV['MONITOR_FACTORIES'] | |
factory_results = { | |
time_spent_in_factories: 0, | |
payloads: [], | |
} | |
config.before do | |
ActiveSupport::Notifications.subscribe("factory_bot.run_factory") do |_name, start, finish, _id, payload| | |
took = finish - start | |
factory_results[:payloads] << payload |