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
# User specific aliases and functions
Normal="\[\\033[0m\]"
Vermelho="\[\\033[1;31m\]"
Verde="\[\\033[1;32m\]"
Amarelo="\[\\033[1;33m\]"
Azul="\[\\033[1;34m\]"
Roxo="\[\\033[1;35m\]"
Ciano="\[\\033[1;36m\]"
Branco="\[\\033[1;37m\]"
PS1="$Normal$Azul[$Branco(\t) $Verde\u$Vermelho@$Amarelo\h$Verde $Ciano\w$Azul]$Branco\\$ $Normal"
#!/bin/bash
# This script was created by Richardson Lima ( www.richardsonlima.com.br )
# Run as zimbra user
# set -x
printf "\033[1;33m[✔] Enter domain to change disclaimer (e.g: yxz.com.br): \n \033[0m"
read mydomain
printf "\033[1;33m[✔] Seeing zimbra domain mandatory mail signature status \n \033[0m"
zmprov gcf zimbraDomainMandatoryMailSignatureEnabled
printf "\033[1;33m[✔] Enabling zimbra domain mandatory signature \n \033[0m"
su - zimbra
zmprov -l gaa | while read ACCOUNT
do
zmprov ma ${ACCOUNT} zimbraPrefPop3DownloadSince $(date "+%Y%m%d%H%M%S"Z)
done
How to resize ext4 root partition live without umount on Linux
This article will focus on how to resize EXT4 root partition without unmount. This is an easy way for some system where you are unable to unmount root partition and the system can be recovered easily if something goes wrong like for example AWS instance.
Resizing any live partition without unmout comes with a tremendous risk of loosing data thus it is not recommended. If you a have a sensitive data stored on your system, it is always recommended to take the system down make a backup and resize the partition while it is not mounted.
In the following example we are going to resize a partition of a fresh single partition AWS Linux instance. The current partition size is 7.8GB:
# df -h .
Filesystem Size Used Avail Use% Mounted on
/dev/xvda1 7.8G 642M 6.8G 9% /
However, the disk size reports 20GB:
# fdisk -l
for user in $(cat ./accounts.txt);do echo -e '\033[0;36m [+] Efetuando migração do usuario: \033[m' $user && imapsync --timeout 0 --addheader --syncinternaldates --buffersize 81920000 --host1 IP-SERVER-ORIGEM --user1 $user+DovecotSuperUser --password1 'PASSWORD' --authmech1 PLAIN --sep1 "/" --prefix1 "" --syncinternaldates --host2 localhost --port2 7143 --user2 $user@DOMAIN --password2 'PASSWORD' --authmech2 PLAIN --subscribed \
--folder "^INBOX$" \
--folder "FOLDERNAME-1" \
--folder "FOLDERNAME-2" \
--allowsizemismatch --useheader Message-ID ; done
su - zimbra -c 'zmlocalconfig -e antispam_enable_rule_updates=true'
su - zimbra -c 'zmlocalconfig -e antispam_enable_restarts=true'
su - zimbra -c 'zmlocalconfig -e antispam_enable_rule_compilation=true'
su - zimbra -c 'zmamavisdctl restart'
su - zimbra -c 'zmmtactl restart'
su - zimbra -c 'zmlocalconfig -e antispam_enable_rule_updates=false'
su - zimbra -c 'zmlocalconfig -e antispam_enable_restarts=false'
su - zimbra -c 'zmlocalconfig -e antispam_enable_rule_compilation=false'
su - zimbra -c 'zmamavisdctl restart'
# All e-mail address
[a-zA-Z0-9.!#$%&'+-/=?\^_`{|}~-]+@[a-zA-Z0-9-]+(?:.[a-zA-Z0-9-]+)
#!/usr/bin/env python
# coding=utf-8
#
#
# This has been redesigned to use the MS08-067 in Metasploit which is much more reliable.
#
#
#
import subprocess
zmlocalconfig | grep zimbra_session_limit_soap
-----------
zmlocalconfig | grep zimbra_session_limit_soap
zimbra_session_limit_soap = 5
-----------
zmlocalconfig -e zimbra_session_limit_soap=10
import smtplib
import os
from email.MIMEText import MIMEText
fromaddr = '[email protected]'
toaddrs = '[email protected]'
from email.mime.multipart import MIMEMultipart
msg = MIMEMultipart()