Skip to content

Instantly share code, notes, and snippets.

View richardsonlima's full-sized avatar
:octocat:
Focusing

Richardson Lima richardsonlima

:octocat:
Focusing
View GitHub Profile
#!/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}
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
@richardsonlima
richardsonlima / gist:6aa73e8e4fd4f64fec5cae19016e3a15
Created January 16, 2017 18:10
Detect a New Hard Disk Without Rebooting VMware Linux Guest
ls /sys/class/scsi_host/ | while read host ; do echo "- - -" > /sys/class/scsi_host/$host/scan ; done
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 \
#!/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
--- 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
#!/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='
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 ;
su - zimbra
zmprov -l gaa | while read ACCOUNT
do
zmprov ma ${ACCOUNT} zimbraPrefPop3DownloadSince $(date "+%Y%m%d%H%M%S"Z)
done
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.