Skip to content

Instantly share code, notes, and snippets.

@kevintop
kevintop / busythread.sh
Created June 8, 2016 07:08
在linux环境找到最耗费cpu的Java应用的线程堆栈
#!/bin/bash
if [ $# -eq 0 ];then
echo "please enter java pid"
exit -1
fi
pid=$1
jstack_cmd=""
@kevintop
kevintop / 查看占用cpu时间高的线程
Created June 8, 2016 07:07 — forked from zxkletters/查看占用cpu时间高的线程
查看jvm进程中占用cpu时间高的线程方法
1. jps或top 获取java的进程id
2. top -H -p java进程id ,可以看到各个线程占用的CPU时间
3. 找出占用CPU时间最高的线程PID, python -c "print hex(线程PID)" ,获取线程ID的16进制表示
4. jstack java进程id | less 根据16进制的线程ID查找具体线程的执行情况
@kevintop
kevintop / rush-mi.js
Last active December 24, 2015 01:39
(function() {
var interval = 50;
var goBuyF = window.setInterval("goBuy()", interval);
var rebackF = window.setInterval("reback()", interval);
this.goBuy = function() {
var buyNextBtn = document.getElementById('buyNext');
if (buyNextBtn) {
buyNextBtn.click();
window.clearInterval(goBuyF)
}
@kevintop
kevintop / buy.js
Last active December 23, 2015 17:09
(function(){
if (!window.ed10010) {
$('#buyForm').submit(function(event){
var price = parseFloat($('.lineThrough').text().substring(1));
if (isNaN(price)) {
window.alert('找不到原价,刷新页面后重试');
window.location.reload();
return false;
}
@kevintop
kevintop / 12306AutoSubmit.user.js
Created January 8, 2012 08:11
12306 Auto Submit
/*
12306 Auto Submit => A javascript snippet to help you auto submit.
Copyright (C) 2011 Kevintop
Includes jQuery
Copyright 2011, John Resig
Dual licensed under the MIT or GPL Version 2 licenses.
http://jquery.org/license
Includes 12306.user.js
@kevintop
kevintop / 12306AutoLogin.user.js
Created January 6, 2012 15:05
12306 Auto Login
/*
12306 Auto Login => A javascript snippet to help you auto login 12306.com.
Copyright (C) 2011 Kevintop
Includes jQuery
Copyright 2011, John Resig
Dual licensed under the MIT or GPL Version 2 licenses.
http://jquery.org/license
Includes 12306.user.js