Sexy CSS buttons

CSS No Comments »

Another CSS lay-out technic for looking default HTML buttons look really slick

View this nice how-to:

http://www.oscaralexander.com/tutorials/how-to-make-sexy-buttons-with-css.html

Checkbox & input CSS lay-out

CSS No Comments »

Found this really cool website on how to lay-out input and checkbox html items

check it out: http://www.chriserwin.com/scripts/crir/index.php

Change system time

Centos, Linux 1 Comment »

I found out that a large part of centos servers were out of sync with the current time.

So I fixed them.

First get the current date and time from a time server:
rdate -s tick.uh.edu

Then type
/sbin/hwclock –systohc

This sets the system time as a ‘permanent’ clock so that the time will be correct next time you reboot.

You can also use NTP (Network Time protocol) but I haven’t looked into (yet).
The NTP uses a network of time server to automatically sync your system time with the time server on a regular base.

Automated PHP API generator

PHP, Software No Comments »

In our new stagging, development environment documentation is essential.

So we want to have all our classes API generated automatically.

This can be done, fairly easy.

For generation of our php API, I choose for phpDocumentor.
Why? Because it’s easy, has a nice web GUI and command line utility and it does it work assupposed.
First lets install phpDocumentor (on a centos system)

sudo pear install phpdocumentor

Next we are going to setup the phpDocumentor.
Our project is located in the following directory.

project: /svn/builds/nameProject/www/

We create a project config file.

config file: /svn/scripts/phpdoc-config.ini

vi /svn/scripts/phpdoc-config.ini

[Parse Data]
title = Documentation nameProject
hidden = false
parseprivate = off
javadocdesc = off
defaultcategoryname = Documentation
defaultpackagename = nameProject
target = /svn/builds/nameProject/doc/
readmeinstallchangelog = README, INSTALL, FAQ, LICENSE, Release-1.3.1
directory = /svn/builds/nameProject/www/
ignore = pear-*,templates/,Documentation/,test*.php
sourcecode = on
output=HTML:Smarty:PHP

Test your configuration
Create the repertory targets

mkdir -p /svn/builds/nameProject/doc/

then launch

phpdoc -c /svn/scripts/phpdoc-config.ini

Check the /svn/builds/nameProject/doc/ directory, if everything is generated.

