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
Backup myisam db: | |
innobackupex --user=root--password=<passwd> --host=127.0.0.1 --parallel=4 --lock-wait-timeout=180 --lock-wait-threshold=20 --lock-wait-query-type=all --kill-long-queries-timeout=20 --kill-long-query-type=all /data/backup | |
Backup innodb db: | |
innobackupex --user=root--password=<passwd> --host=127.0.0.1 --parallel=4 /data/backup | |
Backup galera: | |
innobackupex --user=root--password=<passwd> --host=127.0.0.1 --galera-info --parallel=4 /data/backup | |
Restore: |
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
In search box: | |
user:username keyword |
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
journalctl -u docker.service | less | |
systemctl status docker.service -l | |
docker inspect <container-name> | |
docker logs -f <container-name> | |
docker inspect <image-name> | |
docker history <image-name> | |
docker network inspect <network-name> |
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
#!/bin/bash | |
db=<db> | |
collection_list="<collection1> <collection2> <collection3>" | |
host=127.0.0.1 | |
port=<port> | |
out_prefix=/Temp | |
for collection in $collection_list; do | |
echo $collection | |
out_dir="${out_prefix}/${db}_${collection}/" |
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
For chrony client: | |
yum install chrony | |
vi /etc/chrony.conf | |
server NTP_SERVER iburst | |
systemctl enable chronyd.service | |
systemctl start chronyd.service | |
For chrony server: | |
yum install chrony |
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
hostname <new-hostname> | |
echo "<new-hostname>" > /etc/hostname | |
replace old-hostname by new-hostname in /etc/hosts |
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
rdesktop -u <username> -p"<password>" <ip> -g 90% |
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
SELECT table_schema as `Database`, table_name AS `Table`, round(((data_length + index_length) / 1024 / 1024), 2) as mb FROM information_schema.TABLES order by mb asc; |
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
select table_schema "DB Name", Round(Sum(data_length + index_length) / 1024 / 1024, 1) "DB Size in MB" from information_schema.tables group by table_schema; |
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
select table_schema, table_name, engine from information_schema.tables where engine != 'InnoDB' and table_schema not in ('mysql', 'performance_schema', 'information_schema'); |