Search This Blog

Saturday, July 23, 2011

Lost git after upgrade to Lion

The solution:
sudo ln -s /usr/local/git/bin/git /usr/local/bin/

Saturday, July 16, 2011

php mongo 1.2.1 on Amazon Linux

The src rpm is here:

The i686 (no x64 yet, sorry) rpm is here:

Have fun.

php-fpm for EC2 Amazon Linux

How to get the latest php-fpm on Amazon Linux without hassle.

I needed the latest php-fpm (5.3.6) run on Amazon linux, so I got the Amazon's php source rpm and patched it to include the php-fpm. Here are the steps:

1. Install necessary build packages:
yum install -yy rpm-build gcc make redhat-rpm-config

2.Get the source rpm (will be downloaded to /usr/src/srpm/debug/)
get_reference_source -p php

3. Unpack it
rpm -i /usr/src/srpm/debug/php-5.3.6-1.13.amzn1.src.rpm

4. Install packages required to the build:
yum install -yy bzip2-devel curl-devel db4-devel gmp-devel httpd-devel pam-devel libstdc++-devel openssl-devel sqlite-devel pcre-devel libedit-devel libtool gcc-c++ libevent-devel libtool-ltdl-devel libc-client-devel mysql-devel postgresql-devel unixODBC-devel libxml2-devel net-snmp-devel libxslt-devel libxml2-devel libjpeg-devel libpng-devel freetype-devel libXpm-devel t1lib-devel libmcrypt-devel libtidy-devel freetds-devel aspell-devel libicu-devel

5. Edit the /usr/src/rpm/SPECS/php.spec file and add php-fpm or get mine:

5. Build the RPM (rpmbuild will ask to install
rpmbuild -bs --clean /usr/src/rpm/SPECS/php.spec

You can download the ready-to-build source rpm from here:
Or, even better, ready to install rpm (i686 version for now, sorry):

Have fun.

tmux on Amazon Linux

I need tmux for my daily job and Amazon Linux lacks it, so I compiled mine from the tmux-1.4-3.el5.1.src.rpm. It was required the libevent-1.4.13-1 and not the amazon's one, however. So, I compiled libevent too.




Have fun.

Thursday, January 6, 2011

Haproxy PostgreSQL health check patch

I have written a small patch to enable a correct PostgreSQL health check
It works similar to mysql-check with the very same parameters.

listen pgsql
mode tcp
option pgsql-check user pgsql
server masterdb check inter 10000

The patch has been commited to 1.5 tree.
You can use it against 1.4 tree without any problems.
Moreover, I have submitted the FreeBSD PR to 1.4 port in ports tree as well.

Audit ports in jail on FreeBSD

The modified script to perform a ports security audit in jails on FreeBSD from here .
This script audit only base jails not the cloned ones. You can grab it here.

Do not forget to edit /usr/local/etc/periodic/security/*.portaudit on about line 55
you'll want to change:

echo /usr/local/sbin/portaudit -a |
su -fm "${daily_status_security_portaudit_user:-nobody}" || rc=$?


echo /root/bin/ -a |
su -fm "${daily_status_security_portaudit_user:-nobody}" || rc=$?