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
# @ master | |
DB=dbname | |
SLAVE=root@slave | |
TMPFILE=/tmp/dbdump.sql.gz | |
mysql -u root -p -e "RESET MASTER; FLUSH TABLES WITH READ LOCK; SHOW MASTER STATUS;" $DB | |
mysqldump -u root -p --lock-all-tables $DB | gzip > $TMPFILE | |
mysql -u root -p -e "UNLOCK TABLES;" $DB | |
scp $TMPFILE $SLAVE:/tmp/ | |
rm $TMPFILE |
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
#!/usr/bin/bash | |
dns_server="@IP DNS SERVER 1@" | |
while [ -n "$dns_server" ]; do | |
ping -q -c 1 $dns_server | while read pong; do echo "$(TZ='Europe/Moscow' date): $pong" » ./ck_dns_test.out; done | |
host -t A @DNS MANE OF YOUR HOST@ $dns_server | while read myhost; do echo "$(TZ='Europe/Moscow' date): $myhost" » ./ck_dns_test.out; echo $myhost; done | |
echo '' » ./ck_dns_test.out | |
case "$dns_server" in | |
@IP DNS SERVER 1@) | |
dns_server="@IP DNS SERVER 2@" |
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
sysctl -w fs.file-max=12000500 | |
sysctl -w fs.nr_open=20000500 | |
ulimit -n 4000000 | |
sysctl -w net.ipv4.tcp_mem='10000000 10000000 10000000' | |
sysctl -w net.ipv4.tcp_rmem='1024 4096 16384' | |
sysctl -w net.ipv4.tcp_wmem='1024 4096 16384' | |
sysctl -w net.core.rmem_max=16384 | |
sysctl -w net.core.wmem_max=16384 | |
wget http://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb | |
sudo dpkg -i erlang-solutions_1.0_all.deb |
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 | |
innobackupex --stream=xbstream --parallel=4 --compress --compress-threads=2 /var/lib/mysql > /root/backup/backup.xbstream | |
# restore | |
xbstream -x < /root/backup/backup.xbstream | |
yum install http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm | |
yum install qpress | |
for i in $(find -name "*.qp"); do qpress -vd $i $(dirname ${i}) && rm -f $i; done | |
innobackupex --apply-log ./ | |
service mysql stop |
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
#301 Redirects for .htaccess | |
#Redirect a single page: | |
Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
#Redirect an entire site: | |
Redirect 301 / http://www.domain.com/ | |
#Redirect an entire site to a sub folder | |
Redirect 301 / http://www.domain.com/subfolder/ |
NewerOlder