Windows 10 connect to NAS with smb1 (Samba, the old one)

Since Windows 10, microsoft remove the support for Samba 1, the problem is that I still have that old NAS who only support SMB1, so here’s the error shown: You can't connect to the file share because it's not secure. This share requires the obsolete SMB1 protocol, which is unsafe and could expose your system

Inject a custom Controller in Sonata

I had this problem, I needed to inject a Storage to my controller so I can create a custom action and connect to my db using a storage service. All I needed was configure the services as following: [cc_yaml] services: app.admin.document: class: AppBundle\Admin\DocumentAdmin arguments: [~, AppBundle\Entity\Document, ‘app.controller.document’] tags: – { name: sonata.admin, manager_type: orm, group:

Ignore modified file from commit

Sometimes you need to change some files, just for your development environment and you don’t want to commit those changes. With Git there a way to fix your problem. First of all, made all the change you need in the file(s) to ignore then run this command: [cc_shell] $ git update-index –assume-unchanged path/to/the/file/to/ignore [/cc] and

append and prepend script with apache

Sometimes we need to run a script in our localhost (or maybe in production) but we don’t want to edit our application to test the current environment. To solve this problem we can just add the file via apache virtual host configuration. So go on and edit your virtual host, and add this line to

Composer update creates a lack of memory

While using Symfony 2 it’s common that you have to run the command composer update. Sometimes we’re graced with the error: The following exception is caused by a lack of memory and not having swap configured PHP Fatal error: Uncaught exception 'ErrorException' with message 'proc_open(): fork failed - Cannot allocate memory' in phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:954 Stack trace:

sanitize php strings

Simple function to help you sanitizing the php string. This function will remove any non alphanumeric character. [cc_php] function sanitize($string) { return preg_replace(“/[^[:alnum:]]/ui”, ”, $string); } [/cc_php] example: [cc_php] echo sanitize(‘café’); /* => café / echo sanitize(‘|c/(!=)a f é’); / => café */ [/cc_php]

WordPress configurations for Heroku

Starting… Download the last version of wordpress, then create a directory called “wordpress” (or anything you want else to call it) and extract the content of the zip to the directory. WordPress Configuration Jump to your directory and create the Procfile with this line [cce] web: vendor/bin/heroku-php-apache2 / [/cce] Add a file for composer, named