how to edit that?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Use tcpdump to monitor mysql | |
| # Capture the packets | |
| sudo tcpdump -i eth0 port 3306 -s 0 -x -n -q -tttt -w tcpdump.out | |
| # analyze all the requests from a given host | |
| pt-query-digest --type=tcpdump --filter '($event->{host} || $event->{ip} || "") =~ m/192.168.248.64/' tcpdump.out |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os, sys, re | |
| def die(s): | |
| print s | |
| sys.exit ( 1 ) | |
| invoice_name = "invoice_" | |
| got_files = [] | |
| cwd = os.getcwd() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| local luasql = nil | |
| local json = require('cjson') | |
| local ENV = nil | |
| local CONN = nil | |
| local CUR = nil | |
| local result = {} | |
| local dbname = 'DB_NAME_HERE' | |
| local dbuser = 'DB_USER_NAME_HERE' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| src/searchdha.cpp | 3 +++ | |
| src/sphinx.cpp | 4 ++-- | |
| src/sphinxstd.cpp | 2 ++ | |
| 3 files changed, 7 insertions(+), 2 deletions(-) | |
| diff --git a/src/searchdha.cpp b/src/searchdha.cpp | |
| index 27bc01e..2af933d 100644 | |
| --- a/src/searchdha.cpp | |
| +++ b/src/searchdha.cpp | |
| @@ -21,6 +21,9 @@ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| src/searchdha.cpp | 3 +++ | |
| src/sphinx.cpp | 4 ++-- | |
| src/sphinxstd.cpp | 2 ++ | |
| 3 files changed, 7 insertions(+), 2 deletions(-) | |
| diff --git a/src/searchdha.cpp b/src/searchdha.cpp | |
| index 27bc01e..2af933d 100644 | |
| --- a/src/searchdha.cpp | |
| +++ b/src/searchdha.cpp | |
| @@ -21,6 +21,9 @@ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mysql_query("SET AUTOCOMMIT=0", $c2) or die("sphinx SET AUTOCOMMIT failed: " . mysql_error($c2)); | |
| mysql_query("TRUNCATE RTINDEX rt", $c2) or die("sphinx TRUNCATE failed: " . mysql_error($c2)); | |
| $r1 = mysql_unbuffered_query("SELECT id, title, UNCOMPRESS(content), CRC32(title) FROM index", $c1) or die("mysql fetch failed: " . mysql_error($c1)); | |
| while (list($id, $title, $content, $gid) = mysql_fetch_row($r1)) | |
| { | |
| $t += strlen($title) + strlen($content); | |
| $title = mysql_real_escape_string($title); | |
| $content = mysql_real_escape_string($content); | |
| mysql_query("INSERT INTO rt (id, title, content, gid) VALUES ($id, '$title', '$content', $gid)", $c2) or die("sphinx insert failed: " . mysql_error($c2)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mysql> CALL SNIPPETS('rock music', 'test_multi', 'rock', 1 AS query_mode); | |
| | <b>rock music</b> | | |
| mysql> CALL SNIPPETS('trial period', 'test_multi', 'rock', 1 AS query_mode); | |
| | trial period | | |
| mysql> CALL SNIPPETS('trial period', 'test_multi', 'test', 1 AS query_mode); | |
| | <b>trial period</b> | | |
| mysql> CALL SNIPPETS('trial period', 'test_multi', 'trial', 1 AS query_mode); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| bool sphWildcardMatch ( const char * sString, const char * sPattern, int iDepth ) | |
| { | |
| if ( !sString || !sPattern || !*sString || !*sPattern ) | |
| return false; | |
| int dTmp [SPH_MAX_WORD_LEN+1][SPH_MAX_WORD_LEN+1]; | |
| const char * s = sString; | |
| const char * p = sPattern; | |
| dTmp[0][0] = 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os, sys, base64, select, socket, struct, datetime, time, traceback | |
| host_all = '127.0.0.1' | |
| port_sql = 0 | |
| port_api = 0 | |
| packet_max_len = 16384 | |
| verbose = 0 | |
| debug = 0 | |
| banner_ql = '--- crashed SphinxQL request dump ---' |