Posts

How to setting password policies in Zimbra

Image
How to setting password policies in zimbra? To help your system increase security, password strongest. To get all COS use zmprov command su - zimbra zmprov gac -v | grep Password | sort | uniq To display all attributes as below zimbraFeatureChangePasswordEnabled: TRUE zimbraMobilePolicyAllowSimpleDevicePassword: FALSE zimbraMobilePolicyAlphanumericDevicePasswordRequired: FALSE zimbraMobilePolicyDevicePasswordEnabled: TRUE zimbraMobilePolicyDevicePasswordExpiration: 0 zimbraMobilePolicyDevicePasswordHistory: 8 zimbraMobilePolicyMaxDevicePasswordFailedAttempts: 4 zimbraMobilePolicyMinDevicePasswordComplexCharacters: 0 zimbraMobilePolicyMinDevicePasswordLength: 4 zimbraMobilePolicyPasswordRecoveryEnabled: TRUE zimbraPasswordEnforceHistory: 0 zimbraPasswordLocked: FALSE zimbraPasswordLockoutDuration: 1h zimbraPasswordLockoutEnabled: FALSE zimbraPasswordLockoutFailureLifetime: 1h zimbraPasswordLockoutMaxFailures: 10 zimbraPasswordMaxAge: 0 zimbraPasswordMaxLength:

How to backup and restore for zimbra mailbox

Image
In this tutorial, How to " Backup and restore for zimbra mailbox ". How to backup mailbox for accounts? How to restore mailbox for accounts? The format list_account file as below: [email protected] [email protected] The script backup mailbox for all accounts #!/bin/bash FILE= /tmp/list_account DATE=$(date +"%a") ZMBOX=/opt/zimbra/bin/zmmailbox while read account do      echo "---Generating files from backup $account ---"      $ZMBOX -z -m $account -t 0 getRestURL "//?fmt=zip" > /tmp/$acount.$DATE.zip done < $FILE The script restore mailbox for all accounts #!/bin/bash FILE=/tmp/list_account DATE=$(date +"%a") ZMBOX= /opt/zimbra/bin/zmmailbox while read account do     echo "---Restoring files from backup $account---"     $ZMBOX -z -m $account -t 0 postRestURL "//?fmt=zip&resolve=reset" /tmp/$account.$DATE.zip done < $FILE Note: if you setup multi-server Zimbr

use inotify-tools on centos

inotifywait - wait for changes to files using inotify. To install inotify-tools on centos sudo yum install inotify-tools To install inotify-tools on ubuntu sudo apt-get install inotify-tools For example, how to monitor folder /home/huupv with action create,delete,modiy,move. The scripts as below: #!/bin/bash #Author huupv #My blog huuphan.com inotifywait -m -r /home/huupv -e create -e delete -e modify -e move | while read FOLDER ACTION1 ACTION2 ACTION3 ACTION4 do         echo "Path $FOLDER Create $ACTION1" >>/tmp/output         echo "Path $FOLDER Delete $ACTION2" >>/tmp/output         echo "Path $FOLDER Modify $ACTION3" >>/tmp/output         echo "Path $FOLDER Move $ACTION4" >>/tmp/output done The man page inotifywait man inotifywait NAME        inotifywait - wait for changes to files using inotify SYNOPSIS        inotifywait  [-hcmrq]  [-e  <event> ] [-t <seconds> ] [--format <fmt> ]

How to enable swap-drive on linux

Image
in my post, How to enable swap-drive on linux. The solve problem "Swap Not working" on linux such as centos, Fedora 25.  The open terminal, to check status of swap space ( as run root account) . swapon -s lsblk As the content below NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT sr0     11:0    1  1024M  0 rom sda      8:0    0 465.8G  0 disk ├─sda4   8:4    0 202.1G  0 part ├─sda2   8:2    0 105.9G  0 part / ├─sda5   8:5    0  12.9G  0 part [SWAP] ├─sda3   8:3    0     1K  0 part ├─sda1   8:1    0   487M  0 part └─sda6   8:6    0 144.4G  0 part /media/installed To turn on swap-drive /dev/sda5 swapon /dev/sda5 To make this permanent start-up on the system vim /etc/fstab  As the content below /dev/sda5 swap swap defaults 0 0 To check, if swap drive that work! free -h As the content below               total        used        free      shared  buff/cache   available Mem:           3.6G        2.2G        123M        321M        1.3G        

zimbra 8.6 cbpolicyd example

