Skip to content

Instantly share code, notes, and snippets.

View lichengwu's full-sized avatar

Oliver Lee lichengwu

View GitHub Profile
@lichengwu
lichengwu / Crash.java
Created June 2, 2012 15:25
diff Xss & ThreadStackSize
import java.util.concurrent.TimeUnit;
import sun.dc.pr.PathDasher;
public class Crash {
public static void main(String[] args) {
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
/*
* Copyright (c) 2010-2011 lichengwu
* All rights reserved.
*
*/
package oliver.test.sync;
import java.util.concurrent.TimeUnit;
import org.junit.Test;
@lichengwu
lichengwu / view_jvm_commandline_flags
Created July 3, 2012 00:38
about jvm command line flags
#list all changed flags
-XX:+PrintCommandLineFlags
#list all changeable flags and final default values
-XX:+PrintFlagsFinal
#list all changeable flags and initial default values
-XX:+PrintFlagsInitial
eg:
@lichengwu
lichengwu / generic type erased
Created September 14, 2012 05:20
when will generic type be erased
when you declare generic type, you can get it. when you use generic type, it will be erased. eg:
public class Generics {
public <T> T m1(T object){
return object;
}
public void m2(){
List<Integer> list = new ArrayList<Integer>();
list.add(1);
@lichengwu
lichengwu / default.vcl
Created September 28, 2012 00:35
intranet cache config
#This is a basic VCL configuration file for varnish. See the vcl(7)
#man page for details on VCL syntax and semantics.
#
#Default backend definition. Set this to point to your content
#server.
#
backend default {
.host = "hostname1.com";
#.host = "meituan.com";
#.host = "debug.ct.dev.sankuai.com";
@lichengwu
lichengwu / delete.bat
Created November 11, 2012 08:03
win7/win8强制删除文件夹
@echo off
set /p path=path:
set /p user=user:
rem 我们需要修改文件或目录的所有者
takeown /F %path% /R
rem 给用户授权文件夹或文件的完全控制权限
@lichengwu
lichengwu / jvm.cfg
Created December 21, 2012 16:19
my jvm command line options
-server
-Xverify:none
-Xmn512m
-Xms1024m
-Xmx1024m
-Xss1m
-XX:PermSize=256
-XX:MaxPermSize=384m
-XX:+UseG1GC
-XX:MaxGCPauseMillis=300
@lichengwu
lichengwu / G1LogUtil.py
Created December 21, 2012 16:20
Garbage First Log Analyse Util
# coding=utf-8
__author__ = 'lichengwu'
import datetime
import re
'''
Garbage First Log Analyse Util
'''
@lichengwu
lichengwu / DoNotUseBuildInLockTest
Last active December 10, 2015 01:48
JVM's build-in lock is not safe enough, it may cause deadlock while the build-in lock acquired by other threads.
package oliver.test.conurrency;
import java.util.Date;
import java.util.concurrent.TimeUnit;
/**
* do not use build-in lock
*
* if a class use build-in lock ensure concurrence access it's field, thread
* will be blocked by other threads who had acquired the lock.
@lichengwu
lichengwu / meituan.js
Created January 12, 2013 10:43
meituan mail script for x-notifier
/**********************************************************
mail.meituan.com
@author:lichengwu
@created:2013-01-11
@version:1.0
**********************************************************/
var name="Meituan Mail";
var ver="2013-01-11";
function init(){