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
#drop all indexes in current db that are not primary keys | |
select distinct concat('drop index ', index_name, ' ON ', table_name, ';') | |
from information_schema.statistics | |
where table_schema=DATABASE() | |
and index_name != 'PRIMARY' | |
and column_name like '%_id'; | |
#create indexes | |
select concat('create index idx_',column_name, ' on ', table_name,'(',column_name,');') | |
from information_schema.columns |
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
#!/usr/bin/env ruby | |
require 'logger' | |
require 'rest_client' | |
$stdout.sync = true | |
$stdin.sync = true | |
path = "/var/log/ejabberd/auth.log" | |
file = File.open(path, File::WRONLY | File::APPEND | File::CREAT) |
OlderNewer