Install composer

Composer is a dependency management for PHP and writen in PHP

curl -s | sudo php -- --install-dir=/usr/local/bin/
alias composer='/usr/local/bin/composer.phar'

List empty directories on Ubuntu

find your/path -depth -empty -type d

Add PHPUnit to your Include Path (eclipse based IDE)

1 – Choose “Project” -> “Properties” or “Window” -> “Preferences” -> “PHP” (for global usage)
2 – Choose “PHP Include Path”
3 – Click on “Add External Source Folder” (typically PHPUnit is based on /usr/share/php/PHPUnit for linux distro)

Backup / Export users from MySql

put this on your ~/.bashrc

  mysql -B -N $@ -e "SELECT DISTINCT CONCAT(
    'SHOW GRANTS FOR ''', user, '''@''', host, ''';'
    ) AS query FROM mysql.user" | \
  mysql $@ | \
  sed 's/\(GRANT .*\)/\1;/;s/^\(Grants for .*\)/## \1 ##/;/##/{x;p;x;}'


mygrants --host=[HOST] --user=[USER] --password=[PASSWORD]

I found this solution on:

List installed / loaded modules on apache2

sudo apache2ctl -M

Enable htaccess rewrite on Apache2 Ubuntu 12.04

sudo a2enmod rewrite

Edit /etc/apache2/sites-available/default, change “AllowOverride None” to “AllowOverride All”

sudo service apache2 restart

Install Java Runtime Environment on Ubuntu 12.04

To install the Oracle version of JRE and JDK, you should update your PPA to add this new repository:

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update

And then install it ! =)

sudo apt-get install oracle-java7-installer

Ignore chmod changes on GIT

git config core.filemode false

thanks Piero!/pierophp

PHPMyAdmin install on ubuntu

sudo apt-get install phpmyadmin
sudo cp /etc/phpmyadmin/apache.conf /etc/apache2/conf.d/phpmyadmin.conf
sudo service apache2 reload

Desktop Shorcut on Ubuntu

gnome-desktop-item-edit --create-new ~/Desktop
Page 4 of 10« First...23456...10...Last »