Skip to content

Instantly share code, notes, and snippets.

View itbdw's full-sized avatar
🎯
Focusing

IT不倒翁 itbdw

🎯
Focusing
View GitHub Profile
@itbdw
itbdw / ip_whitelist.lua
Last active April 2, 2024 10:43 — forked from Ceelog/cloudSettings
Nginx Lua IP Whitelist Rule
-- 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
@itbdw
itbdw / uptime_all.sh
Last active August 29, 2015 14:20
批量查看机器负载
#!/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}"
@itbdw
itbdw / deploy_nginx
Last active August 29, 2015 14:05
nginx_deploy program
#!/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
@itbdw
itbdw / git-config
Last active August 29, 2015 14:01
git config
# 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