general query log

How and When To Enable MySQL Logs
How to enable MySQL logging?

The general query log is a general record of what mysqld is doing. The server writes information to this log when clients connect or disconnect, and it logs each SQL statement received from clients. The general query log can be very useful when you suspect an error in a client and want to know exactly what the client sent to mysqld.

TCP congestion control

tcp_get_info /include/net/tcp.c


jiffies holds the number of times the system timer has popped since the system booted. The kernelincrements the jiffies variable, HZ times every second. Thus, on a kernel with a HZ value of 100, a jiffy is a10-millisecond duration, whereas on a kernel with HZ set to 1000, a jiffy is only 1-millisecond long.
To better understand HZ and jiffies, consider the following code snippet from the IDE driver(drivers/ide/ide.c) that polls disk drives for busy status:
unsigned long timeout = jiffies + (3HZ);
while (hwgroup->busy) {
if (time_after(jiffies, timeout)) {
return -EBUSY;
… */}
return SUCCESS;


http.time HTTP response time you can use the
tcp.analysis.initial_rtt to get the TCP Round trip time
TCP timestamps
http.response and tcp.time_delta>X
For this to work, you need to disable reassembly (so that the first response packet is listed instead of the last packet of the response). This must be done in the TCP protocol preferences too (deselect “allow subdissector to reassemble tcp streams”.
Visualising response time of a web server using Wireshark


FreeBSD SystemTuning
/proc/sys/net/ipv4/* Variables:


differences from branch git log master..branch-X
man gitrevisions
It will display commits in develop which are not in master branch. git log origin/master..origin/develop –oneline –no-merges
If you want to see which files are actually modified use git diff –stat origin/master..origin/develop –no-merges
Do not print commits with more than one parent. This is exactly the same as –max-parents=1.
If you don’t specify arguments it will display the full diff. If you want to see visual diff, install meld on linux, or WinMerge on windows. Make sure they are the default difftools .Then use something like
git difftool -y origin/master..origin/develop –no-merges
In case you want to compare it with current branch. It is more convenient to use HEAD instead of branch name like use:
git fetch git log origin/master..HEAD –oneline –no-merges
git log git log –graph –decorate –stat -p
git log –oneline –graph –all –decorate –abbrev-commit
git log –graph –pretty=format:’%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset’ –abbrev-commit –date=relative master..branch-X
git log –oneline –graph –all –decorateis enough,–abbrev-commitis not required,–onelineis short for–pretty=oneline –abbrev-commit
git config –global log.decorate true
git config –global log.abbrevCommit true

钱少推荐的xcode theme Monokai



$ mkdir -p ~/Library/Developer/Xcode/UserData/FontAndColorThemes/
$ cp Monokai.dvtcolortheme ~/Library/Developer/Xcode/UserData/FontAndColorThemes/

只要 ip 可以 curl -s|grep 当前 IP|awk -F ‘ ‘ ‘{print $2;}’

$ curl

ip whois (输入验证码)
就是一个干净的 IP curl
json curl
curl ,免费的 API 每秒五次,每天 1000 次, 最大频率 1.44分钟查询一次
dig +short
dig +short
dig +short
dig +short
curl -s
CentOS/RHEL/Fedora yum install bind-utils -y
debian/ubuntu apt-get install dnsutils -y
A (the IP address), CNAME ( canonical name) TXT (text record), MX (mail exchanger) and NS (name servers).

When you compile and link your Go programs with the gc toolchain on Linux, Mac OS X, FreeBSD or NetBSD, the resulting binaries contain DWARFv3 debugging information that recent versions (>7.1) of the GDB debugger can use to inspect a live process or a core dump.
Pass the ‘-w’ flag to the linker to omit the debug information (for example, go build -ldflags “-w” prog.go).
The code generated by the gc compiler includes inlining of function invocations and registerization of variables. These optimizations can sometimes make debugging with gdb harder. To disable them when debugging, pass the flags -gcflags “-N -l” to the go command used to build the code being debugged.
If you want to use gdb to inspect a core dump, you can trigger a dump on a program crash, on systems that permit it, by setting GOTRACEBACK=crash in the environment (see the runtime package documentation for more info).