Monthly Archives: December 2010

PCRE unicode support CENTOS

Centos PCRE repo is 6.6, and cannot be YUM REMOVED without removing hundred of dependancies…

I needed to install PCRE with unicode support which meant compiling my own package.

First you need to install all the correct libs


yum install gcc-c++

then download latest pcre from

http://www.pcre.org/

unpack and configure


./configure --prefix=/usr
--docdir=/usr/share/doc/pcre-8.10
--enable-utf8
--enable-unicode-properties


make


make check


make install

the libraries will be installed to /usr/lib and you will need to add a new path for your DSO loader create a file called pcre.conf in the directory


/etc/ld.so.conf.d

and insert the path


/usr/lib

save and close and update the cache by running


ldconfig

restart your web server and check phpinfo that your PCRE module has been updated to 8.11 (or latest).

Logrotate

Rotating your log files will save you a bunch of space from bloated web logs growing out of control. Logrotate is easily customisable to suit any needs.

To force logrotate to rotate out of schedule use the f flag, and to make it output to screen, use V for verbose ie.

Below is an excerpt for Logrotate configured with lighttpd. you will need to reload your specific web server with its own reload command.

IndexPath Row from sub-function

Ever wondered how you could generate the IndexPath row from a Function not related to tableview?

UITableViewCell *clickedCell = (UITableViewCell *)[[sender superview] superview];
NSIndexPath *clickedButtonPath = [_tableView indexPathForCell:clickedCell];
int row = [clickedButtonPath row];
NSLog(@"%i",row);