Recent Posts

HTML5 a tag download Attribute

HTML5 a tag download Attribute

In HTML5, you can download file when clicking on the link instead of redirecting to the file. Read More : http://www.w3schools.com/tags/att_a_download.asp

A proper way to prepare IN Query in WordPress

A proper way to prepare IN Query in WordPress

This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters Show hidden characters <?php global $wpdb; if ( is_array( 

A good article on wp_kses Performance

A good article on wp_kses Performance

https://www.tollmanz.com/wp-kses-performance/

WordPress Multisite Crontab using WP-CLI Raw

WordPress Multisite Crontab using WP-CLI Raw

This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters Show hidden characters WP_PATH="/var/www/site_path" for SITE_URL in = $(wp 

AWS S3 Sync using Crontab

AWS S3 Sync using Crontab

  1. Install AWS cli
    #Download cli script
    curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
    #unzip
    unzip awscli-bundle.zip
    #install
    ./awscli-bundle/install -b ~/bin/aws
  2. Create crontab script file : sync-s3.sh
    #/bin/bash
    export AWS_CONFIG_FILE="/root/.aws/config" #change it as per user
    export AWS_ACCESS_KEY_ID=XXXXXXXXXXXXXXXXXHRQ
    export AWS_SECRET_ACCESS_KEY=XXXXXXXfHyR
    /usr/local/bin/aws s3 sync /var/www/testsite.com/htdocs/wp-content/uploads s3://my-imagestore/ --acl=public-read --debug
  3. Add crontab to sync s3 folder every 5 min : crontab -e
    */5 * * * * /bin/bash /root/sync-s3.sh >> /tmp/sync-s3.log
Repairing a Corrupted Mac OSX ExFAT Partition

Repairing a Corrupted Mac OSX ExFAT Partition

I had some issues with corrupted exFAT partition that Disk Utility said it couldn’t repair. Then I finally found a solution. Run following command in terminal sudo fsck_exfat -d disk2s2 Where disk2s2 is ExFAT partition. Then it will ask you Main boot region needs to 

WordPress 4.3 Changes in Template Hierarchy

WordPress 4.3 Changes in Template Hierarchy

New template file added In WordPress 4.3 relaease

How to add Swap on ubuntu

How to add Swap on ubuntu

https://www.digitalocean.com/community/articles/how-to-add-swap-on-ubuntu-12-04

Sort directory by size in linux terminal

Sort directory by size in linux terminal

The linux “du” is a standard Unix command, used to check the information of disk usage of files and directories on a machine. Following command will sort “du” command result by size. du -hs * | sort -h