Archive for : June, 2015

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 the –config argument to specify the location of the client config file:


openvpn --config client.ovpn

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 undone when mysql is restarted.

Set it permanently, by adding the following in “my.cnf” file:


slow-query-log=1
slow-query-log-file=/var/log/mysql-slow.log

The location of my.cnf varies by OS, but is often found in /etc/my.cnf, or /etc/mysql/my.cnf. After saving your changes, you will need to restart MySQL.

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 line.


orm:clear-cache:metadata Clear all metadata cache of the various cache drivers.


orm:clear-cache:query Clear all query cache of the various cache drivers.


orm:clear-cache:result Clear result cache of the various cache drivers.


orm:convert-d1-schema Converts Doctrine 1.X schema into a Doctrine 2.X schema.


orm:convert-mapping Convert mapping information between supported formats.


orm:ensure-production-settings Verify that Doctrine is properly configured for a production environment.


orm:generate-entities Generate entity classes and method stubs from your mapping information.


orm:generate-proxies Generates proxy classes for entity classes.


orm:generate-repositories Generate repository classes from your mapping information.


orm:run-dql Executes arbitrary DQL directly from the command line.


orm:schema-tool:create Processes the schema and either create it directly on EntityManager Storage Connection or generate the SQL output.


orm:schema-tool:drop Processes the schema and either drop the database schema of EntityManager Storage Connection or generate the SQL output.


orm:schema-tool:update Processes the schema and either update the database schema of EntityManager Storage Connection or generate the SQL output.