Skip to content

Instantly share code, notes, and snippets.

Foredoomed Foredoomed

  • Shanghai,China
Block or report user

Report or block Foredoomed

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
@Foredoomed
Foredoomed / gcsettings.sh
Last active May 31, 2019 — forked from svanoort/gcsettings.sh
Blessed GC settings for big servers
View gcsettings.sh
#参考:https://github.com/vipshop/vjtools/blob/master/vjstar/src/main/script/jvm-options/jvm-options.sh
# http://calvin1978.blogcn.com/articles/jvmoption-7.html
# Base settings and GC logging
-server
-XX:+AlwaysPreTouch # First should be default, but we make it explicit, second pre-zeroes memory mapped pages on JVM startup -- improves runtime performance
# -Xloggc:gc-%t.log # CUSTOMIZE LOCATION HERE - $path/gc-%t.log -- the %t in the gc log file path is so we get a new file with each JVM restart
-XX:NumberOfGCLogFiles=5 -XX:+UseGCLogFileRotation -XX:GCLogFileSize=20m # Limits the number of files, logs to folder
-XX:+PrintGC -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:+PrintHeapAtGC -XX:+PrintGCCause
View tmux.md

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

# remap prefix to Control + a
View latency.markdown

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns  = 250 µs
View gist:6174703
// XXX should be standard (and named clone, after Java?)
Object.prototype.copy = function () {
let o = {}
for (let i in this)
o[i] = this[i]
return o
}
// Containment testing for arrays and strings that should be coherent with their iterator.
Array.prototype.contains = String.prototype.contains = function (e) {
View gist:5705786
http://docs.jboss.org/jbossas/7/plugins/maven/7.4.Final/examples/deployment-example.html
View 复习
public class LockTest {
private static final String fileName = "C:/work/LockExample.txt";
private static final String EXIT_FLAG = "BYE";
private static final int NO_OF_LINES = 10;
private static final Lock fileLock = new ReentrantLock();
private static final Condition condition = fileLock.newCondition();
private static final ExecutorService executorPool = Executors.newFixedThreadPool(2);
public static void main(String[] args) {
View 书单
美国著名图书频道Book Pool集结最权威的62位作者评选出了最近10年计算机专业图书:
1.Design Patterns: Elements of Reusable Object-Oriented Software
By Erich Gamma, et al
2.The Mythical Man-Month: Anniversary Edition
By Frederick P. Brooks Jr.
3.TCP/IP Illustrated, Volume 1: The Protocols
By W. Richard Stevens
View 记录
方滨兴 230103196007175511
View iehtml
<!--[if IEMobile 7 ]><html class="no-js iem7"><![endif]-->
<!--[if lt IE 9]><html class="no-js lte-ie8"><![endif]-->
<!--[if (gt IE 8)|(gt IEMobile 7)|!(IEMobile)|!(IE)]><!--><html class="no-js" lang="en"><!--<![endif]-->
View ipsec_vpn
非常简单,假设你用的是 debian 或者是番茄花园 debian,
apt-get install racoon
racoon 包必须为 0.8+
配置请不要随便更改,否则可能丧失某平台兼容,测试通过:iOS/OSX、黑莓(OS4/5/6/7),WebOS,诺基亚,VPNC等。
软件安装完毕,修改 /etc/racoon/motd ,这是 VPN 连接成功后的 banner,可有可无;
修改 /etc/racoon/psk.txt ,这是 VPN 连接的 group name 和 group secret,格式很简单, 一行即可,例如
You can’t perform that action at this time.