Skip to content

Instantly share code, notes, and snippets.

@yamingd
yamingd / gist:8e0a637e84c5c4ca8e84
Last active August 29, 2015 14:04
ios socket links
http://blog.csdn.net/hamasn/article/details/7441786
http://www.raywenderlich.com/3932/networking-tutorial-for-ios-how-to-create-a-socket-based-iphone-app-and-server
http://maniacdev.com/2011/06/tutorial-building-a-simple-ios-tcp-socket-based-app-client-and-server
http://iphonedevsdk.com/forum/iphone-sdk-development/95365-ios-socket-connection-to-java-server.html
http://www.cnblogs.com/jqyp/archive/2012/01/02/2310012.html
@yamingd
yamingd / gist:85a1edae520d7e1cd0ef
Last active August 29, 2015 14:03
服务监控(Zabbix)
http://dl528888.blog.51cto.com/2382721/1346590
http://dl528888.blog.51cto.com/2382721/1357713
模拟测试
http://developer.51cto.com/art/201407/444303.htm
@yamingd
yamingd / gist:6b632c38992a582372b6
Last active May 5, 2018 07:44
java web server jvm common tuning
-Xms initial java heap size
-Xmx maximum java heap size
-Xmn the size of the heap for the young generation
-XX:PermSize: initial value
-XX:MaxPermSize: max value
It is good practice with server-side Java applications to set the minimum -Xms and maximum -Xmx heap sizes to the same value.
For efficient garbage collection, the -Xmn value should be lower than the -Xmx value.
-server
@yamingd
yamingd / txmysql-01.py
Created July 10, 2014 02:35
txMySQL sample
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from twisted.internet import reactor, defer
from twisted.python import log
from txmysql import client
#client.DEBUG = True
@yamingd
yamingd / gist:226b24b3cb42fa50ee6e
Last active August 29, 2015 14:03
Unable to find vcvarsall.bat
1. 首先安装MinGW,在MinGW的安装目录下找到bin的文件夹,找到mingw32-make.exe,复制一份更名为make.exe;
http://sourceforge.net/projects/mingw/files/
2. 把MinGW的路径添加到环境变量path中,比如我把MinGW安装到D:\MinGW\中,就把D:\MinGW\bin添加到path中;
3. 打开命令行窗口,在命令行窗口中进入到要安装代码的目录下;
4. 输入如下命令就可以安装了。
setup.py install build --compiler=mingw32
http://guide.couchdb.org/draft/btree.html
总体而言,一个I/O操作涉及到如下步骤或事件:
1. 应用程序启动一个I/O操作请求(向内核)
2. 内核响应请求,并开始准备数据(系统内存区)
3. 数据准备后,如何通知应用进程?(用户区和系统区如何交互?)
4. 应用进程收到I/O准备好的通知,请求拷贝数据到用户区(数据拷贝)
5. 数据拷贝完成,则I/O操作完成
http://blog.csdn.net/colzer/article/details/8169075
@yamingd
yamingd / uuid_bigint.py
Created July 8, 2014 02:02
分表分库id唯一性
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import time
import random
import sys
from datetime import datetime
_start_ts_ = 1404784741
@yamingd
yamingd / gist:581a023097e312301b83
Last active August 29, 2015 14:03
使用keepalived构建高可用HA
1. MySQL
http://kb.cnblogs.com/page/83944/
2. 基础
http://www.keepalived.org/documentation.html
http://baike.baidu.com/view/4175422.htm
http://www.cnblogs.com/dkblog/archive/2011/07/06/2098949.html
3. HA Proxy MySQL 负载均衡
http://blog.haproxy.com/2012/12/12/haproxy-high-mysql-request-rate-and-tcp-source-port-exhaustion/
@yamingd
yamingd / ThreadDump
Last active August 29, 2015 14:03
JVM线程快照分析
http://blog.csdn.net/a43350860/article/details/8134234
1. 输出JVM线程快照
1) 在Linux下 kill -3 <PID>
ps -ef | grep java 得到<PID>, 也可用jps -v得到<PID>
2) 在windows下 Ctrl - Break
3) 在各个操作系统平台,都可以用 JDK 5.0工具包中的 jstack <pid>
2. 如下是用sudo jstack <pid>产生的一个片段
2014-07-04 10:30:15