Next we are going to let our phpDocumentor do it’s work every night.
So I have written a little plain export script and an extend our nightly build subversion script (see http://thim.trinix.be/2007/06/06/nightly-build-script/)

Plain export

vi /svn/scripts/phpdoc-generate.sh

phpdoc -c /svn/scripts/phpdoc-config.ini

Extend Nightly build script

vi /svn/scripts/svn-phpdoc-generate.sh

phpdoc -c /svn/scripts/phpdoc-config.ini

and edit svn-nightly-build.sh

vi /svn/scripts/svn-nightly-build.sh

and add the following just before the # Create archive section

# Remove old documentation
rm -Rf /svn/builds/nameProject/doc/

# Generate documentation
/svn/scripts/svn-phpdoc-generate.sh

The final step is to setup a cron (crontab -e) or add your script to right /etc/cron.* directory (example /etc/cron.daily)

Nightly Build script

Linux, Software, subversion 1 Comment »

We are setting up an complete new development, stagging environment.
And we decided to go with Subversion for Version Control.

And we needed a nightly build export script so I wrote a simple one.

#!/bin/sh
#########################################################################
#
# Implementation of subversion nightly build
#
# Author: Tim Haselaars
# Contact: tim.haselaars@trinix.be
# Date: 6/6/2007
# Version: 1.0
#
#########################################################################

#//////////////////////////////////////////////////////////////////#
# CONFIG SECTION
#//////////////////////////////////////////////////////////////////#

REPO_PATH=”/svn/repos/name”
TEMP_PATH=”/svn/tmp/name”
BUILD_PATH=”/svn/builds/name”

#//////////////////////////////////////////////////////////////////#
# CODE SECTION (do not change)
#//////////////////////////////////////////////////////////////////#
# Show me the current date
date=`date +%Y-%m-%d`

# Create essential directories
if [ ! -d $BUILD_PATH ] # be sure the directory /mnt exists
then
mkdir -pv $BUILD_PATH/{www,tar,zip,log}
fi

if [ ! -d $TEMP_PATH ] # be sure the directory /mnt exists
then
cp -r $REPO_PATH $TEMP_PATH
fi

# Get local snapshot copies revision number
OLD=`svn info file:///$TEMP_PATH | grep -r Revision | cut -f 2 -d ” “`

# Get current development revision number
NEW=`svn info file:///$REPO_PATH | grep -r Revision | cut -f 2 -d ” “`

# Compare for OLD and NEW revision
if [ $NEW -gt $OLD ] ; then

# update local copies
svn update file:///$TEMP_PATH

#Clean old build
rm -Rf $BUILD_PATH/www/

# create another local copies
cp -r file:///$TEMP_PATH $BUILD_PATH/www/

# Recursively remove all .svn directories from folder builds
find $BUILD_PATH/ -name .svn -print0 | xargs -0 rm -rf

# Create archive
tar czf $BUILD_PATH/tar/HIL5-revision-$NEW-$date.tar.gz $BUILD_PATH/www/
zip -r $BUILD_PATH/zip/HIL5-revision-$NEW-$date.zip $BUILD_PATH/www/

# Dumping svn commit log
svn log -v local > $BUILD_PATH/log/CHANGELOG

# Delete folder
#rm -rf

echo “New revision available on $date. Current is Revision $NEW” >> $BUILD_PATH/log/BUILDLOG
else
# If there’s no commit been made
echo “No new revision available on $date. Current is Revision $OLD” >> $BUILD_PATH/log/BUILDLOG
fi

Centos 5 : Install PHP-MSSQL Module / Extension

Centos, Linux, PHP 24 Comments »

As you might have noticed since Centos 5.0, the PHP-MSSQL module / extension isn’t default available in the yum repository. So if you want to use it you can alter the PHP binairy or you can compile an mssql module / extension. In this howto I will explain how to compile the mssql module / extension.You need to activate the RPMForge custom repository (formely known as Dag Wieers)http://dag.wieers.com/rpm/packages/rpmforge-release/Grab your specific RPM and install it.

wget http://dag.wieers.com/rpm/packages/rpmforge-release/rpmforge-release-*.rpmrpm –install rpmforge-release-*.rpm

Next step is to install freetds,freetds-devel, php-devel and the Development tools.

yum groupinstall ‘Development Tools’

yum install freetds freetds-devel –enablerepo=rpmforge
yum install php-devel

next we alter the php.spec file, containing the php configuration for compiling.

vi /usr/src/redhat/SPECS/php.spec

if you can’t find the php.spec file.

You can download the php src rpm.

wget centos.mirrors.skynet.be/pub/centos/5/os/SRPMS/php-5.1.6-5.el5.src.rpmand next

rpm –install php-5.1.6-5.el5.src.rpm

And then do an updatedb and locate php.spec.

edit the CFLAGS= line (~line 310) of the php.spec file – remove ” -Wno-pointer-sign”

add the following piece of code to it.

Group: Development/Languages
Requires: php = %{version}-%{release}, php-pdo
Summary: A module for PHP applications that use the MSSQL database.
provides: php_database
BuildRequires: freetds-devel

%description mssql
The MSSQL package contains a dynamic shared object that will add
support for accessing MSSQL databases to php

Start building your php rpm.

rpmbuild -bb ./php.spec

If has is asking for some dependancies just yum install them

cd /usr/src/redhat/BUILD/php-5.1.6/ext/mssql/

Now we are going to make the mssql module without having to rewrite the php binairy.

phpize
./configure –with-mssql
make
make install

Next look for the mssql.so and make sure it is in the module directory specified in your php.ini.
and copy it to the specified location if needed.

final step

vi /etc/php.ini

add this line to php.ini

extension=mssql.so

save php.ini and restart apache

/etc/init.d/httpd restart

éh voila you have just made your mssql module / extension without having to change anything to the base Centos 5 HTTPD / PHP setup.

PS: I have also posted this howto on http://www.howtoforge.com

Centos 5 : Local yum repository

Centos, Linux 10 Comments »

Sometimes it can be handy to setup your own repository to prevent from downloading the remote repository over and over again.

Create the Directories:

mkdir -pv /var/www/html/centos/{base,updates}

Copy the RPMs from the CDs/DVD to /var/www/html/centos/base

Create the base repository headers:

createrepo /var/www/html/centos/base

Select a rsync mirror for updates:
check out this list of aviable mirrors: Centos OS Mirror list and these are identified with “rsync.” For example: “rsync://ftp.belnet.be/packages/centos/”. The mirrors share a common structure for updates. Simply append /updates/<d version>/<base arch>.

Rsync to create the updates-released repository:

rsync -avrt rsync://ftp.belnet.be/packages/centos/5.0/updates/i386 \ –exclude=debug/ /var/www/html/centos/updates

This will create a complete update repository at /var/www/html/centos/updates/i386. The repodata directory will be created with all of the headers. Next I would advise to setup a cron job to run the rsync (above). In this manner your repository keep updated and only new updates and headers will be downloaded to your repository.

Edit yum.conf:

vi /etc/yum.repos.d/CentOS-Base.repo

[base] name=CentOS-$releasever – Base baseurl=http://192.168.*.*/centos/$releasever/os/$basearch/ #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os #baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/ gpgcheck=1 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5 #released updates [updates] name=CentOS-$releasever – Updates baseurl=http://192.168.*.*/centos/$releasever/updates/$basearch/ #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates #baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/ gpgcheck=1 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

That’s it. Special thanks to http://www.tqmcube.com for the info

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in