• Remote Desktop MAC and wrong keyboard

    Recently I upgraded to the remote desktop app from microsoft that is available in the app store. Previously I was using the 2.1.1 version which worked quite well but felt like changing anyway. Upon switching I noticed that some of my keys were not working as they should, in particular the @ key was coming up with ” and # was ? instead. In fact there were many keys that were not outputting correctly. It turns out that upon making a RDP connection from my MAC to a windows server, the RDP connection was incorrectly identifying my remote keyboard.

    Read the rest of this entry »

  • 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 »

  • Simple Bash Automation for EC2 Instance Backups using Cron on a Mac Mini

    The problem that needed to be solved was to have a simple backup system that could be used to maintain a bunch of EBS backed Windows instances on AWS. We wanted to keep a weeks worth of backups, always discarding the older AMI’s. A local mac mini was used to run the necessary scripts and cron. We didn’t want just EBS snapshots, we wanted a full AMI everyday. There are other solutions if you just want to backup an EBS drive on a schedule, and even for this but this one suits our needs.

    Read the rest of this entry »

  • 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 »

  • Blocking IP’s while behind an Amazon ELB with Apache

    So Amazon does not allow accept/deny rules on their firewall system which is beyond silly in this day and age, but I digress. If you want to limit access to an apache server behind Amazon’s Elastic Load Balancer, your options are fairly sparse (although there are options).

    One such way to accomplish this is to first allow logging of the IP from the ELB using the X-Forwarded-For header. You can see how to do this here.

    So once you have setup logging of the IP’s in the apache logs, you now want to adjust the site configuration files. We have individual files in /etc/apache2/sites-available, so we add the following to the specific site. You may do something similar or you may have it all in a httpd.conf, or you can even put this into a .htaccess file.
    Read the rest of this entry »