Skip to main content

Posts

General linux commands

When I have started working on linux platform, i was unable to work. And I m writing this myself actually so that i can get help form this post to know about particular command and this post can also help others. I will be covering all below questions. How to find pid of program like firefox? How to find out the current running kernel version? How to find a file with .txt extension in particular directory? How to find a file containing word 'hello' in particular directory? How to change ownership recursively? How to change permissions on directory recursively? How to login using ssh? How to check if package is installed Let for example if we want to check if apache is installed? How to check for processes listening on port 80? How to check for a procesess files are located? How to Zip a folder in linux? How to remove directory in linux? How to find pid of program like firefox? ps -aux | grep firefox How to find out the current running kernel version? cat /...

Reduce Page Speed

Enable gzip compression <IfModule mod_deflate.c>     AddOutputFilterByType DEFLATE image/png image/gif image/jpeg image/jpg text/text text/html text/plain text/xml text/css application/x-javascript application/javascript text/javascript application/json </IfModule> AddType font/ttf .ttf AddType font/eot .eot AddType font/otf .otf AddType font/woff .woff AddType font/svg .svg Leverage Browsing Cache <IfModule mod_expires.c>     ExpiresActive On     ExpiresDefault "access plus 10 days"     ExpiresByType image/png "access plus 10 days"     ExpiresByType image/gif "access plus 10 days"     ExpiresByType image/jpeg "access plus 10 days"     ExpiresByType image/jpg "access plus 10 days"     ExpiresByType text/css "access plus 10 days"     ExpiresByType application/javascript "access plus 10 days"     ExpiresByType applicati...

Regular Expression For Javascript

For Email :   /^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/ For Name (Only For Alphabetic) : /^[-_ a-zA-Z]+$/ For Phone Number (Atleast 5 characters,With (+) Sign) : /^[+ 0-9]{5,15}\s*$/ For Textarea or Message : /^[a-zA-Z][;,-_ a-zA-Z0-9]+$/ For Alpha Numeric (Not Allowed Integer) : /^(?![0-9]*$)[-_ a-zA-Z0-9]+$/ For Test: You can store above regression in variable and then check it is valid or not.For example... var letters = /^[-_ a-zA-Z]+$/; if(letters.test(name)) {        return true; }else{       return false; }

ADD CUSTOM FIELD TO SUGARCRM

Create custom/Extension/modules/{module_name}/Ext/Vardefs/Vardefs.php  Here play with dictionary array and define fields accordingly Create file custom/Extension/modules/{module_name}/Ext/Language/en_us.{custom_modulename}.php This is a language file and you have to define variable that actually displays a label, here you have to use modstring array. Create file custom/modules/{module_name}/metadata/detailviewdefs.php place your cusotm fields here if you want to display those fields in detail view of that module. Create file custom/modules/{module_name}/metadata/editviewdefs.php Place your fields here if you want to show these fields in edit view

ADD CHECK BOX IN DEFAULT SEARCH FORM IN SUGARCRM

If you want to search for only customer type of accounts, then follow these steps you will be successful to achieve this functionality Open   SearchFields.php place this code inside this file ‘customer_only’ => array( ‘query_type’=>’default’, ‘db_field’=>array(‘account_type’), ‘operator’=>’in’, ‘closed_values’ => array(‘Customer’), ‘type’=>’bool’, ), Now open searchdefs.php ‘customer_only’ => array ( ‘name’ => ‘customer_only’, ‘label’ => ‘LBL_CUSTOMER_ONLY_FILTER’, ‘type’ => ‘bool’, ‘default’ => false, ‘width’ => ’10%’, ), to be on safer side repair and rebuild and open your account module and check this check box will be there and will be functional.