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

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;

[TOC]

field
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

[TOC]

FreeBSD SystemTuning

https://www.kernel.org/doc/Documentation/networking/ip-sysctl.txt
https://rolande.wordpress.com/2010/12/30/performance-tuning-the-network-stack-on-mac-osx-10-6/
http://web.archive.org/web/20110611213330/http://macgeekery.com/tips/configuration/mac_os_x_network_tuning_guide_revisited
http://fasterdata.es.net/host-tuning/
http://www.firewall.cx/networking-topics/protocols/tcp/137-tcp-window-size-checksum.html
bufferbloat https://www.bufferbloat.net/projects/bloat/wiki/Introduction/
/proc/sys/net/ipv4/* Variables: https://www.kernel.org/doc/Documentation/networking/ip-sysctl.txt

[TOC]

常用git命令
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
–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

Monokai上图效果:

安装方法:

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

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

curl haoip.cn/simple
$ curl haoip.cn/json

查询域名拥有者 https://whois.icann.org
ip whois (输入验证码) https://www.whois.com/whois/
workaround https://www.whois.com/whois/117.x.y.z
https://ram.console.aliyun.com/settings
就是一个干净的 IP curl ifconfig.me
json curl ipinfo.io
curl myip.ipip.net
pip.net ,免费的 API 每秒五次,每天 1000 次, 最大频率 1.44分钟查询一次
http://members.3322.org/dyndns/getip
http://ip.taobao.com/service/getIpInfo2.php?ip=myip
dig +short myip.opendns.com @resolver1.opendns.com
dig +short myip.opendns.com @resolver1.opendns.com
dig +short @resolver1.opendns.com myip.opendns.com
dig +short myip.opendns.com @resolver2.opendns.com
curl -s ip.appspot.com
curl ipinfo.io/ip
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).

https://golang.org/doc/gdb

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).