среда, 14 декабря 2011 г.

Обновление Cyrus 2.1 на 2.2

После апгрейда убунты на 10,04 перестал запускаться cyrus. Вылитает ошибка:
/etc/init.d/cyrus2.2: Database backends mismatch! You must manually
/etc/init.d/cyrus2.2: verify and update the Cyrus databases to the
/etc/init.d/cyrus2.2: new backends.
/etc/init.d/cyrus2.2: Please refer to /usr/share/doc/cyrus-common-2.2/README.Debian
/etc/init.d/cyrus2.2: for instructions.
Лекарство:
# делаем бекап системных файлов
cd /var/lib
tar cfvz cyrus-backup.tgz cyrus
# при необходимости бекап почтовых ящиков
tar cfvz cyrus-spool-backup.tgz /var/spool/cyrus

#
rm /usr/lib/cyrus/cyrus-db-types.active
sudo chown -R cyrus:mail /var/lib/cyrus
dpkg-reconfigure cyrus-common-2.2

пятница, 2 декабря 2011 г.

Doctrine Versionable: получить все версии объекта

Процесс создания модели у которой ведётся сохрание изменений
http://www.doctrine-project.org/documentation/manual/1_0/en/behaviors#core-behaviors:versionable

там описана возможность получить текущую версию объекта
$blogPost->version;

и откатить изменения при помощи метода

$blogPost->revert(1);
Чтобы получить все версии $blogPost:
$blogPost->getVersion()

пятница, 25 ноября 2011 г.

UTF 8 and my.cnf

Settings for mysql that will help ensure Unicode top to bottom.

[mysqld]
default-character-set=utf8
default-collation=utf8_general_ci
character-set-server=utf8
collation-server=utf8_general_ci
init-connect='SET NAMES utf8'

[client]
default-character-set=utf8

вторник, 22 ноября 2011 г.

Ubuntu/Debian downgrade php5.3 to 5.2

Делаю downgrade в Lucid только для следующих пакетов в версии из репозитария Hardy

vim /etc/apt/preferences.d/php5-pin

Package: php5-cgi
Pin: release a=hardy
Pin-Priority: 1001

Package: libapache2-mod-php5
Pin: release a=hardy
Pin-Priority: 1001

Package: php5-common
Pin: release a=hardy
Pin-Priority: 1001

Package: php5-cli
Pin: release a=hardy
Pin-Priority: 1001

Package: php-auth
Pin: release a=hardy
Pin-Priority: 1001

Package: php-pear
Pin: release a=hardy
Pin-Priority: 1001

Package: php5-curl
Pin: release a=hardy
Pin-Priority: 1001

Package: php5-dev
Pin: release a=hardy
Pin-Priority: 1001

Package: php5-gd
Pin: release a=hardy
Pin-Priority: 1001

Package: php5-imagick
Pin: release a=hardy
Pin-Priority: 1001

Package: php5-imap
Pin: release a=hardy
Pin-Priority: 1001

Package: php5-mcrypt
Pin: release a=hardy
Pin-Priority: 1001

Package: php5-mysql
Pin: release a=hardy
Pin-Priority: 1001

Package: php5-sqlite
Pin: release a=hardy
Pin-Priority: 1001

Package: php5-tidy
Pin: release a=hardy
Pin-Priority: 1001

Package: php5-xmlrpc
Pin: release a=hardy
Pin-Priority: 1001

Package: php5-xsl
Pin: release a=hardy
Pin-Priority: 1001

aptitude install php5-cgi php-auth php-pear php5-cli php5-curl php5-dev php5-gd php5-imagick php5-imap php5-mcrypt php5-mysql php5-sqlite php5-tidy php5-xmlrpc php5-xsl

пятница, 18 ноября 2011 г.

Phpfarm custom.sh

aptitude install libxml2-dev libjpeg8-dev libcurl4-openssl-dev libpng-dev libfreetype6-dev libmcrypt-dev libmhash-dev libxslt-dev

mkdir -m 0755 /usr/local/php
git clone git://git.code.sf.net/p/phpfarm/code phpfarm

cd phpfarm/src

vim custom-options-5.2.17.sh
### 
configoptions="
            --enable-cli \
            --with-pear \
            --with-openssl=/usr \
            --with-iconv \
            --with-curl \
            --with-mysql \
            --with-mysqli \
            --enable-mbstring \
            --with-zlib \
            --with-zlib-dir \
            --with-gettext \
            --with-mhash \
            --enable-ftp \
            --with-mcrypt \
            --enable-bcmath \
            --with-mime-magic \
            --with-pdo-mysql \
            --enable-sockets \
            --enable-soap \
            --enable-fastcgi \
            --enable-force-cgi-redirect \
            --with-xsl \
--with-gd \
--enable-gd-native-ttf \
--with-ttf \
--with-png-dir \
--with-jpeg-dir \
--with-freetype-dir \

    "
#
#           --with-gd \
#            --with-gd=/usr/lib/php5/20090626 \
#--with-png-dir \
#--with-jpeg-dir \
#            --enable-gd-native-ttf \
#            --with-pspell \
#            --enable-exif \


четверг, 15 сентября 2011 г.

Как сохранять нужное кол-во Proxmox vzdump бекапов ?

в /etc/vzdump.conf
добавить строчку
maxfiles: N
N - необходимое кол-во

больше о vzdump.conf можно узнать в man vzdump