Skip to main content

Posts

smtp server (Gmail) in Magento

/app/code/core/Mage/Core/Model/Email.php /app/code/core/Mage/Core/Model/Email/Template.php  $config = array('ssl' => 'tls', 'port' => 587, 'auth' => 'login', 'username' => 'username@gmail.com', 'password' => 'password'); $transport = new Zend_Mail_Transport_Smtp('smtp.gmail.com', $config); $mail->send(); replace with: $mail->send($transport);

Rename Folder or File

mv old_folder_name new_folder_name mv  also can move several files into a destination folder, or rename a single file. Rename a file mv old_file_name new_file_name Rename a directory. mv file_name destination_directory Rename will retain the attributes and the creation date of the original file/folder.

Copying Moving and renaming Removing file

  Copying   To copy files, you use the  cp  command. The following will copy  file  to  file2 . Note that if  file2  doesn't exist, it'll be created, but if it exists, it'll be overwritten: $  cp file file2 There aren't any undo commands in the Linux CLI, so accidentally overwriting an important file would probably make you pull your head off. The risk of doing so is smaller if you use the  -i  option ("interactive") with  cp . The following does the same as the above, but if  file2  exists, you'll be prompted before overwriting: $  cp -i file file2 cp: overwrite `file2'?  n $ So it's a good idea to use the  -i  option whenever you're dealing with important files you don't want to lose! If you want to copy  file  into directory  dir1 : $  cp file dir1 The following would do the same as the above, copy  file  into  dir1 , but under a different name: $  cp file dir1/file2 You can also copy multiple files into one directory w

Finding the size of a directory

'du' - Finding the size of a directory $ du Typing the above at the prompt gives you a list of directories that exist in the current directory along with their sizes. The last line of the output gives you the total size of the current directory including its subdirectories. The size given includes the sizes of the files and the directories that exist in the current directory as well as all of its subdirectories. Note that by default the sizes given are in kilobytes. $ du /home/david The above command would give you the directory size of the directory /home/david $ du -h This command gives you a better output than the default one. The option '-h' stands for  human readable format . So the sizes of the files / directories are this time suffixed with a 'k' if its kilobytes and 'M' if its Megabytes and 'G' if its Gigabytes. $ du -ah This command would display in its output, not only the directories but also all the files that are present in the cu