Using s3cmd to recursively update the meta data on a bucket

In our case, we needed to set the Expires and Cache-Control headers on all the files in one of our buckets for optimization purposes. Here’s what we did. Only the newest version of s3cmd supports the modify command, so if you have an old version installed, run apt-get remove s3cmd to remove the old version.[…]

nginx: Prevent search engines from indexing your development server

If you nginx powered development instances are showing up in Google search results, there is a quick and easy way to prevent search engines from crawling your site. Add the following line to the location block of your virtualhost configuration file for the block that you want to prevent crawling. add_header  X-Robots-Tag “noindex, nofollow, nosnippet,[…]

AngularJS: Show elements based on filtered results

If you ever need to show a container only if the filters of the repeated elements have one or more results, then you can do it using this code. <input ng-model=’searchText’/> <span ng-show=’filtered.length > 0′> <ul> <li ng-repeat=’el in filtered = (model | filter:searchText)’> <div>{{el.label}}</div> </li> </ul> </span> Source: StackOverflow

Creating an SSL certificate for Postfix/Courier IMAP on Ubuntu

If your SSL certificate has expired and you have chosen to go with PositiveSSL(Comodo), this post may help you out. 1. Generate your Certificate Signing Request (CSR) openssl req -new -nodes -newkey rsa:2048 -keyout servername.com.key -out servername.com.csr 2. Get your Certificate by signing the CSR file to Comodo and you will receive the Certificate by[…]

Adding a single post template based on parent category

We often have requirements where posts under a single category must be shown using a different template file in WordPress. THe code below allows you to search for a post’s parent or grandparent category and show the template based on the parent or grandparent category. Add the following code to your functions.php to find the[…]