G31 Zone
  • About
  • Contact

Connect to VPN from Linux

Posted on: June 5, 2015 /
Categories: 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

Posted on: June 4, 2015 /
Categories: MySQL

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,

Read More →

Doctrine Console Commands

Posted on: June 2, 2015 /
Categories: Symfony 2 / Doctrine

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.

Read More →

Symfony2 Doctrine debug query

Posted on: May 28, 2015 /
Categories: MySQL

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

Mysqldump only tables with certain prefix

Posted on: May 28, 2015 /
Categories: MySQL

Mysqldump only tables with certain prefix: mysqldump DBNAME $(mysql -D DBNAME -Bse “show tables like ‘wp_%'”) > FILENAME.sql

SSL Certificates with Apache 2 on CentOS

Posted on: May 26, 2015 /
Categories: 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 /etc/httpd/ssl openssl req -new -x509 -sha256 -days 365 -nodes -out /etc/httpd/ssl/httpd.pem -keyout /etc/httpd/ssl/httpd.key Configure Apache to use the Self-Signed Certificate NameVirtualHost *:443 SSLEngine On SSLCertificateFile /etc/httpd/ssl/httpd.pem SSLCertificateKeyFile /etc/httpd/ssl/httpd.key ServerAdmin info@mydomain.com

Read More →

Tar and untar files and folders

Posted on: May 22, 2015 /
Categories: Linux

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 gzip: tar cvfz dest.tar.gz myfolder/ Uncompress zip file: tar xvfz dest.tar.gz tar.bz tar cvjf dest.tar.bz2 myfolder/ Extract: tar xvjf dest.tar.bz2 Extracting individual files tar xvjf dest.tar.bz2 textfile.txt

Ubuntu – Executing a script at startup and shutdown

Posted on: May 21, 2015 /
Categories: Ubuntu

To execute a script at startup of Ubuntu Edit /etc/rc.local and add your commands The script must always end with exit 0 To execute a script upon rebooting Ubuntu: Put your script in /etc/rc0.d Make it executable (sudo chmod +x myscript) Note: The scripts in this directory are executed in alphabetical order The name of

Read More →

Exporting and Importing Compressed MySQL Databases

Posted on: May 20, 2015 /
Categories: MySQL

This command will dump a MySQL database, compress it and save it to a file (replace userName and databaseName with your data): mysqldump -u userName -p databaseName | gzip > databaseName.sql.gz The import command takes a compressed MySQL dump, decompresses it and adds it to the database (replace userName and databaseName with your data): gzip

Read More →

View array content in twig

Posted on: March 17, 2015 /
Categories: 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 useful to debug a template that does not behave as expected by introspecting its variables: {{ dump(var_name) }} Read entire article at: Twig -> Functions -> dump

1 2 3 … 9 »

Categories

  • Apache
  • CentOS
  • Git
  • HTML
  • HTTP
  • JavaScript
  • JQuery
  • Linux
  • Magento
  • MySQL
  • PHP
  • Regular expression (Regex)
  • Smarty
  • Symfony 2 / Doctrine
  • Twig
  • Ubuntu
  • Uncategorized
  • Zend

Archives

  • June 2015
  • May 2015
  • March 2015
  • September 2014
  • October 2013
  • September 2013
  • August 2013
  • July 2013
  • January 2013
  • October 2012
  • August 2012
  • May 2012
  • April 2012
  • January 2012
  • December 2011
  • November 2011
  • July 2011
  • June 2011
  • May 2011
  • April 2011
  • February 2011
  • January 2011
  • December 2010
  • November 2010
  • October 2010
  • September 2010

Recent Posts

  • Connect to VPN from Linux
  • Enable slow query log on MySQL server
  • Doctrine Console Commands
  • Symfony2 Doctrine debug query
  • Mysqldump only tables with certain prefix

Tags

404 not found error apache bundled categories category cms tags command line confirm contact form countries create user customer group name customer logged in disable right click export database front controller git image uploader import database incorrect url JavaScript jquery jquery ajax request Magento mysql mysql show user privileges no right click parameters php print array product attribute product images products read files read folders regions script script execution time session smarty smarty print array stores subcategories tinymce url

Copyright G31 Zone 2023 | Theme by Theme in Progress | Proudly powered by WordPress