one-line-commands
1、OS
ubuntu version check
cat /etc/os-release
centos version check
cat /etc/centos-release
os kernel version
uname -a
2、Database
mysql login
mysql -h{MYSQL_HOST} -P{MYSQL_PORT} -u{MYSQL_USERNAME} -p{MYSQL_PASSWORD}
mysql tcpdump
tcpdump -s 0 -l -w - host {mysql_host_ip} and port {mysql_port} | strings
Influxdb database list
curl -s -XPOST 'http://{INFLUXDB_HOST}:{INFLUXDB_PORT}/query?u={INFLUXDB_USERNAME}&p={INFLUXDB_PASSWORD}' --data-urlencode 'q=SHOW DATABASES' | jq
3、TCP
tcp port listener process
lsof -nP -sTCP:LISTEN -iTCP:{PORT}
process listen ports
lsof -a -i -n -P -sTCP:LISTEN -p {PID}
4、HTTP
tcpdump http traffics
tcpdump -A -s 0 'host {HTTP_HOST} and tcp port {HTTP_PORT} and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)'
5、Java
find java process
jps -mlv
maven dependency tree
mvn --settings ~/.m2/settings.xml dependency:tree
maven dependency of a package
mvn dependency:tree -Dincludes=io.dropwizard.metrics:metrics-jetty9
6、Clojure
dump dependencies
lein deps :tree
generate pom.xml
lein pom
7、Android
从电脑上传文件到Android手机
adb push /PC/path/image.png /sdcard/Pictures/ # 图库 - 相册 - 其它相册
adb push /PC/path/image.png /sdcard/DCIM/ # 图库 - 照相机