Copy SSH Key to Remote Server

This is quite handy when needing to upload your local ssh ket to a remote server.

1. Generate a new SSH key.

2. Copy Key to Remote Server.

3. Log into server without password.

Amazon Kindle. Delete old Documents

So I have in the past use the amazon kindle and to view rss feeds about various topics. Its a great little service, and had been using this for quite some time.

I did however see one drawback. This was in my account I had literally 100’s of kindlefeeder documents building up. The issue was the only way to remove these documents was deleting them 1 by 1.

Then I came across a post on how to run a small piece of java-script to delete en-mass..

All you need to do is open the chrome console and add the following line.

Note: the var docType defines what documents to remove. In my case I wanted to delete all Personal Documents. This is where the documents are posted to automatically.

Also, be aware this works on a page by page basis. But at least it speeds up the process of removing old content.

var docType = "PersonalDocuments";
var v = new RegExp(docType);
if (!v.test(document.URL)) {
return false;
for(var i = 0; i

TAR File Extraction

Another handy tip when extracting a tar file and stripping out any sub directories.

tar -zxvf filename.tar.gz –strip [number]

Note: Where number is the folder level

tar -zxvf filename.tar.gz –strip 2

Install PHP APC from Shell

The following steps are used to install APC from source onto a Ubuntu Server.

[code] sudo aptitude install apache2-dev php5-dev build-essential [/code]

Get current version of apc and install it

[code] wget [/code]
[code] tar xzf APC-3.1.13.tgz [/code]
[code] cd APC-3.1.13 [/code]
[code] phpize [/code]
[code] sudo ./configure –enable-apc –enable-apc-mmap –with-php-config=/usr/bin/php-config –with-libdir=/usr/lib64 [/code]
[code] sudo make [/code]
[code] sudo make install [/code]

Stop Magento Success Page From Completing

The following change is only intended to be used when you are testing the checkout process. Say for example, you would like to stop the posting the orders into magento at the end of the success page. As this will redirect you away from the success page.


public function successAction()
$session = $this->getOnepage()->getCheckout();
if (!$session->getLastSuccessQuoteId()) {

$lastQuoteId = $session->getLastQuoteId();
$lastOrderId = $session->getLastOrderId();
$lastRecurringProfiles = $session->getLastRecurringProfileIds();
if (!$lastQuoteId || (!$lastOrderId && empty($lastRecurringProfiles))) {


Mage::dispatchEvent(‘checkout_onepage_controller_success_action’, array(‘order_ids’ => array($lastOrderId)));

Visual Studio Permission Error Running from Share

When trying to build a Visual Studio Application from a shared folder I came across the following error:

Request for the permission of type ‘System.Security.Permissions.SecurityPermission, mscorlib, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089′ failed. Z:\GIT\WebAPI\API\SBT\Maintenance\Pricing\frmImportProductPriceSpecial.resx Web-API

Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.	Z:\GIT\WebAPI\API\SBT\Maintenance\Pricing\frmImportProductPriceSpecial.resx	Web-API

The fix is as follows:

From an Administrative console window run the following command:

caspole.exe -m -ag LocalIntranet_Zone -url \\ip address\Share\ FullTrust -n FullTrustShare

Visual Studio Console Update

Posts from a Developer