From: http://yueliangdao0608.blog.51cto.com/397025/312602/
mk-query-digest –select Query_time,Lock_time,Rows_sent,Rows_examined –processlist h=localhost,u=root,p=password
use Ctrl+C to stop.
OPTION:
–select
–processlist DSN
From: http://yueliangdao0608.blog.51cto.com/397025/312602/
mk-query-digest –select Query_time,Lock_time,Rows_sent,Rows_examined –processlist h=localhost,u=root,p=password
use Ctrl+C to stop.
OPTION:
–select
–processlist DSN
Maatkit 是 Baron Schwartz 的另一项创造,是一系列命令行工具的集合。所有工具都是用 Perl 编写的,用来补充 MySQL 未能提供的的那些重要功能。可以在 http://www.maatkit.org/ 上找到它们,包括了分析工具和其它一些小功能。
这些分析工具的其中一个是 mk-query-profiler,当它检测服务器状态变量时能够执行查询,并会打印出一个具体且易读的关于查询前后的系统状态变量差异情况的报告。这份报告能使查询有更深的理解,而不仅限于在它执行的时候。
可以将查询通过管道传入 mk-query-profiler 的标准输入口,指定一个或多个查询文件,或者仅仅是要求它检测服务器而不运行任何查询(当运行一个外部应用时,这种方式会用得上)。也能让它运行 shell 命令而不是查询。
mk-query-profiler 的报告分成好几个段落。默认的情况下,这个报告打印出的是一批摘要信息,但是,也可以得到一份包含了每一个查询或者所选择的查询的报告,然后加载到 mk-profile-compact 的辅助工具里方便地进行比较。
以下是这份报告的主要段落:
总而言之,这份报告可以细致地描述出服务器正在处理多少种类型的任务,这比仅仅是衡量查询所需要的时间要有价值得多。例如。可以帮助筛选这样两个查 询:它们在第负载时,在一个小数据集上都用几乎相等的时间完成了查询;但是,当使用到的数据量变到很大的时候,或者说在高负载的时候,它们的表现就有了巨 大的差异。它也可以被用来验证优化是否起到了作用,在这种应用环境下,它就像是一个微型的基准测试工具。
在这个工具里还有另外几种分析工具:
mk-visual-explain
mk-duplicate-key-checker
mk-deadlock-logger
mk-heartbeat
mk-archiver
mk-find
mk-parallel-dump
mk-parallel-restore
mk-show-grants
mk-slave-delay
mk-slave-prefetch
mk-slave-restart
mk-table-checksum
mk-table-sync
check the link: http://www.percona.com/doc/percona-server/5.5/installation.html
1. wget *.d3b
2. dpkg -i *.deb
3. apt-get -f install
http://www.markhansen.co.nz/javascript-optional-parameters/
Import is:
function connect(hostname, port, method) {
hostname = hostname || "localhost";
port = port || 80;
method = method || "GET";
}
The short-circuit OR operator ||
returns the left side if the left argument is truthy (evaluates to true
in conditionals), otherwise it checks if the right argument is truthy, returning it. We can use this shortcut because undefined
is falsy: in conditionals, undefined
evaluates to false
.
This shortcut approach is a very common idiom, but it does have a disadvantage: You can’t use for any argument that could accept a falsy value: false
, 0
, null
, undefined
, the empty string ""
, and NaN
.
Using the ||
shortcut will override any falsy input value. If you expect a falsy value, you must explicitly check for argument === undefined
.
Example: to get system date for n minute ago in format like “26-Aug-2013 11:04” , can write:
date +’%d-%b-%Y %H:%M’ -d ‘1 minute ago’
if [];
then
do sth.
fi
Last week worked my old DWL-810+ Wlan Bridge (cost 60 EUR 6 years ago ) not any more. Yesterday I bought a DIR-615 H1 W-Lan Route for 15 EUR. Today I refresh the firmware with DD-WRT v24 PreSP2 Build 21061and set it as a Repeater-Bridege. It work fine.
Link: http://www.dd-wrt.com/
Firmware: http://www.dd-wrt.com/routerdb/de/download/D-Link/DIR-615/H1/H2/dlink-dir615h-factory-webflash.bin/3974
Wiki about config as Repeater-Bridge: http://www.dd-wrt.com/wiki/index.php/Repeater_Bridge
if you want to sort a colum not with the standard up/ down order, you can use FIND_IN_SET in ORDER BY.
The functzion Find_in_set:
SELECT FROM FIND_IN_SET(“b”, “a,b,c”)
Just return 2, the position where matched.
Use in ODER BY Example:
SELECT * FROM Product
WHERE id IN ( 6,5,4)
ORDER BY FIND_IN_SET(id, “6,5,4”)
function parse_git_branch_and_add_brackets {
git branch –no-color 2> /dev/null | sed -e ‘/^[^*]/d’ -e ‘s/* \(.*\)/\ \[\1\]/’
}
PS1=”\h:\W \u\[\033[0;32m\]\$(parse_git_branch_and_add_brackets) \[\033[0m\]\$ ”
add into .bashrc
first, read the following Link:
http://kubyshkin.ru/posts/phpunit-on-mac-os-x-snow-leopard-10-6.html
Then if you get problem with symfony/YAML version conflict like:
phpunit/PHPUnit requires package “symfony/YAML” (version >= 1.0.2, version <= 1.0.2), installed version is 1.0.6
No valid packages found
install failed
Just uninstall it with:
sudo pear uninstall symfony/YAML
uninstall ok: channel://pear.symfony-project.com/YAML-1.0.6
then install old version like this:
sudo pear install symfony/YAML-1.0.2
downloading YAML-1.0.2.tgz …
Starting to download YAML-1.0.2.tgz (9,299 bytes)
…..done: 9,299 bytes
install ok: channel://pear.symfony-project.com/YAML-1.0.2
Now you can install PHPUnit :
sudo pear install phpunit/PHPUnit
downloading PHPUnit-3.6.12.tgz …
Starting to download PHPUnit-3.6.12.tgz (120,240 bytes)
……………………..done: 120,240 bytes
install ok: channel://pear.phpunit.de/PHPUnit-3.6.12
Now to check phpunit
phpunit –version
PHPUnit 3.6.12 by Sebastian Bergmann.
Done!
I got a old scaner Mediaon MD90092 without Driver CDs for two Euros from “flohmarkt”. The MD90092 is a OEM Product from Microtek Hompage. I need it to run under Mac OS 10.6.8. So I download the scanpotter_1050.dmg (173.4 MB) from Microtek homepage and installed. It works! Great. And the scanner can not work with meine PC with XP. Strange.