Monthly Archives: May 2012

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

Install PHPunit on Ubuntu

Install the package

sudo apt-get install phpunit

Upgrade PEAR

sudo pear upgrade pear

Install all the dependencies

sudo pear channel-discover
sudo pear channel-discover
sudo pear channel-discover
sudo pear install --alldeps phpunit/PHPunit


phpunit --version

If you have any problem you can try this:

Install MySQL Workbench on Ubuntu 12.04

download MySQL Workbench on

sudo dpkg -i libzip1_0.9.3-1_i386.deb

64bits =>

This package (libmysqlclient16) was removed from 12.04 repos, so you need to grab the old one.

sudo dpkg -i libmysqlclient16_5.1.58-1ubuntu5_i386.deb

64bits =>

sudo apt-get install python-paramiko python-pysqlite2 mysql-client mysql-common libctemplate0 libgtkmm-2.4-1c2a

now install MySQL Workbench

sudo dpkg -i mysql-workbench-gpl-5.2.38-1ubu1104-i386.deb

Output while running (PHP)

for($i=0; $i<3; $i++)
   echo 'printing...';
   echo str_repeat(' ', 65536); // set a minimum output
Page 1 of 212