Image
Links to below you maybe likes: How to zimbra enforce spf checking for incomming email How to use cbpolicyd to configure 120 message from sender in last 30s. in order configure in zimbra cbpolicyd policies -->policy_members -->quotas -->quotas_limits To create zimbra-example.sql file BEGIN TRANSACTION; INSERT INTO "policies" (ID,Name,Priority,Description) VALUES(6,'Example CBPolicyd Policies', 0, 'Example CBPolicyd Policies'); INSERT INTO "policy_members" (ID,PolicyID,Source,Destination) VALUES(10,6, 'user@domain', '!%internal_domains'); INSERT INTO "quotas" (ID,PolicyID,Name,Track,Period,Verdict,Data) VALUES (14,10, 'Sender:user@domain','Sender:user@domain', 30, 'REJECT', 'Rejected from CBPolicyd: Too many messages from sender in last 30s'); INSERT INTO "quotas_limits" (ID,QuotasID,Type,CounterLimit) VALUES(16,14, 'MessageCount', 120); COMMIT; To

screen command on linux

To install screen on linux For centos/RHEL base system sudo yum install screen -y For ubuntu base system sudo apt-get install screen -y screen command useful for wget,ryncs not lose session, when you detach it. For example, create the screen with title $ screen -t 'zimbra' ssh [email protected] pressing "ctrl+a" n: next the screen (switch between screen) pressing "ctrl+a" p: previous the screen (switch between screen) pressing "ctrl+a" x : lock the screen pressing "ctrl+a" k: kill the screen pressing ctrl+a d : deattach To list the screen [huupv@huupv ~]$ screen -ls There is a screen on:     31083.pts-0.huupv    (Detached) 1 Socket in /var/run/screen/S-huupv. To resume the screen screen -r 31083 How to deattached screen with Attached status [huupv@localhost]$ screen -ls The output There is a screen on: 20655.pts-4.ra3 (Attached)1 Socket in /var/run/screen/S-huupv. [huupv@localhost]$ screen -r -d 20655.pts-4.ra3 Error

How to install ibus-bogo on fedora 25

Image
How to install ibus-bogo on fedora 25. I'm running commands as privileged ! To download ibus-bogo-0.4-12.fc26.noarch.rpm wget https://kojipkgs.fedoraproject.org//packages/ibus-bogo/0.4/12.fc26/noarch/ibus-bogo-0.4-12.fc26.noarch.rpm To install ibus-bogoon fedora 25 sudo rpm -ivh ibus-bogo-0.4-12.fc26.noarch.rpm  To configure ibus-bogo on fedora 25 ibus-daemon & ibus restart ibus-setup  Note: for program writen QT, example: skype... vim ~/.bash_profile The content as following: export GTK_IM_MODULE=ibus export QT4_IM_MODULE=xim export QT_IM_MODULE=xim export XMODIFIERS=@im=ibus To after, logout and login. Thanks for reading!

How to install mediawiki on centos 6

Image
Links to below you maybe likes: How to install php7 on centos 6 How to install and configure redmine on centos 6 How to owncloud 9 install ssl certificate centos 7 How To Install the BIND DNS Server on CentOS 6 KeepAlived IP Failover on CentOS & Red Hat How to install mediawiki on centos 6 To require nginx php MySQL Step 1: To update and install epel repo, ntpd #yum update -y #yum install -y epel-release #yum install -y ntp #chkconfig ntpd on #ntpdate pool.ntp.org #service ntpd start Step 2: To install the dependencies #yum install gd sendmail gcc pcre yum-utils wget Step 3:  To install php7 for nginx remi centos 6 Step 4: To install ImageMagick #yum install php-mbstring php-fpm php-devel php-mysql php-pear ImageMagick ImageMagick-devel --enablerepo=remi-php70 #pecl install imagick #echo "extension=imagick.so" > /etc/php.d/imagick.in Step 5: To enable module php-mbstring for nginx #find / -name mbstring.so The result /opt/remi/php70/roo

Linux basic commands

Linux basic commands How to check version Ubuntu lsb_release -a How to check to distribute cat /etc/*release How to check CPU information cat /proc/cpuinfo How to check PCI devices lspci How to list all USB devices lsusb How to get PC name from IP nmblookup -A <ip> nbtscan <ip> How many connect on server who -H How many core processor nproc How to check full CPU information lscpu  How to create new user adduser huupv passwd huupv For centos usermod -aG wheel huupv For ubuntu echo "huupv ALL=(ALL) ALL" >> /etc/sudoers How to find UUID disk blkid /dev/sda6 lsblk -f To continuous....

How to install php7 on centos 6

Image
How to install php7 on centos 6, I'm use remi repo to install remi-php70. I'm running commands as root account. To install php7  yum install wget yum-utils wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm rpm -Uvh remi-release-6.rpm yum-config-manager --enable remi-php70 yum install php --enablerepo=remi-php70 To check for available repositories yum repolist For example: To install php7 for nginx ( Due to, nginx use php-fpm and php-mysql) yum install php-fpm php-mysql --enablerepo=remi-php70 Thanks for reading! How to install php7 on centos 6