Install node.js and npm quickly

node.js

go on nodejs.org
download source

tar -xvzf node-v0.6.15.tar.gz
cd node node-v0.6.15/
./configure
make
make test
make doc
sudo make install

npm

wget http://npmjs.org/install.sh
sudo bash install.sh
 
tar=/bin/tar
version:
tar (GNU tar) 1.25
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
 
Written by John Gilmore and Jay Fenlason.
install npm@1.1
fetching: http://registry.npmjs.org/npm/-/npm-1.1.18.tgz
0.6.15
1.1.18
cleanup prefix=/usr/local
 
All clean!
/usr/local/bin/npm -> /usr/local/lib/node_modules/npm/bin/npm-cli.js
npm@1.1.18 /usr/local/lib/node_modules/npm
It worked
npm install socket.io

jenkins for php project

read http://jenkins-php.org/

aptitude install jenkins
#!/bin/bash
host="http://jenkins.domain.tld:8080"
 
wget $host/jnlpJars/jenkins-cli.jar
java -jar jenkins-cli.jar -s $host install-plugin checkstyle
java -jar jenkins-cli.jar -s $host install-plugin cloverphp
java -jar jenkins-cli.jar -s $host install-plugin dry
java -jar jenkins-cli.jar -s $host install-plugin htmlpublisher
java -jar jenkins-cli.jar -s $host install-plugin jdepend
java -jar jenkins-cli.jar -s $host install-plugin plot
java -jar jenkins-cli.jar -s $host install-plugin pmd
java -jar jenkins-cli.jar -s $host install-plugin violations
java -jar jenkins-cli.jar -s $host install-plugin xunit
java -jar jenkins-cli.jar -s $host install-plugin phing
java -jar jenkins-cli.jar -s $host safe-restart
#!/bin/bash
pear upgrade PEAR
pear config-set auto_discover 1
pear install pear.phpqatools.org/phpqatools pear.netpirates.net/phpDox
cd $JENKINSHOME/jobs
git clone git://github.com/sebastianbergmann/php-jenkins-template.git php-template
chown -R jenkins:nogroup php-template/

in $JENKINSHOME/jobs/$PROJECT/workspace/build.xml for phing

<project name="project" default="build" basedir=".">
    <property name="basedir" value="${project.basedir}" />
    <property name="source" value="${basedir}/src"/>
 
    <target name="clean" description="Clean up and create artifact directories">
        <delete dir="${basedir}/build/api"/>
        <delete dir="${basedir}/build/code-browser"/>
        <delete dir="${basedir}/build/coverage"/>
        <delete dir="${basedir}/build/logs"/>
        <delete dir="${basedir}/build/pdepend"/>
 
        <mkdir dir="${basedir}/build/api"/>
        <mkdir dir="${basedir}/build/code-browser"/>
        <mkdir dir="${basedir}/build/coverage"/>
        <mkdir dir="${basedir}/build/logs"/>
        <mkdir dir="${basedir}/build/pdepend"/>
    </target>
 
    <target name="phpunit" description="Run unit tests using PHPUnit and generates junit.xml and clover.xml">
        <exec logoutput="true"
            command="phpunit --configuration=${basedir}/app/phpunit.xml.dist --log-junit=${basedir}/build/logs/junit.xml --coverage-clover=${basedir}/build/logs/clover.xml" />
    </target>
 
    <target name="parallelTasks" description="Run the pdepend, phpmd, phpcpd, phpcs, phpdoc and phploc tasks in parallel using a maximum of 2 threads.">
        <phingcall target="pdepend"/>
        <phingcall target="phpmd"/>
        <phingcall target="phpcpd"/>
        <phingcall target="phpcs"/>
        <phingcall target="phpdoc"/>
        <phingcall target="phploc"/>
    </target>
 
    <target name="pdepend" description="Generate jdepend.xml and software metrics charts using PHP_Depend">
        <exec logoutput="true"
            command="pdepend --jdepend-xml=${basedir}/build/logs/jdepend.xml --jdepend-chart=${basedir}/build/pdepend/dependencies.svg --overview-pyramid=${basedir}/build/pdepend/overview-pyramid.svg ${source}" />
    </target>
 
    <target name="phpmd" description="Generate pmd.xml using PHPMD">
        <exec logoutput="true" spawn="true"
            command="phpmd ${source} xml codesize,design,naming,unusedcode --reportfile ${basedir}/build/logs/pmd.xml" />
    </target>
 
    <target name="phpcpd" description="Generate pmd-cpd.xml using PHPCPD">
        <exec logoutput="true"
            command="phpcpd --log-pmd ${basedir}/build/logs/pmd-cpd.xml ${source}" />
    </target>
 
    <target name="phploc" description="Generate phploc.csv">
        <exec logoutput="true"
            command="phploc --log-csv ${basedir}/build/logs/phploc.csv ${source}" />
    </target>
 
    <target name="phpcs" description="Generate checkstyle.xml using PHP_CodeSniffer">
        <exec logoutput="true"
            command="phpcs --report=checkstyle --report-file=${basedir}/build/logs/checkstyle.xml --standard=Zend ${source}" />
    </target>
 
    <target name="phpdoc" description="Generate API documentation using PHPDocumentor">
        <exec logoutput="true"
            command="phpdoc -d ${source} -t ${basedir}/build/api" />
    </target>
 
    <target name="phpcb" description="Aggregate tool output with PHP_CodeBrowser">
        <exec logoutput="true"
            command="phpcb --log ${basedir}/build/logs --source ${source} --output ${basedir}/build/code-browser" />
    </target>
 
    <target name="build" depends="clean,parallelTasks,phpunit,phpcb"/>
 
