mysql -e “set global innodb_max_dirty_pages_pct = 0;”
mysqladmin ext -i10 | grep dirty
mysql -e “set global innodb_max_dirty_pages_pct = 0;”
mysqladmin ext -i10 | grep dirty
If you have this kind of error:
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
protocol version mismatch — is your shell clean?
(see the rsync man page for an explanation)
rsync error: protocol incompatibility (code 2) at compat.c(171) [sender=3.0.6]
Fix.
vi /root/.bashrc
if [[ $- != *i* ]] ; then
# Shell is non-interactive. Be done now!
return
fi
yum install centos-release-SCL
Ruby 1.9.3 (ruby193)
Python 2.7 (python27)
Python 3.3 (python33)
PHP 5.4 (php54)
Perl 5.16.3 (perl516)
Node.js 0.10 (nodejs010)
MariaDB 5.5 (mariadb55)
MySQL 5.5 (mysql55)
PostgreSQL 9.2 (postgresql92)
h move one character left
j move one row down
k move one row up
l move one character right
w move to beginning of next word
b move to beginning of previous word
e move to end of word
W move to beginning of next word after a whitespace
B move to beginning of previous word before a whitespace
E move to end of word before a whitespace
All the above movements can be preceded by a count; e.g. 4j will move down 4 lines.
0 move to beginning of line
$ move to end of line
^ move to first non-blank char of the line
_ same as above, but can take a count to go to a different line
g_ move to last non-blank char of the line (can also take a count as above)
gg move to first line
G move to last line
nG move to n’th line of file (where n is a number)
H move to top of screen
M move to middle of screen
L move to bottom of screen
z. put the line with the cursor at the center
zt put the line with the cursor at the top
zb put the line with the cursor at the bottom of the screen
Ctrl-D move half-page down
Ctrl-U move half-page up
Ctrl-B page up
Ctrl-F page down
Ctrl-o jump to last cursor position
Ctrl-i jump to next cursor position
n next matching search pattern
N previous matching search pattern
* next word under cursor
# previous word under cursor
g* next matching search pattern under cursor
g# previous matching search pattern under cursor
% jump to matching bracket { } [ ] ( )
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use IO::Socket::INET;
use AnyEvent;
use AnyEvent::Util;
$AnyEvent::Util::MAX_FORKS = 15;
my $handled = 0;
$|++;
my $server = IO::Socket::INET->new(
‘Proto’ => ‘tcp’,
‘LocalAddr’ => ‘localhost’,
‘LocalPort’ => 1234,
‘Listen’ => SOMAXCONN,
‘Reuse’ => 1,
) or die “can’t setup server: $!\n”;
print “Listening on localhost:1234\n”;
my $cv = AnyEvent->condvar;
my $w; $w = AnyEvent->io(
fh => \*{ $server },
poll => ‘r’,
cb => sub {
$handled++;
$cv->begin;
fork_call \&handle_connections,
$server->accept,
sub {
my ($client) = @_ ;
print ” – Client $client closed\n”
}
}
);
$cv->recv;
#
# Subroutines
#
sub handle_connections {
my ($client) = @_;
my $host = $client->peerhost;
print “[Accepted connection from $host]\n”;
print $client “Hi, you’re client #$handled\n”;
chomp ( my $input = <$client> );
my $output = reverse $input;
print $client $output, “\n”;
print $client “Bye, bye.\n”;
$cv->end;
return $host;
}
$reader = new XMLReader();
$reader->XML($data);
while ($reader->read()){
echo $reader->name;
if ($reader->hasValue) {
echo “: ” . $reader->value;
}
}
$reader->close();
SELECT COALESCE((SELECT name FROM users WHERE id = 1), ‘Unavailable’) FROM DUAL;
vi /usr/local/apache/conf/pcre_modsecurity_exceeded_limits.conf
SecPcreMatchLimit 150000
SecPcreMatchLimitRecursion 150000
chmod 600 /usr/local/apache/conf/pcre_modsecurity_exceeded_limits.conf
vi /usr/local/apachec/conf/modsec2.user.conf
in section IfModule mod_security2:
include "/usr/local/apache/conf/pcre_modsecurity_exceeded_limits.conf"
/etc/init.d/httpd restart
Fix.
eval $(ssh-agent)
ssh-add
ssh-add -L
If you have error like:
/etc/cron.hourly/modsecparse.pl:
DBI connect(‘modsec:localhost’,’modsec’,…) failed: Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2) at /etc/cron.hourly/modsecparse.pl line 19
Unable to connect to mysql database at /etc/cron.hourly/modsecparse.pl line 19.
Fix:
less /etc/cron.hourly/modsecparse.pl
mysql;
use mysql;
UPDATE user SET Password=PASSWORD(‘$dbpassword’) WHERE USER=’modsec’;
flush privileges;
exit;
It works:
grep -n ‘Table structure’ full_dump.sql
19:– Table structure for table `t1`
40:– Table structure for table `t2`
61:– Table structure for table `t3`
sed -n ‘40,61 p’ full_dump.sql > t2.sql
Fix:
yum install clamav-devel
stat -c ‘%n %U:%G-%a’ *
vi /root/.bashrc
HISTFILESIZE=
HISTSIZE=
Fix:
rm -f /var/lock/subsys/httpd
service httpd restart