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
// 限制必须在iframe里面打开页面 | |
// 此方法用户浮动iframe窗口的页面做限制,只有通过iframe才可以打开页面 | |
// 禁止在iframe外打开 | |
if (top.location == self.location) { | |
location.href = "/"; | |
} |
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
- MySQL 创建超级用户 创建用户,并有localhost下所有数据库的超级权限 | |
grant all on *.* to monster@localhost identified by "123456"; | |
flush privileges; | |
- 删除用户 | |
use mysql; | |
delete from user where user = 'monster'; |
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
# mysql 完整备份数据库 | |
# -uroot(root是用户名 -u与root之间没空格) -p123123 (123123是密码 -p与123123之间没空格) | |
mysqldump -uroot -p123123 --databases pasite > $BACKUP_PATH/pasite.sql |
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
# Linux 自动备份 MySQL与网站并发邮件到自已邮箱 1 | |
# 1.将刚才到处的MySQL文件压缩,以节省邮箱空间 | |
tar zcf $BACKUP_PATH/pasite_db_$DATE_NAME.tar.gz $DATE_NAME/pasite.sql | |
tar zcf $BACKUP_PATH/personlab_db_$DATE_NAME.tar.gz $DATE_NAME/personlab.sql | |
# 2.打包压缩网站 | |
tar zcf $BACKUP_PATH/pasite_src_$DATE_NAME.tar.gz ~home/huacnlee/wwwroot/pasite/ | |
tar zcf $BACKUP_PATH/personlab_src_$DATE_NAME.tar.gz ~home/huacnlee/wwwroot/personlab/ | |
# Linux 自动备份 MySQL与网站并发邮件到自已邮箱 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
deb http://mirrors.163.com/ubuntu/ hardy main restricted universe multiverse | |
deb http://mirrors.163.com/ubuntu/ hardy-security main restricted universe multiverse | |
deb http://mirrors.163.com/ubuntu/ hardy-updates main restricted universe multiverse | |
deb http://mirrors.163.com/ubuntu/ hardy-proposed main restricted universe multiverse | |
deb http://mirrors.163.com/ubuntu/ hardy-backports main restricted universe multiverse | |
deb-src http://mirrors.163.com/ubuntu/ hardy main restricted universe multiverse | |
deb-src http://mirrors.163.com/ubuntu/ hardy-security main restricted universe multiverse | |
deb-src http://mirrors.163.com/ubuntu/ hardy-updates main restricted universe multiverse | |
deb-src http://mirrors.163.com/ubuntu/ hardy-proposed main restricted universe multiverse | |
deb-src http://mirrors.163.com/ubuntu/ hardy-backports main restricted universe multiverse |
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
gem install passenger | |
passenger-install-apache2-module | |
sed -i 's/passenger-2\.2\.4/passenger-2\.2\.7/g' /etc/apache2/conf.d/passenger.conf | |
apache2ctl restart | |
tail /var/log/apache2/error.log |
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
# Become root | |
su root | |
# Create source directory | |
mkdir -p /opt/local/src | |
cd /opt/local/src | |
# Install build tools | |
aptitude install build-essential |
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
sudo apt-get install build-essential | |
sudo apt-get install curl | |
sudo apt-get install zlib1g-dev libreadline5-dev libssl-dev libxml2-dev | |
sudo apt-get install ruby1.8 rubygems1.8 | |
bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head ) |
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
保存退出 | |
第三步 | |
chmod +x /etc/init.d/nginx | |
第四步 | |
/sbin/chkconfig nginx on | |
检查一下 | |
sudo /sbin/chkconfig --list nginx | |
nginx 0:off 1:off 2:on 3:on 4:on 5:on 6:off | |
完成! |
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 | |
### BEGIN INIT INFO | |
# Provides: redis-server | |
# Required-Start: $syslog | |
# Required-Stop: $syslog | |
# Should-Start: $local_fs | |
# Should-Stop: $local_fs | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: redis-server - Persistent key-value db |