Tuesday, October 16, 2007

# Install re2ce
# http://re2c.org/
tar xzf re2c-0.12.3.tar.gz
cd re2c-0.12.3
./configure
make
make install
rm -Rf re2c-0.12.3

# Install libjpeg-devel
yum -y install libjpeg-devel

# Install jpeg.v6b
# http://www.ijg.org/files/
tar xzf jpegsrc.v6b.tar.gz
cd jpeg-6b
cp /usr/share/libtool/config.guess ./
cp /usr/share/libtool/config.sub ./
./configure –enable-shared
make
install -d /usr/local/man/man1
make install
rm -Rf jpeg-6b

# Install libtiff & libtiff-devel
yum -y install libtiff libtiff-devel

# Install libpng
# http://www.libpng.org/pub/png/libpng.html
tar xzf libpng-1.2.22.tar.gz
cd libpng-1.2.22
./configure
make
make install
rm -Rf libpng-1.2.22

# Install Ghostscript (needed for ImageMagick)
yum -y install ghostscript

# Install ImageMagick
yum -y install ImageMagick ImageMagick-devel

pecl install imagick

Friday, September 28, 2007

centos 4,5 mod rewrite enable
# nano /etc/httpd/conf/httpd.conf
FIND SECTION BEGINNING
Options Indexes FollowSymLinks
AND CHANGE
AllowOverride None
TO
AllowOverride All
Order allow,deny
Allow from all
SAVE FILE AND THEN
# service httpd restart

Monday, September 03, 2007

Samba Configuration
/etc/samba/smb.conf
[global]
workgroup = TOPRAKALTI #workgroup name eg: WORKGROUP
server string = uyguLama #server name eg: My Server
; security = user
wins support = yes
username map = /etc/samba/smbusers
; encrypt passwords = yes
; guest ok = no
; guest account = nobody

[www]
comment = www
path = /var/www
writeable = yes
; printable = no
create mask = 0765
; browseable = yes
valid users = adm, root

Create a separate password file for Samba:
cat /etc/passwd | mksmbpasswd.sh > /etc/samba/smbpasswd
Add user:
smbpasswd -a admin

Wednesday, August 08, 2007

php imagick text on image
$image = new Imagick('test.jpg'); //open image file
$draw = new imagickDraw();
$draw->setFont('arial'); //open "/usr/share/fonts/default/TrueType/arial.ttf"
$image->annotateImage ($draw, 10, 10, 1, 'test text'); //write "test text" on image
$image->writeImage('test2.jpg'); //save image file
php Imagick on CENTOS 5
# pear upgrade PEAR
# pear config-set preferred_state beta
# pecl install imagick
error: Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate...
# yum install php-devel
# peardev install pecl/imagick
OK!
# nano /etc/php.ini
add php.ini "extension=imagick.so"
php Imagic example:

contrastImage(1); //contrast image ( 0 or 1 )
$image->sharpenImage(0.5,0); //sharpen image
$image->thumbnailImage(100,100); //creat thumbnail
$image->cropImage(100,100,0,0); //crop image
$image->writeImage('test2.jpg'); // save image
?>
save test.php