#!/bin/sh
usage() {
echo "$(basename $0) <on|off>"
}
on() {
echo $1
echo "on*"
}
off() {
echo $2
echo "off*"
}
### main ###
case "$1" in
on)
on on
;;
off)
off not off
;;
*)
usage
;;
esac
slinbody 發表在 痞客邦 留言(0) 人氣(8)
#!/bin/sh
TEST () {
echo -n `date +%Y.%m.%d`" "`date +%H:%M:%S`" "
echo -n `curl 58.258.118.198 --connect-timeout 2 -w '%{response_code}' -so /dev/null`" "
echo -n `curl 58.281.185.187 --connect-timeout 2 -w '%{response_code}' -so /dev/null`" "
echo `curl www.google.com --connect-timeout 2 -w '%{response_code}' -so /dev/null`
}
for i in `seq 1 9`
do
TEST
if [ $i -lt 9 ];then
sleep 5
fi
done
if [ `date +%H:%M` = "23:59" ];then
mv /var/log/Web_Test.log /var/log/Web_Test.log.`date +%Y.%m.%d`
echo " apache nginx urcosme" > /var/log/Web_Test.log
fi
slinbody 發表在 痞客邦 留言(0) 人氣(58)
http://www.nginxtips.com/nginx-location-directive/
http://nginx.org/en/docs/http/server_names.html
http://nginx.com/resources/admin-guide/web-server/
slinbody 發表在 痞客邦 留言(0) 人氣(2)
中文解釋show status;
有一個腳本可以測試效能
http://homeserver.com.tw/2011/04/07/mysql-show-status/
show status和show global status不同
http://dba.stackexchange.com/questions/54337/difference-between-show-status-and-show-global-status-in-mysql
show processlist
http://alvinalexander.com/blog/post/mysql/how-show-open-database-connections-mysql
show global status介紹
http://lxneng.iteye.com/blog/451985
show processlist中有sleep狀態的連線
http://mool.pixnet.net/blog/post/25219480-mysql-processlist-%E4%B8%80%E5%A4%A7%E5%A0%86sleep-
slinbody 發表在 痞客邦 留言(0) 人氣(14)
參考1
參考2
EC2掛上EBS可以直接掛
不用關機.....太酷了
步驟:
1.sudo mkfs.ext4 /dev/xvdf
2.mount /dev/xvdf /mnt
取消的話
#umount /mnt
去EBS下把它detach就可以刪了
slinbody 發表在 痞客邦 留言(0) 人氣(3)
建憑證CA
http://datacenteroverlords.com/2012/03/01/creating-your-own-ssl-certificate-authority/
http://blog.xuite.net/zack_pan/blog/59878236
nginx上設定SSL
https://www.linode.com/docs/security/ssl/ssl-certificates-with-nginx
How To Create a SSL Certificate on nginx for Ubuntu 12.04
https://www.digitalocean.com/community/tutorials/how-to-create-a-ssl-certificate-on-nginx-for-ubuntu-12-04
Common Name[CN]建議使用你的網址
不然瀏覽器會檢查不符而無法瀏覽
slinbody 發表在 痞客邦 留言(0) 人氣(377)
參考AWS CLI安裝
參考Stop instance參考Start instance參考綁Elastic IP
自動化腳本AWS Region List
http://docs.aws.amazon.com/cli/latest/reference/ec2/associate-address.html
#python --version
python版本要大於2.6.3
#wget https://bootstrap.pypa.io/get-pip.py
# sudo python get-pip.py
# pip --help
#sudo pip install awscli
#aws help
#aws configure //設定基本資料
#aws ec2 describe-instances --query 'Reservations[*].Instances[*].[Placement.AvailabilityZone
, State.Name
, InstanceId
,InstanceType
,Platform
,Tags.Value
,State.Code
,Tags.Values]'
slinbody 發表在 痞客邦 留言(0) 人氣(70)
https://github.com/hannob/bashcheck
#!/bin/bash
warn() {
if [ "$scary" == "1" ]; then
echo -e "\033[91mVulnerable to $1\033[39m"
else
echo -e "\033[93mFound non-exploitable $1\033[39m"
fi
}
good() {
echo -e "\033[92mNot vulnerable to $1\033[39m"
}
tmpdir=`mktemp -d -t tmp.XXXXXXXX`
[ -n "$1" ] && bash=$(which $1) || bash=$(which bash)
echo -e "\033[95mTesting $bash ..."
echo $($bash --version | head -n 1)
echo -e "\033[39m"
#r=`a="() { echo x;}" $bash -c a 2>/dev/null`
if [ -n "$(env 'a'="() { echo x;}" $bash -c a 2>/dev/null)" ]; then
echo -e "\033[91mVariable function parser active, maybe vulnerable to unknown parser bugs\033[39m"
scary=1
elif [ -n "$(env 'BASH_FUNC_a%%'="() { echo x;}" $bash -c a 2>/dev/null)" ]; then
echo -e "\033[92mVariable function parser pre/suffixed [%%, upstream], bugs not exploitable\033[39m"
scary=0
elif [ -n "$(env 'BASH_FUNC_a()'="() { echo x;}" $bash -c a 2>/dev/null)" ]; then
echo -e "\033[92mVariable function parser pre/suffixed [(), redhat], bugs not exploitable\033[39m"
scary=0
elif [ -n "$(env 'BASH_FUNC_<a>%%'="() { echo x;}" $bash -c a 2>/dev/null)" ]; then
echo -e "\033[92mVariable function parser pre/suffixed [<..>%%, apple], bugs not exploitable\033[39m"
scary=0
else
echo -e "\033[92mVariable function parser inactive, bugs not exploitable\033[39m"
scary=0
fi
r=`env x="() { :; }; echo x" $bash -c "" 2>/dev/null`
if [ -n "$r" ]; then
warn "CVE-2014-6271 (original shellshock)"
else
good "CVE-2014-6271 (original shellshock)"
fi
cd $tmpdir
env x='() { function a a>\' $bash -c echo 2>/dev/null > /dev/null
if [ -e echo ]; then
warn "CVE-2014-7169 (taviso bug)"
else
good "CVE-2014-7169 (taviso bug)"
fi
$($bash -c "true $(printf '<<EOF %.0s' {1..80})" 2>$tmpdir/bashcheck.tmp)
ret=$?
grep -q AddressSanitizer $tmpdir/bashcheck.tmp
if [ $? == 0 ] || [ $ret == 139 ]; then
warn "CVE-2014-7186 (redir_stack bug)"
else
good "CVE-2014-7186 (redir_stack bug)"
fi
$bash -c "`for i in {1..200}; do echo -n "for x$i in; do :;"; done; for i in {1..200}; do echo -n "done;";done`" 2>/dev/null
if [ $? != 0 ]; then
warn "CVE-2014-7187 (nested loops off by one)"
else
echo -e "\033[96mTest for CVE-2014-7187 not reliable without address sanitizer\033[39m"
fi
$($bash -c "f(){ x(){ _;};x(){ _;}<<a;}" 2>/dev/null)
if [ $? != 0 ]; then
warn "CVE-2014-6277 (lcamtuf bug #1)"
else
good "CVE-2014-6277 (lcamtuf bug #1)"
fi
if [ -n "$(env x='() { _;}>_[$($())] { echo x;}' $bash -c : 2>/dev/null)" ]; then
warn "CVE-2014-6278 (lcamtuf bug #2)"
elif [ -n "$(env BASH_FUNC_x%%='() { _;}>_[$($())] { echo x;}' $bash -c : 2>/dev/null)" ]; then
warn "CVE-2014-6278 (lcamtuf bug #2)"
elif [ -n "$(env 'BASH_FUNC_x()'='() { _;}>_[$($())] { echo x;}' $bash -c : 2>/dev/null)" ]; then
warn "CVE-2014-6278 (lcamtuf bug #2)"
else
good "CVE-2014-6278 (lcamtuf bug #2)"
fi
rm -rf $tmpdir
slinbody 發表在 痞客邦 留言(0) 人氣(42)
http://blog.cloudlytics.com/decoding-elb-log-entries/
slinbody 發表在 痞客邦 留言(0) 人氣(28)
http://www.howtoforge.com/installing-powerdns-with-mysql-backend-and-poweradmin-on-debian-squeeze
poweradmin
https://github.com/poweradmin/poweradmin/wiki/Installation
http://www.poweradmin.org/
slinbody 發表在 痞客邦 留言(0) 人氣(4)