Update git submodule

git submodule foreach git pull origin master

Xdebug – Zend Studio (export)

export XDEBUG_CONFIG=”idekey=ECLIPSE_DBGP”

Convert XML to Array using PHP

<?php
 
var_dump(json_decode(json_encode((array) simplexml_load_string($xml)), 1));

Clean apc cache

cli

php -r 'apc_clear_cache();apc_clear_cache("user");apc_clear_cache("opcode");'

web

curl -s --user username:password "apc.php?CC=1&OB=1" > /dev/null
curl -s --user username:password "apc.php?CC=1&OB=2" > /dev/null
curl -s --user username:password "apc.php?CC=1&OB=3" > /dev/null
curl -s --user username:password "apc.php?CC=1&OB=4" > /dev/null

Find out current path on a shell script

path=$(cd -P -- "$(dirname -- "$0")" && pwd -P)

Kill process by name

kill `ps -ef | grep process_name | grep -v grep | awk ‘{print $2}’`

Tunneling MySQL over SSH

ssh -fNg -L 3307:127.0.0.1:3306 user@host

		

Fetch Branch (Single or All)

fetch single branch

git branch -f local_name origin/remote_name
git checkout -b local_name origin/remote_name

fetch all branches

git fetch

Convert PFX to PEM

openssl pkcs12 -in cert.pfx -out cert.pem -nodes

Change Branch name on GIT

git branch -m newname
Page 1 of 1012345...10...Last »