</project>

now run phing in $JENKINSHOME/jobs/$PROJECT/workspace/

.vimrc de base

set nocompatible
set bs=2
set background=dark
set wrapmargin=8
syntax on
set ruler
set showcmd
 
set tabstop=4
set shiftwidth=4
set expandtab
 
set fileformats=unix
 
set ignorecase
set incsearch
 
set showmatch

rewrite rules

redirect HOST != ‘blog.hio.fr’ to blog.hio.fr

RewriteEngine on
RewriteCond %{HTTP_HOST} !^blog\.hio\.fr$ [NC]
RewriteRule ^(.*)$ http://blog.hio.fr/$1? [L,R=301]

APACHE zend framework vhost

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        ServerName sub.domain.tld
        SetEnv APPLICATION_ENV "development"
        DocumentRoot /var/www/sub.domain.tld/public
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/sub.domain.tld/public>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Allow from all
        </Directory>
 
        ErrorLog /var/log/apache2/sub.domain.tld.error.log
        CustomLog /var/log/apache2/sub.domain.tld.access.log combined
</VirtualHost>

NGINX zend framework vhost

server {
  listen 80;
 
  server_name sub.domain.tld;
  root /var/www/sub.domain.tld/public;
 
  error_log /var/log/nginx/sub.domain.tld.error.log;
  access_log /var/log/nginx/sub.domain.tld.access.log;
 
  location / {
    index index.php;
    if (-f $request_filename) {
      break;
    }
    rewrite ^(.*)$ /index.php last;
  }
 
  # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  #
  location ~ index.php {
    root /var/www/sub.domain.tld/public;
    fastcgi_param APPLICATION_ENV development;
    include fastcgi_params;
    fastcgi_pass   127.0.0.1:9000;
  }
}

scp_sync.sh

#!/bin/bash                                                                                                                                                                                                      
# BASE CONFIGURATION                                                                                                                                                                                             
file_dir="/home/erelance/Drop_Off"
done_dir="/home/erelance/done"
dest_dir="/home/erelance/Drop_Off"
log_dir="/home/erelance/log"
# log                                                                                                                                                                                                            
date_short="+%d-%m-%Y"
date_long="+%d-%m-%Y %H:%M:%S"
log_file="$log_dir/error-"$(date "$date_short")".log"
 
if [ ! -d "$done_dir" ];then
    mkdir "$done_dir"
fi
 
if [ ! -d "$log_dir" ];then
    mkdir "$log_dir"
fi
 
for i in $(ls $file_dir/*.{csv,txt})
do
    scp_return=$(scp $i erelance@sub.domain.tld:$dest_dir 2>&1)
    if [[ $? == 0 ]]; then
        mv $i $done_dir
    else
        echo $(date "$date_long")"|$i|$scp_return" >> $log_file
    fi
done
 
find $log_dir -maxdepth 1 -type f -mtime +14 -name *.log -exec rm {} \; 2>&1