Skip to content

Instantly share code, notes, and snippets.

@rednaxelafx
rednaxelafx / PrintThreadIds.java
Created February 25, 2011 10:31
find out the correspondence between the tid/nid of Java threads as shown from jstack/JMX, on HotSpot/Linux
package fx.jvm.hotspot.tools;
import java.util.List;
import sun.jvm.hotspot.tools.Tool;
public class PrintThreadIds extends Tool {
public static void main(String[] args) {
PrintThreadIds tool = new PrintThreadIds();
tool.start(args);
@rednaxelafx
rednaxelafx / TraceSystemGCCall.java
Created March 8, 2012 13:15
BTrace script to log System.gc() calls
import com.sun.btrace.annotations.*;
import static com.sun.btrace.BTraceUtils.*;
@BTrace
public class TraceSystemGCCall {
@OnMethod(
clazz="/.*/",
method="/.*/",
location=@Location(
value=Kind.CALL,
@melin
melin / btrace.txt
Created November 21, 2014 01:06
btrace script
/* BTrace Script Template */
import com.sun.btrace.annotations.*;
import static com.sun.btrace.BTraceUtils.*;
import java.lang.reflect.Field;
@BTrace
public class TracingScript {
/*
* 获取方参数、返回值信息;获取方法调用时间
@fearblackcat
fearblackcat / proxy_for_terminal.md
Last active June 27, 2024 08:17
Set proxy for terminal on mac

Shadowsocks Proxy

apt-get install python-pip
pip install shadowsocks

sudo ssserver -p 443 -k password -m aes-256-cfb --user nobody -d start
@newsworthy39
newsworthy39 / wg-quick.service
Last active March 24, 2024 19:40
wq-quick systemd unit files
# This file is largely based on the tinc@ service-idea.
# Both files belong in /lib/systemd/system/
# Enable it, systemctl enable wg-quick, then enable configurations (ie, /etc/wireguard/wg0.conf)
# systemctl enable wg-quick@wg0
[Unit]
Description=Wireguard VPN
After=network-online.target
Wants=network-online.target