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 | |
set -x | |
check(){ | |
regex="^[a-z0-9!#\$%&'*+/=?^_\`{|}~-]+(\.[a-z0-9!#$%&'*+/=?^_\`{|}~-]+)*@([a-z0-9]([a-z0-9-]*[a-z0-9])?\.)+[a-z0-9]([a-z0-9-]*[a-z0-9])?\$" | |
checkaccounttokenproblem=$(tail -f /opt/zimbra/log/mailbox.log |grep --color -iE 'zimbraAuthTokens: no such value'|awk '{print $5}'|gawk -v RS='[[:alnum:]_.]+@[[:alnum:]_]+[.][[:alnum:]]+[.][[:alnum:]]+' 'RT{print RT}') | |
if [[ $checkaccounttokenproblem=~$regex ]] ; then | |
echo -e "\033[1;33m [+] Resetando token do usuario: \033[0m"; ${checkaccounttokenproblem} |
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
Get-VM | select Name, Notes, PowerState, NumCpu, MemoryMB | sort Name | Export-Csv -path "c:\reports\vminventory.csv" –NoTypeInformation | |
Get-VM | select Name, Notes, PowerState, NumCpu, MemoryMB | sort Name > report.txt |
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
ls /sys/class/scsi_host/ | while read host ; do echo "- - -" > /sys/class/scsi_host/$host/scan ; 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
Step 1. Launch a postgresql container | |
docker run --name=postgresql-redmine -d \ | |
--env='DB_NAME=redmine_production' \ | |
--env='DB_USER=redmine' --env='DB_PASS=password' \ | |
--volume=/srv/docker/redmine/postgresql:/var/lib/postgresql \ | |
sameersbn/postgresql:9.6-2 | |
Step 2. Launch the redmine container | |
docker run --name=redmine -d \ |
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 | |
BASE="/home/django/framework-base" | |
cd ${BASE} && git pull [email protected]:xyz/sistema.git | |
/usr/bin/pip3 install -r requirements.txt | |
/usr/bin/python3.4 manage.py collectstatic --noinput | |
/usr/bin/python3.4 manage.py makemigrations | |
/usr/bin/python3.4 manage.py migrate | |
/usr/bin/python3.4 manage.py compilemessages | |
#service gunicorn restart | |
#service nginx restart |
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
--- Use zimbra user to do this | |
* add restricted use in this file | |
/opt/zimbra/conf/restricted_senders | |
* add localdomain in this file | |
/opt/zimbra/conf/local_domains | |
postmap /opt/zimbra/conf/restricted_senders | |
postmap /opt/zimbra/conf/local_domains |
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 | |
# IPs or hostnames to check if none provided as arguments to the script | |
hosts=' | |
mx02.DOMAIN.com.br | |
mx01.DOMAIN.com.br | |
' | |
# Locally maintained list of DNSBLs to check | |
LocalList=' |
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
all_accounts=`zmprov -l gaa`; for account in $all_accounts; do mbox_size=`zmmailbox -z -m $account gms`; echo "Mailbox size of $account = $mbox_size"; 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
su - zimbra | |
zmprov -l gaa | while read ACCOUNT | |
do | |
zmprov ma ${ACCOUNT} zimbraPrefPop3DownloadSince $(date "+%Y%m%d%H%M%S"Z) | |
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
su - zimbra -c "zmmailbox -z -m contadeemail@dominio postRestURL '//?fmt=tgz&resolve=skip' pastadebackup/arquivodebackup.tgz"; | |
* Note : | |
--> resolve = skip. This parameters will keep mailboxes existing on users. | |
--> resolve = reset. This parameters will delete mailboxes existing on user and will be changed with mailbox backup. | |
The reset parameter could be changed with skip, replace, modify. | |
--> folder/file-location.tgz is folder/file location backup mailboxes. |