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
  • Mikrotik no-ip ddns update script
  • Скопировать права mysql gentoo
  • fix for - corrupted record for package (pkgdep line without argument), ignoring
  • mysql backup scripts
  • snmpd less verbose log FreeBSD (Connection from UDP messages)
  1. Вы здесь:  
  2. Home
  • Home
  • Все статьи

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"

Zabbix APC Smart UPS monitoring on FreeBSD with snmp

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

Создаем такого содержания файл /usr/local/scripts/apcupsd-stats :

#!/usr/local/bin/perl -w
# Copyright (C) 2009  Glen Pitt-Pladdy
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
#
#
#
# See: http://www.pitt-pladdy.com/blog/_20100320-215243_0000_apcupsd_stats_on_Cacti_via_SNMP_/
#


open AC, "/usr/local/sbin/apcaccess status localhost |"
	or die "FATAL: can't run \"/usr/local/sbin/apcaccess\": $!\n";
while ( defined ( $line = <AC> ) ) {
	chomp $line;
	if ( $line !~ /^(\w+)\s*:\s*([^\s]+)/ ) { next; }
	$field{$1} = $2;
}
close AC;


print "$field{LINEV}\n";
print "$field{OUTPUTV}\n";
print "$field{LOTRANS}\n";
print "$field{HITRANS}\n";
print "$field{BATTV}\n";
print "$field{NOMBATTV}\n";
print "$field{BCHARGE}\n";
print "$field{TIMELEFT}\n";
print "$field{LOADPCT}\n";
print "$field{LINEFREQ}\n";
#print "$field{ITEMP}\n";
#print ''.($field{'NOMPOWER'}*$field{'LOADPCT'}/100)."\n";
#print "$field{NOMPOWER}\n";
#if ( $field{'STATUS'} eq 'ONLINE' ) {
#	print "100\n0\n";
#} else {
#	print "0\n100\n";
#}

Некоторые модели не показывают температуру, как, например 420, поӕтому строку с температурой комментируем :-)

#print "$field{ITEMP}\n";

Делаем скрипт исполняемым

Read more: Zabbix APC Smart UPS monitoring on FreeBSD with snmp

Squid 3.4 debian 7 install script

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

#!/bin/bash

version='3.4.7'
prefix='/usr'
#prefix='/usr/local/squid-'${version}

if [ ! -f squid-$version.tar.xz ] ; then
    wget http://www.squid-cache.org/Versions/v3/3.4/squid-$version.tar.xz
fi
if [ ! -d squid-$version ]; then
    tar xvf squid-$version.tar.xz
fi
cd squid-$version
./configure \
  --prefix=${prefix} \
  --localstatedir=/var \
  --srcdir=. \
  --sysconfdir=/etc/squid \
  --with-default-user=proxy \
  --with-logdir=/var/log/squid \
  --with-pidfile=/var/run/squid.pid \
  --libexecdir=${prefix}/lib/squid \
  --datadir=${prefix}/share/squid
make -j 30
make install
chown proxy /var/log/squid

 

  1. Gentoo: php 5.6.0 + pecl-memcached 2.2.0 install script
  2. Nginx redirects

Страница 13 из 18

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

Search

Older Posts

  • zerotier one add more routes (43)
  • modsecurity for nginx compilation scripts for freebsd (430)
  • Greenbone Vulnerability Manager (GVM) hacks (504)
  • elasticsearch cluster red status fix due to high watermark (398)
  • ubuntu arrow keys misbehaviour fix (478)
  • icinga IIS monitoring powershell error Get-WmiObject : Invalid namespace "root\WebAdministration" (475)
  • Make user superadmin in zabbix (524)
  • dnf Error: unknown option (627)
  • unpack pfx certificate (used for apache or nginx) (456)
  • mysql audit plugin build script (749)
  • mysql dump one row (533)
  • redmine 5 docker-compose (700)
  • gitlab runner dind docker-compose (518)
  • AWS S3 IAM policy to limit to single sub folder (464)
  • logrotate hints (628)

Login Form

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