Archive for the ‘unimportant’ Category.

extracting single database from a [large] mysqldump

extracting the whole database:

sed -n '/^-- Current Database: `databaseName`/,/^-- Current Database: `/p' /path/to/the/fill/dump.sql  > output.sql

single table:

sed -n '/^CREATE TABLE `MyTable`/,/^DROP TABLE /p' test.sql

[via this blog]

new sphinx, new connector/j headaches

sphinx 2.0.3 is out; and as new drama of getting mysql’s connector/j begins. i did not figure out [yet] any way of making both work using the latest 5.1.18 connector, but at least i’ve managed to convince one that i use now [ 5.1.15 ] to work with sphinx.

what works:
mysql-connector-java-5.1.13-bin.jar

"jdbc:mysql://host:9306/test1?socketTimeout=2000&connectTimeout=200&characterEncoding=utf8&maxAllowedPacket=512000"
// this also comes handy: enablePacketDebug=true&traceProtocol=true&logger=com.mysql.jdbc.log.StandardLogger

but.. only if you modify src/searchd.cpp and change sHandshake2[]

..
"\x08\x82" // server capabilities; CLIENT_PROTOCOL_41 | CLIENT_CONNECT_WITH_DB | SECURE_CONNECTION
..

into

..
"\x08\x02" // server capabilities; CLIENT_PROTOCOL_41 | CLIENT_CONNECT_WITH_DB | SECURE_CONNECTION
..

to sum-up: kill me down.

bug report in the sphinx issue tracking system: #959.

edit: it seems that adding mysql_version_string = 5.0.37 in the sphinx.conf should sort things out. i’ll have a chance to test it in a few weeks of time. edit. no – that does not work; at least not with connector/j 5.1.5.

final edit[?] it seems that this commit fixes the problem with connector/j 5.1.18 ; sphinx from trunk – r3119 with “mysql_version_string = 5.0.37″ in the sphinx.conf works fine with latest connector/j, requires “jdbc:mysql://host:9306/data?characterEncoding=utf8&maxAllowedPacket=512000″ connection string; unfortunately this fix was not included in 2.0.4 although ‘fresh’ ; trunk version r3143 – seems to work fine.

excluding some mysql queries from the slow query log

i keep close eye on the mysql-slow.log log of queries that take more than 1s to execute. but at the same time i know about few house-keeping queries that are executed few times per day that by design take longer to execute [eg table checksums]. i don’t want those queries to ‘pollute’ the slow query log.

one approach was to ‘chop’ the heavy/planned queries into smaller ones; another – to temporarily disable slow query logging or change the minimum duration threshold needed for queries to enter mysql-slow.log. 2nd one sounded more reasonable; solution:

SET @@session.long_query_time = 3;

.. actual query;

SET @@session.long_query_time=@@global.long_query_time;

[inspired by this post]

ossec-syscheckd(1702): INFO: No directory provided for syscheck to monitor; Segmentation fault

i’m playing around with ossec 2.6. i’m trying to set up server for agentless monitoring of multiple linux boxes.

after installation [where i answered no for most of the question] i’ve run into the following problem:

pQd-ossec:/usr/src/ossec-hids-2.6# /opt/ossec/bin/ossec-control start
Starting OSSEC HIDS v2.6 (by Trend Micro Inc.)...
OSSEC analysisd: Testing rules failed. Configuration error. Exiting.
Started ossec-maild...
Started ossec-execd...
Started ossec-analysisd...
Started ossec-logcollector...
Started ossec-remoted...
2011/12/28 16:39:57 ossec-syscheckd(1702): INFO: No directory provided for syscheck to monitor.
Segmentation fault

to make things work and not segfault on config generated by the installer i had to modify /opt/ossec/etc/ossec.conf and add:

  <syscheck>
      <directories check_all="yes">/etc</directories>
  </syscheck>

rsync: connection unexpectedly closed (0 bytes received so far) [sender]

i use rsync to transfer my backups around. to better utilize available bandwidth i run multiple rsyncs in parallel… but from time to time i’ve noticed failures that on the client side.
Continue reading ‘rsync: connection unexpectedly closed (0 bytes received so far) [sender]’ »

ilo

i take care of one HP server with ILO remote access card. but recently i started having problems with using web applet to connect to it.
Continue reading ‘ilo’ »

Canon IR C2550 & Canon IR C4580 – Could not verify the ID and password specified in Job Accounting

maybe it’ll save someone a bit of time.

problem: there is group of people running windows xp and using over the network two canon printers IR c2550 and ur c4850. they dont use central windows printer spooler – they send print jobs directly to the printer. suddenly one user reports that she cannot print from one specific [our...] application.

this program is slightly ‘different’ than most windows applications – pure .net/wpf based app. i dont know if it’s relevant or not; anyway – that user can print from word, notepad etc, but any attempt to print from ‘our’ application ends up with error dialog:

Could not verify the ID and password specified in Job Accounting. Printing will be canceled. Make sure that your computer is connected to the device correctly or the device is turned on

while other users running same up, under similar xp dont have that problem.

solution – everyone was using ancient drivers 2.2 from 2007 ; downloading and installing new urf II drivers [ UFRII_v2.70_Setup.exe from here ] in version 2.70 from 2010 solved the problem.