Skip to content

Instantly share code, notes, and snippets.

truble shooting of scribe

依赖

  • 整体
    • 这些依赖是必须的,以RHEL/CentOS举例
yum install automake libtool flex bison pkgconfig gcc-c++ libevent-devel
@jarvis657
jarvis657 / 0_reuse_code.js
Created June 28, 2016 06:52
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@jarvis657
jarvis657 / unionClick.js
Created November 21, 2017 03:30
点击防历史回退
(function () {
if (top.location != self.location) {
return false;
}
var tu = unescape(self.location);
if (htmlspecialchars(tu).length != tu.length) {
exit;
}
if (tu && ((tu.indexOf("http://union-click.jd.com/") === 0) || (tu.indexOf("https://union-click.jd.com/") === 0))) {
if (!window.attachEvent) {
@jarvis657
jarvis657 / findJavaTopCpu.sh
Created November 25, 2017 15:00
查找用户java占用最高的线程
typeset top=${1:-10}
typeset pid=${2:-$(pgrep -u $USER java)}
typeset tmp_file=/tmp/java_${pid}_$$.trace
# fix for alibaba-inc.com
export JAVA_HOME=/opt/taobao/java
$JAVA_HOME/bin/jstack $pid > $tmp_file
ps H -eo user,pid,ppid,tid,time,%cpu --sort=%cpu --no-headers\
| tail -$top\
@jarvis657
jarvis657 / logo
Created November 25, 2017 15:02
佛祖保佑
@jarvis657
jarvis657 / find.sh
Created November 25, 2017 15:04
linux
jmap -dump:live,format=b,file=heap-`date +%Y%m%d%H%M`.bin `pgrep -u admin java`
@jarvis657
jarvis657 / showeslap.sh
Created December 5, 2017 03:37
查找程序栈耗时
#!stap
global elapsed_times
global stack_depths_by_tid
probe begin {
printf("%s\n","running ... ")
}
probe end{
printf("%s\n","ending .... ")
@jarvis657
jarvis657 / epoll_et_lt_example.c
Last active November 22, 2019 11:32
epoll的边缘和水平触发例子
/*
*url:http://www.cnblogs.com/yuuyuu/p/5103744.html
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
@jarvis657
jarvis657 / perf-tool.py
Created May 1, 2018 14:55 — forked from brandtg/perf-tool.py
A script that runs Netflix's "Linux Performance Analysis in 60,000 Milliseconds"
#!/usr/bin/env python
#
# A script that runs the commands to perform Netflix's
# "Linux Performance Analysis in 60,000 Milliseconds"
#
# (http://techblog.netflix.com/2015/11/linux-performance-analysis-in-60s.html)
#
import subprocess
import datetime
import argparse
@jarvis657
jarvis657 / find_old_lines.pl
Created May 25, 2020 08:09 — forked from indygreg/find_old_lines.pl
Find oldest lines in git repository
#!/usr/bin/perl
# This script parses Git blame's "porcelain" output format and
# ascertains the oldest lines of code seen.
#
# If you want to perform a custom report, just define your own callback
# function and invoke parse_porcelain() with it.
#
# The expected input format is slightly modified from raw `git blame
# -p`. Here is an example script for producing input: