This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Get crond service name | |
systemctl list-units --all | grep -i cron | |
### View log of crond service on systemd | |
journalctl -u cron.service | less | |
or | |
systemcl status cron.service |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
systemctl cat cron.service | |
or | |
cat /etc/init.d/cron |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff <file1> <file2> | |
or | |
sum1=`md5sum <file1> | cut -d " " -f 1` | |
sum2=`md5sum <file2> | cut -d " " -f 1` | |
[ "$sum1" == "$sum2" ] && echo "equal" || echo "not equal" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
systemctl mask cron.service | |
systemctl list-unit-files | grep cron.service | |
## For unmask | |
systemctl unmask cron.service |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/sbin/iptables -A INPUT -i $my_interface -s 0/0 -d $my_local_ip -m state --state ESTABLISHED,RELATED -j ACCEPT | |
/sbin/iptables -A OUTPUT -o $my_interface -s $my_local_ip -p udp -m multiport --dport 53,123 -j ACCEPT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get IP server in pool that my ntp service is getting connection | |
ntpq -pn | |
Change that list: | |
vi /etc/ntp.conf | |
pool 0.ubuntu.pool.ntp.org iburst | |
pool 1.ubuntu.pool.ntp.org iburst | |
pool 2.ubuntu.pool.ntp.org iburst | |
pool 3.ubuntu.pool.ntp.org iburst |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
systemctl stop ntp.service | |
# Synchronize time with server in pool in /etc/ntp.conf | |
ntpd -gq | |
systemctl start ntp.service | |
# View all servers | |
ntpq -pn |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysqladmin status | |
service mysql status | |
service mysqld status | |
ps -ef | grep mysqld | grep -v grep | |
mysql -uroot -p -A -e"SHOW VARIABLES;" > MySQLCurrentSettings.txt | |
tail -f /var/log/mysqld/mysql_error.log | |
tail -f /var/log/mysqld/mysql_slow.log | |
pt-summary | |
pt-mysql-summary --user=root --ask-pass | |
pt-variable-advisor localhost --user=root --ask-pass |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
port 3306 for mysqld | |
port 4567 for replication traffic | |
port 4444 for joiner get SST from donor |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget http://mysqltuner.pl/ -O mysqltuner.pl | |
wget https://raw.githubusercontent.com/major/MySQLTuner-perl/master/basic_passwords.txt -O basic_passwords.txt | |
wget https://raw.githubusercontent.com/major/MySQLTuner-perl/master/vulnerabilities.csv -O vulnerabilities.csv | |
chmod u+x mysqltuner.pl | |
perl mysqltuner.pl |
OlderNewer