Skip to content

Instantly share code, notes, and snippets.

INFO[0000] WARNING: You are running linux kernel version 2.6.32-504.12.2.el6.x86_64, which might be unstable running docker. Please upgrade your kernel to 3.8.0.
#Docker needs 3.8+ Kernel
yum -y install http://www.elrepo.org/elrepo-release-6-5.el6.elrepo.noarch.rpm
yum -y --enablerepo=elrepo-kernel install kernel-ml
#Set new kernel
sed -i 's,default=1,default=0,' /boot/grub/grub.conf
#!/bin/bash
function installVPN(){
echo "begin to install VPN services";
#check wether vps suppot ppp and tun
yum remove -y pptpd ppp
iptables --flush POSTROUTING --table nat
iptables --flush FORWARD
rm -rf /etc/pptpd.conf
@386
386 / getRealIpAddr
Created June 14, 2012 07:03
getRealIpAddr
function getRealIpAddr() {
if (!empty($_SERVER['HTTP_CLIENT_IP'])) { //check ip from share internet
$ip = $_SERVER['HTTP_CLIENT_IP'];
} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { //to check ip is pass from proxy
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
} else {
$ip = $_SERVER['REMOTE_ADDR'];
}
return $ip;
}