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
apt update | |
#开启bbr | |
modprobe tcp_bbr | |
echo "tcp_bbr" >> /etc/modules-load.d/modules.conf | |
echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf | |
echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf | |
sysctl -p | |
#安装必要软件 |
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
<?php | |
function get_data($url) | |
{ | |
$ch = curl_init(); | |
$timeout = 10; | |
curl_setopt($ch, CURLOPT_URL, $url); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); | |
$data = curl_exec($ch); | |
curl_close($ch); |
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
[ius] | |
name=IUS Community Packages for Enterprise Linux 7 - $basearch | |
baseurl=https://mirrors.tuna.tsinghua.edu.cn/ius/stable/CentOS/7/$basearch | |
failovermethod=priority | |
enabled=1 | |
gpgcheck=1 | |
gpgkey=file:///etc/pki/rpm-gpg/IUS-COMMUNITY-GPG-KEY | |
[ius-debuginfo] | |
name=IUS Community Packages for Enterprise Linux 7 - $basearch - Debug |
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
upstream tunnel { | |
server 127.0.0.1:3000; | |
} | |
server { | |
listen 80; | |
server_name dev.codeplane.com br.dev.codeplane.com; | |
location / { | |
proxy_set_header X-Real-IP $remote_addr; |
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
//xml to array | |
$resultXml = new SimpleXMLElement($result); | |
if (!$resultXml) | |
return ['status' => false, 'msg' => '微信支付订单生成出错']; | |
$resultArr = []; | |
foreach ($resultXml as $key => $value) { | |
$resultArr[$key] = strval($value); | |
} | |
/** |
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
### Editing ### | |
`Ctrl + Space` 基本代码完成(任意类的,方法的或者变量的名称) | |
`Ctrl + Shift + Enter` 补全当前语句 | |
`Ctrl + P` Parameter info (within method call arguments) | |
`Ctrl + Q` 快速查找文档 | |
`Ctrl + 鼠标滑过` 简明信息查看 | |
`Ctrl + F1` 在插入符号处显示错误或者警告信息 | |
`Alt + Insert` 生成代码...(Getters,Setters,Constructors) | |
`Ctrl + O` 重写方法 | |
`Ctrl + 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
http://d.stavrovski.net/blog/post/how-to-install-and-setup-oracle-java-jdk-in-centos-6 | |
# rpm | |
wget --no-cookies \ | |
--no-check-certificate \ | |
--header "Cookie: oraclelicense=accept-securebackup-cookie" \ | |
"http://download.oracle.com/otn-pub/java/jdk/7u55-b13/jdk-7u55-linux-x64.rpm" \ | |
-O jdk-7-linux-x64.rpm | |
# ubuntu |
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
openlog('php program', LOG_PID, LOG_USER); | |
syslog(LOG_ERR, "This is a test: " . memory_get_usage(true)); |
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
class Redis | |
{ | |
const CONFIG_FILE = '/config/redis.php'; | |
protected static $redis; | |
public static function init() | |
{ | |
self::$redis = new Client(require BASE_PATH . self::CONFIG_FILE); | |
} |
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
/* | |
demo | |
today = new Date(); | |
var dateString = today.format("dd-m-yy"); | |
alert(dateString); | |
source http://jsfiddle.net/phZr7/1/ | |
* Date Format 1.2.3 | |
* (c) 2007-2009 Steven Levithan <stevenlevithan.com> |