Install FOS User in Symfony 2

After finished the tutorial I needed a user Bundle, the FOS Bundle (Friend of Symfony) is for Symfony 2 what SfGuardUser was for Symfony 1, so we gonna continue the tutorial started in the previous post. Installing the bunddles: [cce_bash] composer require sonata-project/user-bundle –no-update composer update [/cce_bash] Add to your registerbundles function in the AppKernel

Install and configure Symfony 2 and Sonata bundle

I found some bugs and inconsistencies while trying to install those 3 bundles by the book, so I decide to create that small tutorial. What we gonna install: Symfony Framework SonataAdminBundle SonataDoctrineORMAdminBundle SonataEasyExtendsBundle First we start by installing the Symfony Framework [cce_bash] composer create-project symfony/framework-standard-edition [/cce_bash] Now we jump to the sonata bundle [cce_bash] composer

MySQL create databases and user from a to z

How can I create a database and an user to work together in MySQL. Well, it’s quit easy, theres the few MySQL lines you need to use to solve your problem. Create the database [cce_mysql] CREATE database my_db; [/cce_mysql] Create an user [cce_mysql] CREATE USER ‘my_user’@’localhost’ IDENTIFIED BY ‘my_pass’; [/cce_mysql] Verify user [cce_mysql] SELECT *

Shell “ls -l” sort by list column

It’s common to list the files on directory, but it usefull to list them order sometimes. One way to do that is to simply add the | sort -k instruction. The value of k is the column who will be ordered. [cce_bash] 15:42 $ ls -lh total 712 drwxr-xr-x 2 walter staff 68B Jan 19

htaccess redirect all subdomain except one

I needed a rule to redirect all subdomain in my domain except one specified subdomain, to do that I use those few lines in my .htaccess file [cc_bash] DirectoryIndex index.php RewriteEngine on RewriteCond %{HTTP_HOST} !$ [NC] RewriteCond %{HTTP_HOST} (.*)$ [NC] RewriteRule ^(.*)$$1 [L,R=301] [/cc_bash] Of course you can skip redirection on a full list

MySQL tables space

Well my database is starting to get bigger and bigger. So I use this small query to know which table is consuming the more space. [cc_mysql escaped=”true”] SELECT concat(table_schema, ‘.’, TABLE_NAME) AS “Tables”, table_rows AS “# of Rows”, round(((data_length + index_length) / 1024 / 1024), 2) “Size in MB” FROM information_schema.TABLES ORDER BY (data_length +

Unix bash aliases

Well, I’m a little bored by, every time I change my system I have to update my aliases. So here it goes some alias that can be really useful. I gonna use this page to save all my aliases. Both systems .bash_aliases: [cc_bash escaped=”true”] alias duh =’du -h -d1′ alias ll =’ls -lA –color’ alias