Kerya techblog

Most Read Posts

  • Gentoo mail (postfix + postfixadmin + dovecot + amavisd-new + roundcube)
  • Zabbix - no such instance currently exists at this oid
  • LVM cant Boot - ALERT /dev/mapper/ubuntu--vg-root does not exist DROPPING to Shell -
  • liquidsoap-1.1.1 gentoo install
  • Laravel manual user register
  • Gentoo: php 5.6.0 + pecl-memcached 2.2.0 install script
  • Zabbix APC Smart UPS monitoring on FreeBSD with snmp
  • Squid 3.4 debian 7 install script
  • Подключение Foxgate S6224-S2 Ubuntu minicom
  • Abills
  • exim+dovecot+postfixadmin+clamav+spamassassin on FreeBSD
  • Openmeetings 2.1.1 Ubuntu 12.04.2 installation
  • libtool version mismatch pecl gentoo
  • Securing NTP
  • FreeBSD 9 ossec setup errors fix
  • fix for - corrupted record for package (pkgdep line without argument), ignoring
  • snmpd less verbose log FreeBSD (Connection from UDP messages)
  • Mikrotik no-ip ddns update script
  • Скопировать права mysql gentoo
  • mysql backup scripts
  1. Вы здесь:  
  2. Home
  • Home
  • Все статьи

Mysqldump one table via ssh and gzip

Подробности
Автор: Kirill

mysqldump <source_db> <source_table> | gzip -9 |  ssh <target_server_IP> "gunzip - | mysql <target_db>"

via cron:

*/10 * * * * root mysqldump --defaults-extra-file="/root/.my.cnf" <source_db> <source_table> | gzip -9 |  ssh <target_server_IP> "gunzip - | mysql <target_db>"

example:

mysqldump testdb table1 | gzip -9 |  ssh 192.168.0.1 "gunzip - | mysql testdb2"

Gentoo statistic script

Подробности
Автор: Kirill

in /etc/crontab :

*/3 * * * * root /usr/local/bin/check_la.sh

------------------------------------------

/usr/local/bin/check_la.sh :

if [[ $(uptime | sed -e 's/.*average:\ \(.*\)\..*,.*,.*/\1/') -ge 16 ]]; then

/usr/local/bin/stat.sh > /var/tmp/stat-$(date "+%Y_%d_%m-%H:%M")

fi

-----------------------------------------

/usr/local/bin/stat.sh :

#!/bin/sh

make_stat() {
        echo -e "\n\n\n========================= processes ===================\n"
        ps wwaux
        echo -e "\n\n\n========================= http requests ===================\n"
        links -dump http://localhost/server-status
        echo -e "\n\n\n========================= mysql threads ==================="
        mysql -u root --exec "SHOW FULL PROCESSLIST"
        echo -e "\n\n\n========================= network connections ===================\n"
        netstat -ant
        echo -e "\n\n\n========================= memory ===================\n"
        free
        echo -e "\n\n###############################################\n\n"
}


if [ $(ps aux | grep apache | wc -l) -ge 2 -a  $(ps aux | grep mysql | grep -v grep | wc -l) -ge 0 ] ; then
        outfile=${1:-/dev/stdout}
        cat /dev/null > $outfile
        make_stat >> $outfile
fi

 

redmine upgrade (Ubuntu to Gentoo)

Подробности
Автор: Kirill

Original from http://www.redmine.org/projects/redmine/wiki/RedmineUpgrade

upgrade 1.3.2(Ubuntu) to 2.4.2(Gentoo)

copy distrib redmine to new server and unpack to new folder

do not copy old configs

copy files folder

copy plugins folder

adjust database.yml according to manual

dump db with no parameters

# mysqldump redmine_database --result-file=/root/redmine_database.sql

create new database:

mysql> CREATE DATABASE `redmine_new_db` CHARACTER SET utf8 COLLATE utf8_general_ci;

restore db with no parameters

# mysql redmine_new_db < /root/redmine_database.sql

cd to new redmine folder (/var/lib/redmine)

# rake generate_secret_token

# rake db:migrate RAILS_ENV=production

if got error :

==  CreateChangesetParents: migrating =========================================
-- create_table(:changeset_parents, {:id=>false})
rake aborted!
StandardError: An error has occurred, all later migrations canceled:

Mysql2::Error: Table 'changeset_parents' already exists: CREATE TABLE `changese'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)

do

# mysql -e 'drop table `changeset_parents`' redmine2new

then migration ok

 

 

snmpd less verbose log FreeBSD (Connection from UDP messages)

Подробности
Автор: Kirill

Проблема: В журнале постоянно сообщения вида:

Connection from UDP: [192.168.11.1]:11227->[192.168.11.64]:161
Received SNMP packet(s) from UDP: [192.168.11.1]:11227->[192.168.11.64]:161

Решение: Чтобы они не писались в /etc/rc.conf:

snmpd_flags="-a -LF 0-5 /var/log/snmpd.log"

  1. Zabbix APC Smart UPS monitoring on FreeBSD with snmp
  2. Squid 3.4 debian 7 install script

Страница 12 из 17

  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16

Search

Older Posts

  • Greenbone Vulnerability Manager (GVM) hacks (63)
  • elasticsearch cluster red status fix due to high watermark (61)
  • ubuntu arrow keys misbehaviour fix (72)
  • icinga IIS monitoring powershell error Get-WmiObject : Invalid namespace "root\WebAdministration" (84)
  • Make user superadmin in zabbix (81)
  • dnf Error: unknown option (111)
  • unpack pfx certificate (used for apache or nginx) (116)
  • mysql audit plugin build script (290)
  • mysql dump one row (95)
  • redmine 5 docker-compose (199)
  • gitlab runner dind docker-compose (143)
  • AWS S3 IAM policy to limit to single sub folder (146)
  • logrotate hints (197)
  • bash script to clean files to required percentage (322)
  • Ansible create LVM and mount (732)

Login Form

  • Забыли пароль?
  • Забыли логин?
  • Регистрация