Skip to content

Instantly share code, notes, and snippets.

mysqladmin -P__port__ -umon -ppass -h127.0.0.1 -r -i 2 extended-status |awk -F "|" 'BEGIN { count=0; } { if($2 ~ /Variable_name/ && ++count%15 == 1){print "----------|---------|--- MySQL Command Status --|----- Innodb row operation -----|-- Buffer Pool Read --"; print "---Time---|---QPS---|select insert update delete| read inserted updated deleted| logical physical";} else if ($2 ~ /Queries/){queries=$3;} else if ($2 ~ /Com_select /){com_select=$3;} else if ($2 ~ /Com_insert /){com_insert=$3;} else if ($2 ~ /Com_update /){com_update=$3;} else if ($2 ~ /Com_delete /){com_delete=$3;} else if ($2 ~ /Innodb_rows_read/){innodb_rows_read=$3;} else if ($2 ~ /Innodb_rows_deleted/){innodb_rows_deleted=$3;} else if ($2 ~ /Innodb_rows_inserted/){innodb_rows_inserted=$3;} else if ($2 ~ /Innodb_rows_updated/){innodb_rows_updated=$3;} else if ($2 ~ /Innodb_buffer_pool_read_requests/){innodb_lor=$3;} else if ($2 ~ /Innodb_buffer_pool_reads/){innodb_phr=$3;} else if ($2 ~ /Uptime / && count >= 2){ printf(" %s |%9d
#!/bin/bash
# =========================
# Add User OSX Command Line
# =========================
# An easy add user script for Max OSX.
# Although I wrote this for 10.7 Lion Server, these commands have been the same since 10.5 Leopard.
# It's pretty simple as it uses and strings together the (rustic and ancient) commands that OSX
# already uses to add users.
@liuyu121
liuyu121 / git-server-mac.md
Last active August 29, 2015 14:02
Set git server on Mac OS x
@liuyu121
liuyu121 / gist:8800afd6bb2b491b2730
Created September 26, 2014 10:34
Get the duihao HAHAHA
data:text/html,&%23x2714
@liuyu121
liuyu121 / gist:48c0b88cc50827335442
Last active August 29, 2015 14:06
wget download all site
wget -r -p -np -k http://golang.org
-r, --recursive specify recursive download.(指定递归下载)
-k, --convert-links make links in downloaded HTML point to local files.
(将下载的HTML页面中的链接转换为本地链接)
-p, --page-requisites get all images, etc. needed to display HTML page.
(下载所有的图片等页面显示所需的内容)
-np, --no-parent don't ascend to the parent directory.
@liuyu121
liuyu121 / gist:aaa6dee39955daf2784a
Created September 26, 2014 10:38
get the Ubuntu version
  • cat /etc/issue
  • sudo lsb_release -a
  • cat /etc/lsb-release
  • cat /proc/version
  • uname -a
  • uname -r
rsync -avr --rsh='ssh -p6666
#!/bin/sh
# Just copy and paste the lines below (all at once, it won't work line by line!)
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY!
function abort {
echo "$1"
exit 1
}
set -e
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static