- Yslow
- pagespeed insights
- YUI
- purecss
- bootstrap
- html5
- CSS3
- CSS sprite
- Ext JS
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/sh | |
logfile=/tmp/httpd.log | |
Date=`date '+%Y-%m-%d %H:%M:%S'` | |
httpd_proc_num=`pgrep httpd | wc -l` | |
## httpd进程数少于3,说明有异常,重启服务: | |
if [ $httpd_proc_num -lt 3 ]; then | |
echo "$Date httpd process count: $httpd_proc_num, restart it" >> $logfile |
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
netstat -tan| awk '{print $5}' | cut -d: -f4| sort| uniq -c|sort -nr |awk '{if($1>10)print "iptables -I INPUT -s "$2" -j DROP"}' |
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
netstat -tan| awk '{print $5}' | cut -d: -f1| sort| uniq -c| sort -nr |
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/sh | |
## MySQL 5.1.61 | |
## mysql_kill_locked.sh #调试 | |
## mysql_kill_locked.sh | sh #执行 | |
## ID != 1 | |
mysqladmin -u* -p* processlist |grep Locked |awk '{if($2!=1)print "mysqladmin -u* -p* kill " $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
## .htaccess | |
## redirect all php request: | |
RewriteEngine on | |
RewriteCond $1 php$ | |
RewriteRule ^(.*)$ http://www.abc.com/construction.html [L,R=301] | |
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/sh | |
## MySQL 5.1.61 | |
## sleep时间大于等于10秒,kill掉: | |
mysqladmin -u* -p* processlist |grep -i sleep |awk '{if($12>=10) print $2}' |xargs -n1 mysqladmin -u* -p* kill | |
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/sh | |
## CentOS release 6.2 | |
TODAY=`date '+%Y%m%d.%H'` | |
TOMORROW=`date -d'tomorrow' '+%Y%m%d'` | |
YESTERDAY=`date -d'yesterday' '+%Y%m%d'` | |
PREVIOUS_HOUR=`date -d'1 hour ago' '+%Y%m%d%H'` | |
NEXT_HOUR=`date -d'+1 hour' '+%Y%m%d%H'` | |
echo $NEXT_HOUR |
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 ifconfig.me/all.json | |
curl ifconfig.me/all.json |
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
fact = lambda x: x and x*fact(x-1) or 1 | |
print fact(5) |
NewerOlder