tips – 夏清然的日志 https://www.qingran.net Xia Qingran Geek Blog Sun, 07 Aug 2016 09:50:33 +0000 en-US hourly 1 https://wordpress.org/?v=4.6.1 112893047 获得MySQL/PostgreSQL的内存占用比例的脚本 https://www.qingran.net/2010/05/%e8%8e%b7%e5%be%97mysqlpostgresql%e7%9a%84%e5%86%85%e5%ad%98%e5%8d%a0%e7%94%a8%e6%af%94%e4%be%8b%e7%9a%84%e8%84%9a%e6%9c%ac/ https://www.qingran.net/2010/05/%e8%8e%b7%e5%be%97mysqlpostgresql%e7%9a%84%e5%86%85%e5%ad%98%e5%8d%a0%e7%94%a8%e6%af%94%e4%be%8b%e7%9a%84%e8%84%9a%e6%9c%ac/#comments Mon, 24 May 2010 07:32:31 +0000 https://www.qingran.net/?p=364 获得MySQL/PostgreSQL在GNU/Linux和FreeBSD下的内存占用比例:

GNU/Linux系统

MySQL

ps -o pmem,comm ax  | grep mysql | awk '{SUM+=$1}END{print SUM}'

PostgreSQL

ps -o pmem,comm ax  | grep postgre | awk '{SUM+=$1}END{print SUM}'

FreeBSD系统

MySQL

ps -o pmem,comm -wuax | grep mysql | awk '{SUM+=$1}END{print SUM}'

PostgreSQL

ps -o pmem,comm -wuax | grep postgre | awk '{SUM+=$1}END{print SUM}'

其他进程也可以如法泡制~

]]>
https://www.qingran.net/2010/05/%e8%8e%b7%e5%be%97mysqlpostgresql%e7%9a%84%e5%86%85%e5%ad%98%e5%8d%a0%e7%94%a8%e6%af%94%e4%be%8b%e7%9a%84%e8%84%9a%e6%9c%ac/feed/ 1 364
随机生成网卡MAC地址 https://www.qingran.net/2010/03/%e9%9a%8f%e6%9c%ba%e7%94%9f%e6%88%90%e7%bd%91%e5%8d%a1mac%e5%9c%b0%e5%9d%80/ https://www.qingran.net/2010/03/%e9%9a%8f%e6%9c%ba%e7%94%9f%e6%88%90%e7%bd%91%e5%8d%a1mac%e5%9c%b0%e5%9d%80/#respond Fri, 26 Mar 2010 18:59:48 +0000 https://www.qingran.net/?p=193 #!/bin/sh exec 2>/dev/null dd if=/dev/urandom bs=1 count=6 | od -t x1 \ | awk -F " " '{if($0~/^0000000 /){$1="";print $0;}}' | sed 's/^ //;s/ /:/' ]]> https://www.qingran.net/2010/03/%e9%9a%8f%e6%9c%ba%e7%94%9f%e6%88%90%e7%bd%91%e5%8d%a1mac%e5%9c%b0%e5%9d%80/feed/ 0 193 scp快速回拷文件 https://www.qingran.net/2010/03/scp%e5%bf%ab%e9%80%9f%e5%9b%9e%e6%8b%b7%e6%96%87%e4%bb%b6/ https://www.qingran.net/2010/03/scp%e5%bf%ab%e9%80%9f%e5%9b%9e%e6%8b%b7%e6%96%87%e4%bb%b6/#respond Fri, 26 Mar 2010 06:32:45 +0000 https://www.qingran.net/?p=188 scp快速回拷文件给登录的源主机: scp filename ${SSH_CONNECTION%% *}:~ ]]> https://www.qingran.net/2010/03/scp%e5%bf%ab%e9%80%9f%e5%9b%9e%e6%8b%b7%e6%96%87%e4%bb%b6/feed/ 0 188