Architecture, testing, and performance. Changes in these areas empower developers to write better-quality code with higher performance and stability. Additionally, the re-architecture will provide developers with a more streamlined approach to customizations.
All posts by Pramod T P
Compress Files Linux TAR
tar -czvf name-of-archive.tar.gz name-of-the-file-to-be-compressed
-c: Create an archive.
-z: Compress the archive with gzip.
-v: Display progress in the terminal while creating the archive(verbose mode).
-f: Allowsto specify the filename of the archive.
Change Favicon Magento
Follow the below steps
- Log into your Magento admin panel and navigate to System > Configuration:
- Navigate to General > Design tab:
- Expand HTML Head section and find Favicon option:
- Click Choose file button and choose your favicon image file:
- After choosing the file, click Save config button:
Remove Specific Element From An Array PHP
Following code will help to remove a particular element from an array
<?php
$appliedRuleIs = array(370,369,400,500);
if (($key = array_search(‘369’, $appliedRuleIs)) !== false) {
unset($appliedRuleIs[$key]);
}
?>
Extract Unique IP Addresses From Apache Log Linux CentOs
Log in to your account using SSH and change to the directory where the apache logs available.
Then issue the command given below.
awk ‘{print $1}’ access.log | sort | uniq -c | sort -n | tail -n 10
Magento Enable Maintenance Mode With IP Filters
Log in to your account using SSH and Change to the directory where you installed Magento.
Run the blow given commands
touch /opt/ocentric/magento/current/maintenance.flag
service httpd restart
Then edit the index.php and assign the IPs to be shiteslited to the array $allowed = array(‘xxx.xxx.xxx.xxx’);
Magento Disable Maintenance Mode
Log in to your account using SSH and Change to the directory where you installed Magento.
Run the blow given command
rm maintenance.flag
service httpd restart
php shell/cache-clear.php -all
Magento Enable Maintenance Mode
Log in to your account using SSH and Change to the directory where you installed Magento.
Run the blow given command
touch maintenance.flag
service httpd restart
Its also possible that we can the website accessible only for some given IPs
For that edit the index.php file and assign teh IPs to the array $allowed = array(‘xxx.xxx.xxx.xxx’);
WordPress Get Menu Items
<?php $topMenuItems = wp_get_nav_menu_items(‘header-top-menu’ ); ?>
<ul>
<?php foreach($topMenuItems as $topMenu) { ?>
<li><a href=”<?php echo $topMenu->url; ?>”><?php echo $topMenu->title; ?></a></li>
<?php } ?>
</ul>
Disk Space Usage CentOs Linux
Check File System Disk Space Usage : df
Display Information of all File System Disk Space Usage : df -a
Show Disk Space Usage in Human Readable Format : df -h
Display Information of /home File System : df -hT /home
Display Information of File System in Bytes : df -k
Display Information of File System in MB : df -m
Display Information of File System in GB : df -h
Display File System Inodes : df -i
Display File System : df -T
Include Certain File System : df -t ext
Exclude Certain File System : df -x ext
Display Information of df Command: df --help