Connect to VPN from Linux

Install an OpenVPN client: Fedora/CentOS/RedHat: yum install openvpn Ubuntu/Debian: apt-get install openvpn In general, the easiest way to install an OpenVPN client is to use…

Enable slow query log on MySQL server

Set it temporarily, by running the following commands on mysql console: set global slow_query_log = 1; set global slow_query_log_file = ‘/var/log/mysql-slow.log’; the changes will be…

Doctrine Console Commands

Example doctrine console command: php vendor/bin/doctrine orm:generate-entities –help Available commands: dbal:import Import SQL file(s) directly to Database. dbal:run-sql Executes arbitrary SQL directly from the command…

Symfony2 Doctrine debug query

Show doctrine constructed query and parameters print $query->getSQL(); foreach ($query->getParameters() as $param) print_r($param);

SSL Certificates with Apache 2 on CentOS

Generate a Self-Signed Certificate At the shell prompt, issue the following commands to install SSL for Apache and generate a certificate: yum install mod_ssl mkdir…

Tar and untar files and folders

tar tar files tar cvf dest.tar file.txt file2.txt Tarring folders tar cvf dest.tar myfolder/ Untar the file or folder tar xvf dest.tar tar.gz Compress using…

View array content in twig

The dump function dumps information about a template variable. It can be used as an alternative to var_dump or print_r from php. This is mostly…