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.” recipient@example.com    

Tagged with: , , , ,
Posted in Linux

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    

Posted in MySQL

 

Posted in Uncategorized

Ubuntu Apache Error Log

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

Tagged with: , , , ,
Posted in Linux

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”

Tagged with: , ,
Posted in Magento

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’),

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

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

Tagged with: , ,
Posted in MySQL

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

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

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

Tagged with: , , , ,
Posted in Linux

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: $

Tagged with: , , ,
Posted in Linux