Send Mail from Linux Terminal in One Line

Using the default mail system of Unix: echo “I am the body.” | mail -s “Thus, I am the subject.”    

Posted in Linux Tagged with: , , , ,

gzip Compress and Remove Definer on MySQLDump

Code snippet to compress MySQLdump and remove the definer.   mysqldump -uuser -p database | sed -e “s/DEFINER=[^*]*\*/\*/” | gzip > database.sql.gz cat database.sql | sed -e “s/DEFINER=[^*]*\*/\*/” > database_nodefiner.sql

Posted in MySQL

Ubuntu Apache Error Log

tail -f /var/log/apache2/error.log   Always think twice before hitting the Enter key…

Posted in Linux Tagged with: , , , ,

Magento Custom Controller Layout

You will need some debugging techniques to get the handle of your controller. In your controller: Zend_Debug::dump($this->getLayout()->getUpdate()->getHandles()); Output: array(5) { [0] => string(7) “default” [1] => string(13) “STORE_default” [2] => string(30) “THEME_frontend_default_default” [3] => string(27) “brymayor_custom_upload_index” [4] => string(19) “customer_logged_out”

Posted in Magento Tagged with: , ,

List of Magento Admin Form Fields

On our previous post, we learned how to create Magento Adminhtml grids. All the codes below should be written in the class Foo_Bar_Block_Adminhtml_Baz_Edit_Form (assuming it doesn’t have tabs) inside the _prepareForm() function. Text Field $fieldset->addField(‘title’, ‘text’, array( ‘label’ => $this->__(‘Title’),

Posted in Magento Tagged with: , , , , , , , , ,

How To Create a MySQL Database and Set Privileges to a User

In this tutorial, I will explain how to create a database as well as the user. Given that your have an access to the database, we are going to create a database called jungle which will be accessible from localhost

Posted in MySQL Tagged with: , ,

How to Reduce Video Size in Ubuntu

FFmpeg is a complete, cross-platform solution to record, convert and stream audio and video. It includes libavcodec – the leading audio/video codec library. See the documentation for a complete feature list. To install FFmpeg on your Ubuntu machine, you need

Posted in Linux Tagged with: , , , , , , ,

Syntax for a Secure Copy (SCP)

SCP allows files to be copied from, to, or between different hosts. It uses SSH for data transfer and it provides the same authentication and level of security as that of SSH. Following are some example commands you can run

Posted in Linux Tagged with: , , , ,

How to Create Multiple Virtual Hosts in Ubuntu

Assuming you already have installed LAMP on your Ubuntu machine, here are the steps in creating multiple virtual hosts. If Apache mod_rewrite module is not yet enabled, you can do so by typing the following command in the terminal: $

Posted in Linux Tagged with: , , ,

Create Basic Custom Payment Method in Magento

This is the basic payment method tutorial and does not cover if there is a payment integration. First we need to decide on a unique code for the payment method, in the following example, I used the code new_pay and the

Posted in Magento Tagged with: ,