netstat -a | more tcpdump -i eth0 lsof vmstat htop
centos7 : inotify inotifywait convmv Hint
# yum install inotify # yum install convmv test.sh --------------------------- #!/bin/sh # /root/bin/inotifywaitWP.sh /home/*/*/wordpress/wp-content/uploads EVENTS="CREATE,MOVED_TO" if [ -z "$1" ]; then echo "Usage: $0 cmd ..." exit -1; fi inotifywait -e "$EVENTS" -mrq --format '%w%f' $1 | ( while read FILE; do […]
Centos7 : apache MPM Hint
# httpd -V | grep MPM Server MPM: prefork CentOS provide 3 way modules, need to select only one. prefork => default worker event Change prefork to worker # vi /etc/httpd/conf.modules.d/00-mpm.conf #LoadModule mpm_prefork_module modules/mod_mpm_prefork.so LoadModule mpm_worker_module modules/mod_mpm_worker.so #vi /etc/httpd/conf.modules.d/10-php.conf <IfModule prefork.c> LoadModule php5_module modules/libphp5.so </IfModule> <IfModule worker.c> LoadModule php5_module modules/libphp5-zts.so </IfModule> […]
centos7 : mod_evasive & mod_security for Apache DDOS Hint
# yum install mod_evasive mod_security # httpd -M | grep -E 'evasive|security' # vi /etc/httpd/conf.d/mod_security.conf # vi /etc/httpd/conf.d/mod_evasive.conf DOSPageCount 2 DOSSiteCount 50 DOSPageInterval 1 DOSBlockingPeriod 10 DOSWhitelist 127.0.0.1 DOSWhitelist 192.168.0.* # systemctl restart httpd.service
cenos7 : firewall-cmd, Lockdown, fail2ban-firewalld Hint
masquerade firewall-cmd --zone=external --query-masquerade firewall-cmd --zone=external --add-masquerade external port forward firewall-cmd --zone=external --list-all firewall-cmd --zone=external --add-forward-port=port=22:proto=tcp:toport=2222:toaddr=192.168.0.11 Lockdown # vi /etc/firewalld/firewalld.conf Lockdown=yes # firewall-cmd --reload # firewall-cmd --query-lockdown # firewall-cmd --lockdown-on # firewall-cmd --lockdown-off Block IP # firewall-cmd --zone=public --add-rich-rule='rule family="ipv4" source address="192.168.0.41" accept' # firewall-cmd --list-all # firewall-cmd --zone=public --remove-rich-rule='rule family="ipv4" source address="192.168.0.41" accept' # […]
centos7 : logtop hint
wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm rpm -ivh epel-release-7-5.noarch.rpm yum install git ncurses-devel uthash-devel git clone https://github.com/JulienPalard/logtop.git cd logtop make make install tail -f /var/log/httpd/access_log | awk {'print $1; fflush();'} | logtop
mac : mds Process 100% CPU : mds service set disabled - Hint
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
centos7 : change / Set default java version
update-alternatives --config java
centos 7 : format over 4TB Hint
# yum install parted # lsblk fdisk -l /dev/sda Disk /dev/sda: 4000.8 GB, 4000787030016 bytes, 7814037168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk label type: dos Disk identifier: 0x4d1b22b4 Device Boot Start End Blocks Id System […]
named : master-slave notify Hint
master : in zone files masters ip : 192.168.0.10 2015122601; serial => must changed when zone file edited IN NS ns.owllab.org. IN NS ns1.owllab.org. slave : in named.conf file # vi /etc/named/named.conf zone "owllab.org" IN {type slave;masters […]