Skip to content

Instantly share code, notes, and snippets.


von gosling vongosling

Block or report user

Report or block vongosling

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:6944652
Love brevity and simplicity
vongosling / gist:8970307
Last active Aug 29, 2015
Eclipse ADT FAQ:
View gist:8970307

Ubuntu 12.04.4,Kernel 3.5.0-45-generic

Problem 1:

Failed to start emulator: Cannot run program "/usr/bin/android-studio/sdk/tools/emulator": error=2


sudo apt-get install libc6-i386 lib32stdc++6 lib32gcc1 lib32ncurses5

Problem 2:

/android-4.4/aapt: error while loading shared libraries: cannot open shared object file: No such file or directory


vongosling / gist:8970351
Created Feb 13, 2014
Best practice - Httpclient 4.1
View gist:8970351
* 史上最棒的HttpClient4封装,details please see
* @author von gosling 2013-5-7
public class HttpClientManager {
//Consider ulimit
private static final int DEFAULT_MAX_TOTAL_CONNECTIONS = 7500;
vongosling / gist:9461205
Created Mar 10, 2014
vongosling / gist:9661145
Last active Aug 29, 2015
Performance analyzer v1.1.0
View gist:9661145
import java.lang.reflect.Method;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.concurrent.Callable;
import java.util.concurrent.CompletionService;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorCompletionService;
import java.util.concurrent.ExecutorService;
vongosling / gist:9929680
Last active Feb 4, 2020
Performance Tuning
View gist:9929680


Three system configuration parameters must be set to support a large number of open files and TCP connections with large bursts of messages. Changes can be made using the /etc/rc.d/rc.local or /etc/sysctl.conf script to preserve changes after reboot.

1. /proc/sys/fs/file-max: The maximum number of concurrently open files.

fs.file-max = 1000000

2. /proc/sys/net/ipv4/tcp_max_syn_backlog: Maximum number of remembered connection requests, which are still did not receive an acknowledgment from connecting client. The default value is 1024 for systems with more than 128Mb of memory, and 128 for low memory machines.

net.ipv4.tcp_max_syn_backlog = 3240000

3. /proc/sys/net/core/somaxconn: Limit of socket listen() backlog, known in userspace as SOMAXCONN. Defaults to 128.

net.core.somaxconn = 3240000
vongosling / gist:10353488
Created Apr 10, 2014
High performance Hessian Serialization and Derialization
View gist:10353488
vongosling / gist:11020739
Created Apr 18, 2014
Feeds system Result List based cursor theory
View gist:11020739
* Result List based cursor theory
* @author vongosling
* @param <T>
public class ResultCursorList<T> extends BaseDo {
private static final long serialVersionUID = -6593448580923210640L;
You can’t perform that action at this time.