This file contains 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
git init # 初始化本地git仓库(创建新仓库) | |
git config --global user.name "xxx" # 配置用户名 | |
git config --global user.email "xxx@xxx.com" # 配置邮件 | |
git config --global color.ui true # git status等命令自动着色 | |
git config --global color.status auto | |
git config --global color.diff auto | |
git config --global color.branch auto | |
git config --global color.interactive auto | |
git config --global --unset http.proxy # remove proxy configuration on git | |
git clone git+ssh://git@192.168.53.168/VT.git # clone远程仓库 |
This file contains 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
使用root登陆服务器,在/etc/security/limits.conf 文件中添加 | |
* - nofile 65535 | |
再重新登录普通用户 |
This file contains 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 | |
RSYNC_ORIGINAL_LOG (){ | |
SET_SERVICE=$1 | |
SEQUENCE=$2 | |
SOURCE_IP=$3 | |
rsync $ORIGINAL_LOG_PATH/${SOURCE_IP}/${SET_SERVICE}.log.${SET_DATE_FROMAT}.gz 10.32.231.97::snowman_original_org/${SET_SERVICE}/${SET_DATE_FROMAT//-/}/${SET_SERVICE}.log.${SET_DATE_FROMAT//-/}-${SEQUENCE}.gz | |
} | |
DIRECTION_IP_LIST=(x.x.x.x x.x.x.x x.x.x.x) |
This file contains 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 | |
PROCESS_IP(){ | |
SET_SERVICE=$1 | |
SET_DATE_FAMATE=$2 | |
SERVICE_ARRAY=($(find $SORCE_DIR -type f|grep $SET_SERVICE|grep $SET_DATE_FAMATE|sort|xargs)) | |
for i in `seq 0 $((${#SERVICE_ARRAY[*]}-1))` | |
do | |
echo ${SERVICE_ARRAY[$i]} |
This file contains 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
echo显示带颜色,需要使用参数-e | |
格式如下: | |
echo -e "\033[字背景颜色;文字颜色m字符串\033[0m" | |
例如: | |
echo -e "\033[41;37m TonyZhang \033[0m" | |
其中41的位置代表底色, 37的位置是代表字的颜色 | |
注: | |
1、字背景颜色和文字颜色之间是英文的“""” | |
2、文字颜色后面有个m | |
3、字符串前后可以没有空格,如果有的话,输出也是同样有空格 |
This file contains 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
命令示例: | |
rsync -rav -e ssh --exclude='*.svn-base' test/ root@target.org:/home/target_dir/ | |
--exclude="" 删除某类文件或目录 | |
test 要同步的本地文件夹 | |
root@xxxxx:/xxxx/ 目标目录文件夹 | |
使用该命令对端不需要启动rsync服务,只需要ssh信任即可 | |
目标目录可以与本地目录做位置做互换 |
This file contains 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
grant all on *.* to 'root'@'192.168.1.%' identified by '123456'; | |
grant all on *.* to 'root'@'localhost' identified by '123456'; | |
grant all on *.* to 'root'@'127.0.0.1' identified by '123456'; |
This file contains 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
该功能用户小型个人或公司网站,由于硬件资源有限不能实用数据库进行搭建syslog系统使用。 | |
一、系统环境变量设置 | |
在/etc/profile中添加: | |
USER_IP=`who -u am i 2>/dev/null| awk '{print $NF}'|sed -e 's/[()]//g'` | |
TTY_TERMINAL=`who -u am i|awk '{print $2}'` | |
DATE=`date +"%Y%m%d"` | |
if [ "$USER_IP" = "" ] |
This file contains 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 | |
DATE=$(date +%Y%m%d) | |
/usr/local/webserver/mysql/bin/mysqldump -u root -ppasswd --opt dbname > $DATE | |
tar cfz $DATE.tar.gz $DATE | |
(echo "$DATE DB backup";uuencode $DATE.tar.gz $DATE.tar.gz)|mail -s "${DATE}_pangxiang_DB_backup" x.x.x@qq.com | |
############################### | |
#也可以使用如下命令进行附件发送,效果也不错 |
This file contains 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 | |
DATE1=`date +%Y/%m/%d` | |
DATE2=`date +%Y/%m/` | |
PIC_dir="/home/wwwroot/web/" | |
if [ -d ${PIC_dir} ] | |
then | |
cd ${PIC_dir} && find . -name "*.jpg" -exec convert -resize 110x150 {} {} \; | |
fi |
NewerOlder