Skip to content

Instantly share code, notes, and snippets.

View eagleon's full-sized avatar
🌴
On vacation

eagleon eagleon

🌴
On vacation
View GitHub Profile
@eagleon
eagleon / https改造
Last active September 7, 2016 06:05
https改造:测试环境验证
1. 安装openssl
2. 颁发证书给自己
openssl genrsa -des3 -out server.key 1024 \\用于生成rsa私钥文件
openssl req -new -key server.key -out server.csr \\openssl req 用于生成证书请求
openssl rsa -in server.key -out server_nopwd.key \\利用openssl进行RSA为公钥加密
openssl x509 -req -days 365 -in server.csr -signkey server_nopwd.key -out server.crt
3. 添加nginx证书
server {
@eagleon
eagleon / 实时QPS
Last active September 10, 2019 06:12
实时QPS
某个时刻的实时qps监控:
tail /var/log/nginx/2012-08-25-taobao-access_log -f --pid=19139|grep "`date +%Y:%m:%d:%T`"|wc -l;
统计10秒中的总qps:
tail /var/log/nginx/2012-08-25-taobao-access_log -f -s 10 --pid=19139|wc -l
统计10秒中的平均qps:
echo "`/var/log/nginx/2012-08-25-taobao-access_log -f -s 10 --pid=19139|wc -l`/10"|bc
<link rel="stylesheet" href="https://js.appboycdn.com/web-sdk/1.4/appboy.min.css" />
<script type="text/javascript">
+function(a,p,P,b,y) {
appboy={};for(var s="destroy toggleAppboyLogging setLogger openSession changeUser requestImmediateDataFlush requestFeedRefresh subscribeToFeedUpdates logCardImpressions logCardClick logFeedDisplayed requestInAppMessageRefresh logInAppMessageImpression logInAppMessageClick logInAppMessageButtonClick subscribeToNewInAppMessages removeSubscription removeAllSubscriptions logCustomEvent logPurchase isPushSupported isPushBlocked registerAppboyPushMessages unregisterAppboyPushMessages submitFeedback ab ab.User ab.User.Genders ab.User.NotificationSubscriptionTypes ab.User.prototype.getUserId ab.User.prototype.setFirstName ab.User.prototype.setLastName ab.User.prototype.setEmail ab.User.prototype.setGender ab.User.prototype.setDateOfBirth ab.User.prototype.setCountry ab.User.prototype.setHomeCity ab.User.prototype.setEmailNotificationSubscriptionType ab.User.prototype.setPus
@eagleon
eagleon / openresty-ubuntu-install.sh
Last active June 23, 2016 06:19 — forked from alex-roman/openresty-ubuntu-install.sh
Easy install openresty (used and tested on Ubuntu 14 and 15)
#!/bin/bash
apt-get update
wget http://luajit.org/download/LuaJIT-2.1.0-beta1.tar.gz
tar -xvf LuaJIT-2.1.0-beta1.tar.gz
cd LuaJIT-2.1.0-beta1
make
sudo make install
wget -c https://openresty.org/download/openresty-1.9.7.4.tar.gz
tar zxvf openresty-1.9.7.4.tar.gz
// Generated by gfwlist2pac in precise mode
// https://github.com/clowwindy/gfwlist2pac
var proxy = "__PROXY__";
var rules = [
".lsxszzg.com",
"|http://85.17.73.31/",
"||alien-ufos.com",
"||altrec.com",
@eagleon
eagleon / pac.txt
Created June 17, 2016 09:55
pac.txt
// Generated by gfwlist2pac in precise mode
// https://github.com/clowwindy/gfwlist2pac
var proxy = "__PROXY__";
var rules = [
".lsxszzg.com",
"|http://85.17.73.31/",
"||alien-ufos.com",
"||altrec.com",
@eagleon
eagleon / show_mysql_state.sh
Created June 2, 2016 02:26
mysql实时状态统计shell
#!/bin/bash
mysqladmin -uroot extended-status -i1 |
awk 'BEGIN{local_switch=0;print "QPS Commit Rollback TPS Threads_con Threads_run \n------------------------------------------------------- "}
$2 ~ /Queries$/ {q=$4-lq;lq=$4;}
$2 ~ /Com_commit$/ {c=$4-lc;lc=$4;}
$2 ~ /Com_rollback$/ {r=$4-lr;lr=$4;}
$2 ~ /Threads_connected$/ {tc=$4;}
$2 ~ /Threads_running$/ {tr=$4;
if(local_switch==0){
local_switch=1;
@eagleon
eagleon / shadowsocks.md
Last active May 7, 2016 15:59
shadowsocks step by step

##shadowsocks step by step

###1.install

apt-get install python-pip
pip install shadowsocks

###2.config /etc/shadowsocks.json

@eagleon
eagleon / tomcat.sh
Created April 14, 2016 02:26
Tomcat启动脚本
#!/bin/bash
#
# chkconfig: - 95 15
# description: Tomcat start/stop/status script
#Location of JAVA_HOME (bin files)
export JAVA_HOME=
#Add Java binary files to PATH
export PATH=$JAVA_HOME/bin:$PATH
@eagleon
eagleon / table1.html
Created March 22, 2016 10:34
两个比较清爽的表格
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type="text/css">
.table {
width: 100%;
padding: 0;