• Useful commands to run in a terminal

    With the 1000’s of commands used over the years I sometimes forget what I have run. This post is a collection of commands that have been useful for me in the past and might be useful to others too. All commands are set to run from local(.).

    CREATE AN SSH TUNNEL (remember -i if using pem):

    ssh -C2qTnN -D 8080 user@location

    FIND ALL FILES/DIRECTORIES WITH XXX PERMS AND CHANGE IT TO XXX:
    Files:

    find . -type d -perm 0XXX -exec sudo chmod XXX {} \;

    Directories:

    find . -type f -perm 0XXX -exec sudo chmod XXX {} \;

    Read the rest of this entry »

    Share
  • Reverse Proxy from IIS Website to WordPress

    Our client has a corporate site at www.domain.com hosted on IIS and the blog hosted on a subdomain on a separate LAMP server at blog.domain.com. Our client feels serving their blog up under www.domain.com/blog will help their SEO and they will rank better (this is debateable but what client wants is what they will get).

    The objective of this project is to serve a wordpress site on a linux server under a subdirectory on IIS. In order to accomplish this we need to setup IIS to act as a reverse proxy, thus serving the the wordpress site under the desired blog subdirectory.

    The first step is to make sure your version of IIS is compatible (IIS 7+). Once you have determined this, you will need to install the Application Request Routing Module. The easiest way to go about installing these is using the




    Read the rest of this entry »

    Share
  • 301 redirect all subdomains to new domain on apache

    While trying to consolidate many subdomains under one new domain on apache we had to add the following into the sites configuration file to redirect the multiple subdomains to one. This could be added into the .htaccess as well.

    
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST} !^newdomain.com$ [NC]
    RewriteRule ^(.*)$ https://newdomain.com/$1 [L,R=301]
    

    Read the rest of this entry »

    Share
  • Showing images on WordPress search page

    When searching a blog using the twenty-twelve theme the images get commented out. It only will display an excerpt so your image is commented out. In order to fix this you must edit your CONTENT.PHP file, not your SEARCH.PHP.

    Open content.php and find the following lines:

    <?php if ( is_search() ) : // Only display Excerpts for Search ?>
    <div class=”entry-summary”>
    <?php the_excerpt(); ?>
    </div><!– .entry-summary –>
    <?php else : ?>
    <div class=”entry-content”>
    <?php the_content( __( ‘Continue reading <span class=”meta-nav”>&rarr;</span>’, ‘twentytwelve’ ) ); ?>
    <?php wp_link_pages( array( ‘before’ => ‘<div class=”page-links”>’ . __( ‘Pages:’, ‘twentytwelve’ ), ‘after’ => ‘</div>’ ) ); ?>
    </div><!– .entry-content –>
    <?php endif; ?>





    Read the rest of this entry »

    Share
  • Adding Adsense Code in Responsive Design

    We needed to be able to display different sized adsense ad’s based on the end user’s display size. What was happening is the large banner advertisements would ‘break’ the design on smaller resolution screens like iphone’s and android phones. In order to accomplish this, we had to adjust the adsense javascript, in accordance with Google Adsense TOS for responsive design.





    This is what the modified adsense code for responsive design looks like:
    Read the rest of this entry »

    Share