Postfix Monitor Sent Mails and Block Domains

Check how many mails has been sent via postfix.

If the number is to big, it must be hacked by someone on some services.

sudo grep "status=sent" /var/log/mail.log | egrep -ve 'postfix/(cleanup|pickup|master|qmgr|smtpd|local|pipe)' | wc -l
Read More

IP Reserved Loopback and Private Addresses

Range Start Address

Range End Address

“Classful” Address Equivalent

Classless Address Equivalent

Description

0.0.0.0

0.255.255.255

Class A network 0.x.x.x

0/8

Reserved.

10.0.0.0

10.255.255.255

Class A network 10.x.x.x

10/8

Class A private address block.

127.0.0.0

127.255.255.255

Class A network 127.x.x.x

127/8

Loopback address block.

128.0.0.0

128.0.255.255

Class B network 128.0.x.x

128.0/16

Reserved.

169.254.0.0

169.254.255.255

Class B network 169.254.x.x

169.254/16

Class B private address block reserved for automatic private address allocation. See the section on DHCP for details.

172.16.0.0

172.31.255.255

16 contiguous Class B networks from 172.16.x.x through 172.31.x.x

172.16/12

Class B private address blocks.

191.255.0.0

191.255.255.255

Class B network 191.255.x.x

191.255/16

Reserved.

192.0.0.0

192.0.0.255

Class C network 192.0.0.x

192.0.0/24

Reserved.

192.168.0.0

192.168.255.255

256 contiguous Class C networks from 192.168.0.x through 192.168.255.x

192.168/16

Class C private address blocks.

223.255.255.0

223.255.255.255

Class C network 223.255.255.x

223.255.255/24

Reserved.

Read More

Linux Firewall for Docker Swarm on CentOS 7

Firewalld

firewall-cmd --add-port=2376/tcp --permanent
firewall-cmd --add-port=2377/tcp --permanent
firewall-cmd --add-port=7946/tcp --permanent
firewall-cmd --add-port=7946/udp --permanent
firewall-cmd --add-port=4789/udp --permanent
firewall-cmd --reload
systemctl restart docker
Read More

GlusterFS

commands

sudo yum install centos-release-gluster312.noarch
sudo yum install glusterfs gluster-cli glusterfs-libs glusterfs-server
sudo mkdir /home/glusterfs
sudo chown <user>:<user group> /home/glusterfs
sudo gluster peer probe swarm-manager01.yourdomain.com
sudo service enable gluster.service
sudo systemctl enable gluster.service
sudo systemctl enable glusterd.service
sudo systemctl start glusterd
sudo systemctl status glusterd
sudo systemctl enable glusterd.service
sudo systemctl start glusterd.service
sudo gluster peer probe swarm-manager02.yourdomain.com
sudo gluster peer probe swarm-manager03.yourdomain.com
sudo gluster peer probe swarm-manager01.yourdomain.com
sudo gluster peer probe swarm-node01.yourdomain.com
sudo gluster peer probe swarm-node02.yourdomain.com
sudo gluster peer probe swarm-worker02.yourdomain.com
sudo gluster peer probe swarm-worker01.yourdomain.com
sudo gluster peer status
gluster volume create gfs replica 3 swarm-manager01.yourdomain.com:/home/glusterfs swarm-manager02.yourdomain.com:/home/glusterfs swarm-worker01.yourdomain.com:/home/glusterfs gluster volume create gfs replica 5 swarm-manager01.yourdomain.com:/home/glusterfs swarm-manager02.yourdomain.com:/home/glusterfs swarm-worker01.yourdomain.com:/home/glusterfs \
sudo gluster volume create gfs replica 5 swarm-manager01.yourdomain.com:/home/glusterfs swarm-manager02.yourdomain.com:/home/glusterfs swarm-worker01.yourdomain.com:/home/glusterfs swarm-worker02.yourdomain.com:/home/glusterfs
sudo gluster volume create gfs replica 3 swarm-manager01.yourdomain.com:/home/glusterfs swarm-manager02.yourdomain.com:/home/glusterfs swarm-worker01.yourdomain.com:/home/glusterfs swarm-worker02.yourdomain.com:/home/glusterfs
sudo gluster volume create gfs replica 5 swarm-manager03.yourdomain.com/home/glusterfs swarm-manager01.yourdomain.com:/home/glusterfs swarm-manager02.yourdomain.com:/home/glusterfs swarm-worker01.yourdomain.com:/home/glusterfs swarm-worker02.yourdomain.com:/home/glusterfs
mkdir -p /home/glusterfs/1/brick
sudo gluster volume create gfs replica 5 swarm-manager03.yourdomain.com/home/glusterfs/1/brick swarm-manager01.yourdomain.com:/home/glusterfs/3/brick swarm-manager02.yourdomain.com:/home/glusterfs/2/brick swarm-worker01.yourdomain.com:/home/glusterfs/4/brick swarm-worker02.yourdomain.com:/home/glusterfs/brick
sudo gluster volume create gfs replica 5 swarm-manager03.yourdomain.com:/home/glusterfs/1/brick swarm-manager01.yourdomain.com:/home/glusterfs/3/brick swarm-manager02.yourdomain.com:/home/glusterfs/2/brick swarm-worker01.yourdomain.com:/home/glusterfs/4/brick swarm-worker02.yourdomain.com:/home/glusterfs/brick
sudo gluster volume create gfs replica 5 swarm-manager03.yourdomain.com:/home/glusterfs/1/brick swarm-manager01.yourdomain.com:/home/glusterfs/3/brick swarm-manager02.yourdomain.com:/home/glusterfs/2/brick swarm-worker01.yourdomain.com:/home/glusterfs/4/brick swarm-worker02.yourdomain.com:/home/glusterfs/brick
sudo gluster volume create gfs replica 5 swarm-manager03.yourdomain.com:/home/glusterfs/1/brick swarm-manager01.yourdomain.com:/home/glusterfs/3/brick swarm-manager02.yourdomain.com:/home/glusterfs/2/brick swarm-worker01.yourdomain.com:/home/glusterfs/4/brick swarm-worker02.yourdomain.com:/home/glusterfs/brick force
sudo gluster list
sudo gluster volume list
sudo gluster start gfs
sudo gluster volume start gfs
sudo gluster volume status gfs
Read More