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
data = [{ | |
'id' : 1, | |
'title' : 'root', | |
'parent_id' : 'DRIVE', | |
'isroot' : True, | |
'abs_path' : 'root' | |
}, | |
{ | |
'id' : 2, | |
'parent_id' : 'DRIVE', |
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
# Procura tudo que tive a palavra 'service' no conteudo das mensagens na caixa postal | |
zmmailbox -z -m nomedaconta@dominio s -l 1000 -t message "in:inbox content:service" | |
# Com base na busca acima, se o resultado trouxe exatamente o que precisa obtenha o ID do resultado com o comando abaixo | |
zmmailbox -z -m nomedaconta@dominio s -l 1000 -t message "in:inbox content:service" | awk '{ if(NR > 4){print}}' | cut -c7- | awk '{print $1","}' | tr -d '\n' > /tmp/delmessg | |
# Para deletar as mensagens buscadas execute o comando | |
zmmailbox -z -m nomedaconta@dominio dm `cat /tmp/delmessg` | |
# Referência para busca: |
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
# Pegar todas as contas do servidor: | |
zmprov -l gaa | |
# Nome de exibicao, nome da conta, Ultimo logon, senha hash | |
zmprov ga nnomedaconta@dominio displayName zimbraMailDeliveryAddress zimbraLastLogonTimestamp userPassword | |
# Forma demorada | |
for conta in $(zmprov -l gaa); do zmprov -l ga $conta displayName zimbraMailDeliveryAddress zimbraLastLogonTimestamp userPassword; zmprov gmi $conta; done | |
# Forma "rapida" |
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
{ | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Parameters" : { | |
"BastionKeyName" : { | |
"Type" : "String", | |
"Description" : "The bastion server key." | |
}, | |
"BastionSecurityCIDR" : { | |
"Type" : "String", | |
"Description" : "The CIDR block range for SSH." |
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 requests | |
soapEnvelope = """<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"><soap:Header>\ | |
<context xmlns="urn:zimbra"><nosession/></context></soap:Header><soap:Body><AuthRequest xmlns="urn:zimbraAccount">\ | |
<account by="name">%s</account><password>%s</password></AuthRequest></soap:Body>\ | |
</soap:Envelope>""" % ('usuario@dominio', 'senha') | |
headers = { | |
'Content-Type' : 'text/soap+xml' | |
} | |
zimbraUrl = 'https://host_ssl/service/soap' |
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
#!/usr/bin/env python | |
import pika, logging, socket, yaml, marshal | |
from time import sleep | |
ACCEPTED_KEYS = ['message', 'sla_service', 'site', 'host', 'service'] | |
def send_telegram(data, config): | |
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
sock.connect(('localhost', 2391)) | |
if data['sla_service']: |
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 requests, json, sys, hmac, hashlib | |
auth_uri = 'https://api.vericlock.com/1.0/auth' | |
public_key = 'mypublickey' | |
privateKey = 'myprivatekey' | |
# Convert to binary?? | |
#privateKey = ''.join(format(ord(n),'b') for n in privateKey) |
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 info_request_xml($token){ | |
return <<<XML | |
<?xml version="1.0" encoding="UTF-8"?> | |
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"> | |
<soap:Header> | |
<context xmlns="urn:zimbra"> | |
<userAgent name="ZimbraConnectorForOutlook" version="8.0.6.1063" /> | |
<nonotify /> | |
<noqualify /> | |
<authToken>$token</authToken> |
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
""" Provisioning functions Zimbra to Zimbra given ldap entries. | |
Requires: python-ldap | |
Author: Sandro Mello <[email protected]> | |
""" | |
import ldap, sys | |
import xml.etree.ElementTree as ET | |
import datetime | |
LOCALCONFIG = 'localconfig.xml' |
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
""" Provisioning functions Zimbra to Zimbra given ldap entries. | |
Requires: python-ldap | |
Author: Sandro Mello <[email protected]> | |
""" | |
import ldap, sys | |
import xml.etree.ElementTree as ET | |
import datetime | |
LOCALCONFIG = 'localconfig.xml' |