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
-- a quick LUA access script for nginx to check IP addresses match an | |
-- `ip_whitelist` set in Redis, and if no match is found send a HTTP | |
-- 403 response or just a custom json instead. | |
-- | |
-- allows for a common whitelist to be shared between a bunch of nginx | |
-- web servers using a remote redis instance. lookups are cached for a | |
-- configurable period of time. | |
-- | |
-- white an ip: | |
-- redis-cli SADD ip_whitelist 10.1.1.1 |
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/sh | |
# check cpu load | |
USR="zby" | |
hosts='' | |
hosts="${hosts} -dev001" | |
hosts="${hosts} `seq -f %003g 1 91`" | |
for ip in ${hosts} | |
do | |
machine="yourmachinename${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 | |
# auto_deploy nginx config | |
# | |
# zhao.binyan | |
# 2014-05-09 | |
su xxx -c "sh /home/xxx/bin/deploy_nginx_rewrite.sh" | |
nginx_status=`nginx -t 2>&1` | |
if [[ $nginx_status =~ "successful" ]] ; then |
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 常用配置 | |
## git 预配置 | |
git config --global push.default simple | |
git config --global user.editor vim | |
git config --global user.name "yourname" | |
git config --global user.email "youremail" | |
# 忽略大小写 | |
git config core.ignorecase false |