fribeiro's blog

How to install and run two MySQL Server Instances on MacOSX (MySQL 5.6 and 5.7)

# How to install and run two MySQL Server Instances on MacOSX
# MySQL Server 5.6  and Mysql server 5.7

# Mysql Server 5.7
# Download .dmg from and install as usually

# Mysql Server 5.6
# Go to and download Mysql tgz
# Descompact tgz
tar -xvf mysql-5.6xxx.tgz

# Move mysql to bin dir
sudo mv ~/Downloads/ /usr/local/

# Install mysql install db system
cd /usr/local/mysql-5.6.34-osx10.11-x86_64

# edit/add conf options to the default file options
vim /usr/local/mysql-5.6.34-osx10.11-x86_64/my.cnf

Howto build a custom map of collaborators with D3js

First of all go to if you need learn how to build the map paths to use with D3js.

The start point of this project it was an static SVG where is defined the theme that we use.
Next step it was buid one list with the names and GPS of all Collaborators. I builded an CSV and then convert it to json with PHPOffice.
Then we just load the map and collaborators data and draw the world map the with collaborators points.

Migrate Drupal 6 permissions to Laravel 5.3

Laravel 5.3 study: What kind of projects is Laravel the best choice
# The challenge: Can i migrate a Drupal 6 (D6) to Laravel 5.3 (L5)
# Part: Migrate Drupal permissions

# Database tables : users, users_roles, roles, permission

# On User Model it was implemented the get and check user permissions

How to use composer autoloader

# Use Cases
use psr4 
autoload a class file or a directory of classes

# Solutions

# Manually
$loader = require YOUR_VENDOR_PATH'/autoload.php';

$loader->addPsr4('projectName\\ClassDir\\', "path/to/classes/");
// inside classe folder there are classes with namespace projectName/ClassDir;

$classmap = array(
    "ClassName" => "path/to/classes/ClassName.php",
    "ClassesDir" => "path/to/directory/",

# Automatic
# Using composer.json to auto generate autoloader settings
  "autoload": {
    "psr-4": {

Git - How to Merge detached HEAD back to origin/master

# References
git help branch

# Use Cases
You made a checkout from remote repo
You create a new brach from a previous commit
    git  -b new-branch-name c2744f95d

# Solution
git checkout –b temp #makes a new branch from current detached HEAD
git branch –f master temp # -f --force Reset <branchname> to <startpoint> if <branchname> exists already
git branch –d temp # delete the <temp> branch
git push origin master #push the re-established history

How to build a custom Symfony Security Authentication on Silex 2

Symfony Security Component is a very complex/flexible system, there are a lot of concepts with a lot of features and require some time to figure out it's workflow. 

Owncloud as virtualbox with mounted NAS

# Download owncloud Appliance

# import Machine to VirtualBox

VBoxManage import Ubuntu_14.04-owncloud-9.0.0-1.1-201603082006.ova --dry-run
VBoxManage import Ubuntu_14.04-owncloud-9.0.0-1.1-201603082006.ova

# Adjust name, cpu and memory 
# and start machine

Backup and Restore VirtualBox machine with LVM Snapshots and dd

# Install host using lvm partitions system (my case: linuxmint 17.3 xfce)
# From liveCD
# create partition 3 partitons with fdisk
# boot, swap, root

sudo su
fdisk -l
fdisk /dev/sda
Command (m for help) 
# boot
# swap and swap partion type
# root lvm partition type
# save setup

# Install virtualbox

Install php7 from source on Ubuntu 14.04 LTS

# Install virtualbox

sudo apt-get install virtualbox 
sudo apt-get install virtualbox-dkms

# Install vagrant from source (vagrant from ubuntu repo doesn´t work)

sudo apt-get purge vagrant 
sudo dpkg -i vagrant_1.7.4_i686.deb 

# Install Ubuntu 14.04 LTS

vagrant init ubuntu/trusty32 
vagrant up --provider virtualbox
vagrant ssh

# On Ubuntu machine