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
{ | |
'$unwind': '$client_code' | |
}, |
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
{ | |
'$group': { | |
'_id': { | |
'quarterStart': '$quarterStart', | |
'recipient': '$recipients', | |
'clientCode': '$client_code' | |
}, | |
'count': { | |
'$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
{ | |
'$sort': { | |
'count': -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
{ | |
'$group': { | |
'_id': { | |
'quarterStart': '$_id.quarterStart', | |
'clientCode': '$_id.clientCode' | |
}, | |
'recipients': { | |
'$push': { | |
'recipient': '$_id.recipient', | |
'count': '$count' |
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
{ | |
'$project': { | |
'quarterStart': '$_id.quarterStart', | |
'clientCode': '$_id.clientCode', | |
'recipients': { | |
'$slice': ["$recipients", 1000] | |
}, | |
'totalCount': '$totalCount', | |
'recipientsCount': '$recipientsCount' | |
} |
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
for document in aggregation_inbound_malware: | |
dst_data_db.IronmailAggregatedInboundTrafficMalwareRecipients.update_one( | |
{'_id': document['_id']}, | |
{'$set': document}, | |
True | |
) |
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
$BOX = "centos/7" | |
$IP = "10.0.0.10" | |
$MEMORY = ENV.has_key?('VM_MEMORY') ? ENV['VM_MEMORY'] : "1024" | |
$CPUS = ENV.has_key?('VM_CPUS') ? ENV['VM_CPUS'] : "1" | |
Vagrant.configure("2") do |config| | |
config.vm.hostname = "text-analyzer.dev" | |
config.vm.box = $BOX | |
config.vm.network :private_network, ip: $IP | |
config.vm.network "public_network" |
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
config.vm.provision "ansible" do |ansible| | |
ansible.playbook = "provisioning/playbook.yml" | |
ansible.sudo = true | |
ansible.limit = "all" | |
end |
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
--- | |
- hosts: all | |
gather_facts: False | |
tasks: | |
- name: Ensure git is installed. | |
yum: | |
name: git | |
state: installed |
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
--- | |
- hosts: all | |
gather_facts: True | |
become: true | |
tasks: | |
- name: Ensure git is installed. | |
yum: | |
name: git |