<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The WP Guru</title>
	<atom:link href="http://wpguru.co.uk/feed/" rel="self" type="application/rss+xml" />
	<link>http://wpguru.co.uk</link>
	<description>Dedicated Wordpress Hosting and Support</description>
	<lastBuildDate>Fri, 04 May 2012 06:36:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>How to install MySQL on CentOS</title>
		<link>http://wpguru.co.uk/2012/04/how-to-install-mysql-on-centos-2/</link>
		<comments>http://wpguru.co.uk/2012/04/how-to-install-mysql-on-centos-2/#comments</comments>
		<pubDate>Sun, 22 Apr 2012 15:21:17 +0000</pubDate>
		<dc:creator>Jay Versluis</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[centos]]></category>

		<guid isPermaLink="false">http://wpguru.co.uk/?p=2119</guid>
		<description><![CDATA[Here are the steps of what you need to do in order to install and setup MySQL on a new server. We&#8217;ll prepare a fresh CentOS 6 system (64 bit) for use as a database server. All you need is access to an SSH client and your server root credentials. Preparing the System The first [...]]]></description>
			<content:encoded><![CDATA[<p></p><p><img class="alignright size-medium wp-image-2121" title="mysql" src="http://wpguru.co.uk/wp-content/uploads/2012/04/mysql-300x154.gif" alt="" width="300" height="154" />Here are the steps of what you need to do in order to install and setup MySQL on a new server.</p>
<p>We&#8217;ll prepare a fresh CentOS 6 system (64 bit) for use as a database server. All you need is access to an SSH client and your server root credentials.</p>
<p><span id="more-2119"></span></p>
<h3>Preparing the System</h3>
<p>The first thing I&#8217;d like to do is make sure I have all available updates. So once I log in I run</p>
<pre>yum update</pre>
<p>This can take some time so grab a coffee while you wait. Once yum has finished, let&#8217;s check if MySQL is already installed on your system:</p>
<pre>mysql</pre>
<p>If you get &#8220;command not found&#8221; then you know you need to install MySQL.</p>
<h3>Installing MySQL and MySQL Server</h3>
<p>MySQL consists of two parts: the client and the server. In order for our system to run the daemon which will process external requests we need both on our system. Here&#8217;s how we get those:</p>
<pre>yum install mysql mysqlserver</pre>
<p>This will take a minute or two. No need to restart your server, MySQL will now be available for use. You&#8217;ll see the following message:</p>
<pre>To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h yourdomain.com password 'new-password'

Alternatively you can run:
/usr/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &amp;

You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl

Please report any problems with the /usr/bin/mysqlbug script!</pre>
<h3>Securing the installation</h3>
<p>Looks like we need to do two things: set a root password and secure the installation. You can do these steps manually, but MySQL is rather nice in that it provides a script which you can use to secure your installation. Note that this path may be different on your system:</p>
<pre>/usr/bin/mysql_secure_installation</pre>
<p>The script will ask you the following questions:</p>
<ul>
<li>current root password (in our case it&#8217;s not set so hit enter)</li>
<li>remove anonymous users (say yes)</li>
<li>disallow remote login (in our case we want remote login active so we say no here, but if you&#8217;re using MySQL on a system which will not need this then say yes here)</li>
<li>remove test database and access to it (say yes)</li>
<li>reload all privieleges (say yes)</li>
</ul>
<p>Now you can access MySQL with the following command:</p>
<pre>mysql -p</pre>
<h3>Starting MySQL at boot time</h3>
<p>You will likely need to make sure MySQL is running when you reboot the server, it&#8217;s cumbersome to start it manually every time you do that. This will take care of it:</p>
<pre>chkconfig --levels 235 mysqld on</pre>
<p>We&#8217;re done &#8211; MySQL is now running on your server and yours to populate.</p>
<p>Have fun <img src='http://wpguru.co.uk/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://wpguru.co.uk/2012/04/how-to-install-mysql-on-centos-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to bring back Post Categories in P2</title>
		<link>http://wpguru.co.uk/2012/04/how-to-bring-back-post-categories-in-p2/</link>
		<comments>http://wpguru.co.uk/2012/04/how-to-bring-back-post-categories-in-p2/#comments</comments>
		<pubDate>Mon, 16 Apr 2012 09:24:22 +0000</pubDate>
		<dc:creator>Jay Versluis</dc:creator>
				<category><![CDATA[Themes]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[p2 theme]]></category>

		<guid isPermaLink="false">http://wpguru.co.uk/?p=2101</guid>
		<description><![CDATA[We&#8217;re all excited about the new features in Automattic&#8217;s P2 Theme v1.4.0 &#8211; however many of us have setup custom tweaks around Post Categories. In the latest version these have been replaced with Post Formats. Post Formats are great, but they are limited to values defined in the WordPress core. If you wanted to create [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>We&#8217;re all excited about the new features in Automattic&#8217;s P2 Theme v1.4.0 &#8211; however many of us have setup custom tweaks around Post Categories. In the latest version these have been replaced with Post Formats.</p>
<p>Post Formats are great, but they are limited to values <a href="http://www.google.com/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=1&amp;ved=0CDsQFjAA&amp;url=http%3A%2F%2Fcodex.wordpress.org%2FPost_Formats&amp;ei=l9yLT7aLJamo2wWDvvDfCA&amp;usg=AFQjCNFPSA3EPGcb_TwBu_NBUzkmPR1C6w" target="_blank">defined in the WordPress core</a>. If you wanted to create a new post menu like &#8220;critical&#8221; or &#8220;alarm&#8221; this wouldn&#8217;t work. We could use Custom Post Types to add to those formats, however it&#8217;s way too big an operation for I wanted to achieve: which is bringing back the &#8220;posting into categories&#8221; feature we&#8217;ve come to love from the previous version.</p>
<p>In this article I&#8217;ll show you how to back-port categories so posts will appear as they did in P2 v1.3.3 while retaining all functions of the latest update.</p>
<p><span id="more-2101"></span></p>
<p>I&#8217;ve explained how to tweak labels for the post menu in an <a href="http://wpguru.co.uk/2012/03/how-to-tweak-p2-adding-and-replacing-categories/" target="_blank">earlier post</a> &#8211; instructions for adding and amending labels are still the same. Here we&#8217;ll delve right in to adding a few statements to the P2 code.</p>
<p>Let&#8217;s focus our attention on /inc/ajax.php file which contains our function that creates a new post (line 191). We&#8217;ll leave everything intact here. Have a look at this array first:</p>
<pre>        $post_id = wp_insert_post( array(
            'post_author'   =&gt; $user_id,
            'post_title'    =&gt; $post_title,
            'post_content'  =&gt; $post_content,
            'post_type'     =&gt; 'post',
            'tags_input'    =&gt; $tags,
            'post_status'   =&gt; 'publish'
        ) );</pre>
<p>What&#8217;s missing here is a category definition so let&#8217;s add one to the bottom:</p>
<pre>        $post_id = wp_insert_post( array(
            'post_author'   =&gt; $user_id,
            'post_title'    =&gt; $post_title,
            'post_content'  =&gt; $post_content,
            'post_type'     =&gt; 'post',
            'tags_input'    =&gt; $tags,
            'post_status'   =&gt; 'publish',
            // bringing back P2 categories
            'post_category' =&gt; array( $post_cat-&gt;cat_ID )
            //
        ) );</pre>
<p>This is pretty much what P2 v1.3.3 did. Just above this block we need to grab the post format and set it as our category, then convert the category slug to a numeric value so that we can use it in this array. Only takes two lines of code (one if you make it more complex) &#8211; put them just above the array block:</p>
<pre>         // define $post_cat
        $post_cat = $_POST['post_format'];
        // and turn it into the category ID
        $post_cat = get_category_by_slug( $post_cat );</pre>
<p>Now P2 will look at the Post Format (say &#8216;status&#8217;) and add your post to a category with the same name. If your category does not exist then the post will appear in your default category  as defined under Settings &#8211; Writing.</p>
<p>Here are some screenshots to illustrate the benefits:</p>
<div id="attachment_2103" class="wp-caption aligncenter" style="width: 480px">
	<img class="size-large wp-image-2103" title="Screen Shot 2012-04-16 at 02.14.40" src="http://wpguru.co.uk/wp-content/uploads/2012/04/Screen-Shot-2012-04-16-at-02.14.40-480x200.png" alt="" width="480" height="200" />
	<p class="wp-caption-text">I&#39;ve added my own &quot;Testing&quot; menu item on the front page</p>
</div>
<div id="attachment_2105" class="wp-caption aligncenter" style="width: 480px">
	<img class="size-large wp-image-2105" title="Screen Shot 2012-04-16 at 02.15.04" src="http://wpguru.co.uk/wp-content/uploads/2012/04/Screen-Shot-2012-04-16-at-02.15.04-480x204.png" alt="" width="480" height="204" />
	<p class="wp-caption-text">In the backend all posts are now in their respective categories again - as well as retaining their post format properties</p>
</div>
<p>This tweak will give you everything the new and improved P2 has to offer while still giving you access to all your category amendments and queries.</p>
<p>Enjoy <img src='http://wpguru.co.uk/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://wpguru.co.uk/2012/04/how-to-bring-back-post-categories-in-p2/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>P2 Theme gets an upgrade: say hello to Custom Menus and To-Do List Support</title>
		<link>http://wpguru.co.uk/2012/04/new-features-in-p2-140/</link>
		<comments>http://wpguru.co.uk/2012/04/new-features-in-p2-140/#comments</comments>
		<pubDate>Tue, 10 Apr 2012 17:49:28 +0000</pubDate>
		<dc:creator>Jay Versluis</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[p2 theme]]></category>

		<guid isPermaLink="false">http://wpguru.co.uk/?p=2049</guid>
		<description><![CDATA[Today P2 Version 1.4.0 has been released &#8211; hurra! Thanks for everyone&#8217;s hard work on this amazing theme. P2 now boasts a couple of extra options and plenty of changes under the hood, but like many other great features those are not immediately obvious. Let me show you how the new changes work and how [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Today P2 Version 1.4.0 has been released &#8211; hurra! Thanks for everyone&#8217;s hard work on this amazing theme.</p>
<p>P2 now boasts a couple of extra options and plenty of changes under the hood, but like many other great features those are not immediately obvious. Let me show you how the new changes work and how they can make your P2 experience even better.</p>
<p><span id="more-2049"></span></p>
<h3>To-Do List Feature</h3>
<p>The latest and greatest addition in Version 1.4.0 includes the To-Do List feature. With it you can write lists of things you and your team need to do, and have a record of the things that you&#8217;ve already done. Here&#8217;s what it looks like in action:</p>
<p><img class="aligncenter size-full wp-image-2051" title="Screen Shot 2012-04-10 at 12.53.37" src="http://wpguru.co.uk/wp-content/uploads/2012/04/Screen-Shot-2012-04-10-at-12.53.37.png" alt="" width="407" height="226" /></p>
<p>You can create those by putting each of your to-do items on a separate line and starting it with either a small letter x (for ticked) or a small letter o (for unticked) like this:</p>
<p><img class="aligncenter size-full wp-image-2053" title="Screen Shot 2012-04-10 at 12.56.04" src="http://wpguru.co.uk/wp-content/uploads/2012/04/Screen-Shot-2012-04-10-at-12.56.04.png" alt="" width="444" height="219" /></p>
<p>To change the state of an item, users can simply tick or untick the boxes, and upon page refresh the system will add a strike-thru with a user mention behind the list item (or remove it respectively).</p>
<p><img class="aligncenter size-full wp-image-2135" title="Screen Shot 2012-04-25 at 08.29.51" src="http://wpguru.co.uk/wp-content/uploads/2012/04/Screen-Shot-2012-04-25-at-08.29.51.png" alt="" width="353" height="152" /></p>
<p>Note this does not work for all user roles though &#8211; here&#8217;s a list I&#8217;ve compiled (thanks to a question from Tevya &#8211; otherwise I would have neve found out about this cool feature):</p>
<ul>
<li>Subscribers and Contributors &#8211; can write to-do lists, but can neither tick their own nor other people&#8217;s boxes.</li>
<li>Authors &#8211; can write to-do lists, can tick their own, but not other people&#8217;s boxes.</li>
<li>Editors and Admins &#8211; can write to-do lists and can tick other people&#8217;s boxes.</li>
</ul>
<p>Without the page refresh the tick is there and the system will save it but the mention and strike-thru won&#8217;t be visible. I find this feature incredibly useful.</p>
<h3>Custom Menu Support</h3>
<p>Another great new 1.4.0 feature is the support for custom menus, including drop-down child item support. It&#8217;ll be displayed between your header and your content:</p>
<div id="attachment_2069" class="wp-caption aligncenter" style="width: 479px">
	<img class="size-full wp-image-2069" title="Screen Shot 2012-04-10 at 13.28.25" src="http://wpguru.co.uk/wp-content/uploads/2012/04/Screen-Shot-2012-04-10-at-13.28.25.png" alt="" width="479" height="310" />
	<p class="wp-caption-text">Now we have custom menus in P2 - sweet!</p>
</div>
<p>You can create your own menu under Appearance &#8211; Menus in the WordPress backend.</p>
<h3>Under the Hood: introducing Custom Post Types</h3>
<p>Prior to this version of P2, the posts you created from the front page were automatically filed into one of four categories: status, post, quote and link. I&#8217;ve explained how to change those to your own requirements in <a href="http://wpguru.co.uk/2012/03/how-to-tweak-p2-adding-and-replacing-categories/">this article</a>.</p>
<p>Here&#8217;s a familiar site for P2 posts in versions 1.3.3 and prior:</p>
<div id="attachment_2089" class="wp-caption aligncenter" style="width: 480px">
	<img class="size-large wp-image-2089" title="Screen Shot 2012-04-11 at 21.35.53" src="http://wpguru.co.uk/wp-content/uploads/2012/04/Screen-Shot-2012-04-11-at-21.35.53-480x169.png" alt="" width="480" height="169" />
	<p class="wp-caption-text">P2 v1.3.3 and before used Categories to store your different updates</p>
</div>
<p>Version 1.4.0 utilises WordPress <a href="http://codex.wordpress.org/Post_Types#Custom_Types" target="_blank">Custom Post Types</a> instead. This means that no matter what you select at the top, everything is posted in your default category (defined under Settings &#8211; Writing). Now each post is saved as a custom post type &#8211; apart from Blog Posts which are just standard posts:</p>
<div id="attachment_2091" class="wp-caption aligncenter" style="width: 480px">
	<img class="size-large wp-image-2091" title="Screen Shot 2012-04-11 at 21.49.09" src="http://wpguru.co.uk/wp-content/uploads/2012/04/Screen-Shot-2012-04-11-at-21.49.09-480x169.png" alt="" width="480" height="169" />
	<p class="wp-caption-text">P2 v1.4.0 uses Custom Post Types instead</p>
</div>
<p>This means of course that if you&#8217;ve amended the theme with your own labels and categories, this tweak will no longer work. As soon as we figure out how to override this in Version 1.4.0 I&#8217;ll let you know.</p>
<h3>Link Styling</h3>
<p>Remember the link option that never really did anything? The one that used to confuse everybody? Looks like the team have given it some styling &#8211; now it looks just like a Quote with a blue highlight:</p>
<p><img class="aligncenter size-full wp-image-2093" title="Screen Shot 2012-04-11 at 22.03.20" src="http://wpguru.co.uk/wp-content/uploads/2012/04/Screen-Shot-2012-04-11-at-22.03.20.png" alt="" width="440" height="254" /></p>
<h3>New Santa Background Texture</h3>
<div id="attachment_2087" class="wp-caption alignright" style="width: 272px">
	<img class="size-full wp-image-2087" title="Screen Shot 2012-04-11 at 21.38.08" src="http://wpguru.co.uk/wp-content/uploads/2012/04/Screen-Shot-2012-04-11-at-21.38.08.png" alt="" width="272" height="160" />
	<p class="wp-caption-text">Christmas time is here</p>
</div>
<p>Christmas may be a while off yet, but time melts away like he snow in the sun. When the time is right and you want to add a bit of Xmas Pazazz to your P2 site, head over to Appearance &#8211; Settings and select Santa from the list of included backgrounds.</p>
<h3>Writing Lists with Bullet Points</h3>
<p>On the note of To Do lists, the &#8220;standard lists&#8221; feature has been around for a while, so I thought for completion I&#8217;ll mention it here.</p>
<p>You can create what&#8217;s known as &#8220;unordered lists&#8221; in HTML. Those are the ones starting with bullet points like in this example:</p>
<p><img class="aligncenter size-full wp-image-2077" title="Screen Shot 2012-04-10 at 13.44.55" src="http://wpguru.co.uk/wp-content/uploads/2012/04/Screen-Shot-2012-04-10-at-13.44.55.png" alt="" width="354" height="189" /></p>
<p>&nbsp;</p>
<p>You can write those in a similar way as the to-do lists, just by placing a minus sign in front of each line:</p>
<p><img class="aligncenter size-full wp-image-2079" title="Screen Shot 2012-04-10 at 13.44.39" src="http://wpguru.co.uk/wp-content/uploads/2012/04/Screen-Shot-2012-04-10-at-13.44.39.png" alt="" width="389" height="186" /></p>
<p>&nbsp;</p>
<p>Even though writing those is simple, editing those is a little bit more complex. The way P2 creates the list is by replacing each &#8220;-&#8221; and wrapping the entire line in HTML code needed to display those bullet points. If you hit the EDIT button here&#8217;s what your list looks like:</p>
<p><img class="aligncenter size-full wp-image-2081" title="Screen Shot 2012-04-10 at 13.45.06" src="http://wpguru.co.uk/wp-content/uploads/2012/04/Screen-Shot-2012-04-10-at-13.45.06.png" alt="" width="378" height="194" /></p>
<p>&nbsp;</p>
<p>A brief explanation: an unordered list starts with &lt;ul&gt; and ends with &lt;/ul&gt;. In between, each item starts with &lt;li&gt; and ends with &lt;/li&gt;. So if you want to add an item retrospectively to your list, wrap your line in those &lt;li&gt;&lt;/li&gt; tags and put them above the closing &lt;/ul&gt; tag.</p>
<p>Alternatively, you can always visit your WordPress back end and edit the post in the visual editor.</p>
<h3>Further Reading</h3>
<ul>
<li><a href="http://p2theme.com/" target="_blank">P2&#8242;s Official Website</a></li>
<li><a href="http://wordpress.org/extend/themes/p2" target="_blank">Download P2 at the WordPress Theme Repository</a></li>
<li><a href="http://wordpress.org/tags/p2?forum_id=5" target="_blank">P2 Community Forum</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://wpguru.co.uk/2012/04/new-features-in-p2-140/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>How to show your Linux Version</title>
		<link>http://wpguru.co.uk/2012/04/how-to-show-your-linux-version/</link>
		<comments>http://wpguru.co.uk/2012/04/how-to-show-your-linux-version/#comments</comments>
		<pubDate>Mon, 09 Apr 2012 12:53:38 +0000</pubDate>
		<dc:creator>Jay Versluis</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://wpguru.co.uk/?p=2035</guid>
		<description><![CDATA[Sometimes you&#8217;re working on a system and you&#8217;re not entirely sure which Linux distribution it is. There are several ways to find out what you&#8217;re working with and I keep forgetting what they commands are to get there &#8211; so here&#8217;s a quick list for all of us. Release and Distribution Most systems (but not [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Sometimes you&#8217;re working on a system and you&#8217;re not entirely sure which Linux distribution it is. There are several ways to find out what you&#8217;re working with and I keep forgetting what they commands are to get there &#8211; so here&#8217;s a quick list for all of us.</p>
<h3>Release and Distribution</h3>
<p>Most systems (but not all) have a file called something-release in the /etc directory. On CentOS and Redhat this is /etc/redhat-release. Display the contents of that file and you&#8217;ll find out:</p>
<pre>cat /etc/redhat-release</pre>
<p>This is not going to work on an Ubuntu system for example where the file is called something different. The best approach hence is to call</p>
<pre>cat /etc/*release</pre>
<p>which will give you the output no matter which distribution you&#8217;re on. You may also try</p>
<p>lsb_release -a</p>
<p>however this does not work on all systems. When it does it will typically show you a more detailed output.</p>
<h3>Linux Kernel</h3>
<p>If you want to dig even deeper and find out which Kernel you&#8217;re using, or if you&#8217;re working on a 32/64 bit system, try issuing</p>
<pre>uname -mrs</pre>
<p>which will show you those. Try -a instead for a more detailed output.</p>
<div id="attachment_2039" class="wp-caption aligncenter" style="width: 480px">
	<img class="size-large wp-image-2039" title="Screen Shot 2012-04-09 at 08.52.00" src="http://wpguru.co.uk/wp-content/uploads/2012/04/Screen-Shot-2012-04-09-at-08.52.00-480x320.png" alt="" width="480" height="320" />
	<p class="wp-caption-text">Hubert is running CentOS 5.8 in 64bit. Looks like he needs an upgrade.</p>
</div>
<p style="text-align: center;">Hope this helps <img src='http://wpguru.co.uk/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://wpguru.co.uk/2012/04/how-to-show-your-linux-version/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to use vi to edit files in Linux</title>
		<link>http://wpguru.co.uk/2012/03/how-to-use-vi-to-edit-files-in-linux/</link>
		<comments>http://wpguru.co.uk/2012/03/how-to-use-vi-to-edit-files-in-linux/#comments</comments>
		<pubDate>Sat, 31 Mar 2012 14:01:33 +0000</pubDate>
		<dc:creator>Jay Versluis</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://wpguru.co.uk/?p=2015</guid>
		<description><![CDATA[Here&#8217;s a brief reminder on how you can edit files with vi directly from the command line. Text is all you get, no other visual clues or menus are included, and best of all you need to know each keyboard shortcut once you&#8217;ve entered it. vi is an old editor going back all the way [...]]]></description>
			<content:encoded><![CDATA[<p></p><p><img class="size-medium wp-image-2017 alignright" title="Halftone Tux" src="http://wpguru.co.uk/wp-content/uploads/2012/03/Photo-31-03-2012-09-21-25-257x300.jpg" alt="" width="257" height="300" />Here&#8217;s a brief reminder on how you can edit files with vi directly from the command line. Text is all you get, no other visual clues or menus are included, and best of all you need to know each keyboard shortcut once you&#8217;ve entered it.</p>
<p>vi is an old editor going back all the way to 1976. It&#8217;s not the most comfortable one, but the beauty is that it&#8217;s available on pretty much every distribution. There are several other common editors out there, but it&#8217;s not always an option to install those just for a quick file edit.</p>
<p>In this article I&#8217;ll show you the most commonly used commands and shortcuts, help you delete old versions of a file and show you a couple of links to more in-depth sources.</p>
<p>I assume here that you are comfortable using the command line interface (CLI).</p>
<p><span id="more-2015"></span></p>
<h3>Getting Started</h3>
<p>Invoking vi is pretty straightforward. All you do is type</p>
<p>vi yourfile</p>
<p>That&#8217;ll bring up the interface ready for you to use. If the file does not exist, vi will create it for you if you add content to it and save it later.</p>
<p>You can also prefix your file name with a path and an extension of course:</p>
<p>vi /yourdirectory/yourfile.txt</p>
<div id="attachment_2019" class="wp-caption aligncenter" style="width: 480px">
	<img class="size-large wp-image-2019" title="Screen Shot 2012-03-31 at 09.43.34" src="http://wpguru.co.uk/wp-content/uploads/2012/03/Screen-Shot-2012-03-31-at-09.43.34-480x317.png" alt="" width="480" height="317" />
	<p class="wp-caption-text">Here&#39; I&#39;m editing the license.txt file that comes with WordPress</p>
</div>
<h3>Editing</h3>
<p>Once your displaying content, you can navigate around the document just with your cursor keys or some other handy shortcuts outlined in <a href="http://www.lagmonster.org/docs/vi.html" target="_blank">this handy cheat sheet</a>.</p>
<p>You can invoke editing mode by pressing the a button &#8211; notice the word INSERT being displayed at the bottom of your window. Now you can add and delete text to your heart&#8217;s content.</p>
<p>Notice that there&#8217;s no option to &#8220;mark&#8221; or &#8220;highlight&#8221; a text passage. It&#8217;s not that advanced. It&#8217;ll get you by if all you need is to change a config file though.</p>
<p>Once you&#8217;re done editing, hit the ESCAPE key and you&#8217;ll go back to navigation mode.</p>
<div id="attachment_2021" class="wp-caption aligncenter" style="width: 480px">
	<img class="size-large wp-image-2021" title="Screen Shot 2012-03-31 at 09.51.44" src="http://wpguru.co.uk/wp-content/uploads/2012/03/Screen-Shot-2012-03-31-at-09.51.44-480x317.png" alt="" width="480" height="317" />
	<p class="wp-caption-text">vi in editing mode. As you can see, the interface never really changes.</p>
</div>
<h3>Exiting vi and saving your file</h3>
<p>Now that you&#8217;re out of EDITION mode, press SHIFT-Z twice (ZZ) to save your file. If no changes have been made your file won&#8217;t be saved. However if you&#8217;ve made changes then they WILL be saved &#8211; even though you may not want that.</p>
<p>If you don&#8217;t want your changes to be saved, the only way to leave vi is by typing :q! (I know&#8230; don&#8217;t ask)</p>
<h3>Troubleshooting</h3>
<p>Sometimes &#8211; by accident or deliberation &#8211; it can happen that your SSH connection gets closed before vi can write to an amended file properly. Or, another user may be editing the same file as you.</p>
<p>To make sure that in such cases no file corruption occurs, vi actually writes all changes to a temp file before overwriting the existing file. You may encounter a message like this:</p>
<div id="attachment_2031" class="wp-caption aligncenter" style="width: 480px">
	<img class="size-large wp-image-2031" title="Screen Shot 2012-03-31 at 10.21.46" src="http://wpguru.co.uk/wp-content/uploads/2012/03/Screen-Shot-2012-03-31-at-10.21.46-480x317.png" alt="" width="480" height="317" />
	<p class="wp-caption-text">vi Attention Seeker Message</p>
</div>
<p>This means that a temp file has been found and vi needs you to tell him what to do. You have several options here:</p>
<ul>
<li>hit q or a to exit the session</li>
<li>hit o to just look at  the file but not make any changes to it</li>
<li>hit e to ignore this message and start editing the file (in which case previous edits to the temp file will be overwritten)</li>
<li>hit r to recover previous edits</li>
<li>hit d to delete the temp file (doesn&#8217;t always work)</li>
</ul>
<p>If you persistently get this message, look out for a hidden file called ending with .swp</p>
<p>You can check if there are any in your directory by using the ls -a command.</p>
<h3>Further Reading</h3>
<ul>
<li><a href="http://www.lagmonster.org/docs/vi.html" target="_blank">vi Cheat Sheet</a> by Lagmosnter</li>
<li>in-depth <a href="http://www.eng.hawaii.edu/Tutor/vi.html" target="_blank">vi manual</a> by the University of Hawaii</li>
<li><a href="http://en.wikipedia.org/wiki/Vi" target="_blank">A Brief History of vi</a> on Wikipedia</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://wpguru.co.uk/2012/03/how-to-use-vi-to-edit-files-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to use SFTP with Plesk 10.4.4</title>
		<link>http://wpguru.co.uk/2012/03/how-to-use-sftp-with-plesk-10-4-4/</link>
		<comments>http://wpguru.co.uk/2012/03/how-to-use-sftp-with-plesk-10-4-4/#comments</comments>
		<pubDate>Sun, 25 Mar 2012 16:50:17 +0000</pubDate>
		<dc:creator>Jay Versluis</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Plesk]]></category>

		<guid isPermaLink="false">http://wpguru.co.uk/?p=2001</guid>
		<description><![CDATA[We had a discussion recently about using SFTP under Plesk 10. It&#8217;s possible, however the feature is not called SFTP explicitly so I thought it&#8217;s best to describe how it works here. Note that SFTP is only possible for the main domain owner, not for additional FTP Users that you may create under Web Users&#8230; [...]]]></description>
			<content:encoded><![CDATA[<p></p><p><img class="alignright size-full wp-image-1653" title="Plesk-Logo" src="http://wpguru.co.uk/wp-content/uploads/2011/11/Plesk-Logo.png" alt="" width="170" height="170" />We had a discussion recently about using SFTP under Plesk 10. It&#8217;s possible, however the feature is not called SFTP explicitly so I thought it&#8217;s best to describe how it works here.</p>
<p>Note that SFTP is only possible for the main domain owner, not for additional FTP Users that you may create under Web Users&#8230; sorry! Here&#8217;s the <a href="http://kb.parallels.com/en/9173" target="_blank">Parallels Knowledgebase article</a> which explains why.</p>
<p>That said, here&#8217;s how you activate SFTP for your account:</p>
<p><span id="more-2001"></span>Once logged in to your Plesk Panel, head over to Websites and Domains. Next check FTP Access.</p>
<p><img class="aligncenter size-full wp-image-2003" title="Screen Shot 2012-03-25 at 12.43.02" src="http://wpguru.co.uk/wp-content/uploads/2012/03/Screen-Shot-2012-03-25-at-12.43.02.png" alt="" width="393" height="387" /></p>
<p>In here, select your FTP user. Up comes a drop down menu that lets you select several options under &#8220;Access to the server over SSH&#8221; &#8211; by default this is set to &#8220;forbidden&#8221;.</p>
<p><img class="aligncenter size-full wp-image-2007" title="Screen Shot 2012-03-25 at 12.43.44" src="http://wpguru.co.uk/wp-content/uploads/2012/03/Screen-Shot-2012-03-25-at-12.43.44.png" alt="" width="524" height="205" /></p>
<p>Go ahead and select the option /bin/bash (chrooted) from the list and hit OK.</p>
<p><img class="aligncenter size-full wp-image-2005" title="Screen Shot 2012-03-25 at 12.44.01" src="http://wpguru.co.uk/wp-content/uploads/2012/03/Screen-Shot-2012-03-25-at-12.44.01.png" alt="" width="324" height="84" /></p>
<p>Note that there are two options in here that look extremely similar:</p>
<ul>
<li>/bin/bash &lt;&lt;&#8211; you don&#8217;t want this</li>
<li>/bin/bash (chrooted) &lt;&lt;&#8211; this is what you want</li>
</ul>
<p>Hit save and you can now use SFTP. Have fun.</p>
]]></content:encoded>
			<wfw:commentRss>http://wpguru.co.uk/2012/03/how-to-use-sftp-with-plesk-10-4-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to tweak P2: adding and replacing categories</title>
		<link>http://wpguru.co.uk/2012/03/how-to-tweak-p2-adding-and-replacing-categories/</link>
		<comments>http://wpguru.co.uk/2012/03/how-to-tweak-p2-adding-and-replacing-categories/#comments</comments>
		<pubDate>Sat, 24 Mar 2012 16:50:44 +0000</pubDate>
		<dc:creator>Jay Versluis</dc:creator>
				<category><![CDATA[Themes]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[p2 theme]]></category>

		<guid isPermaLink="false">http://wpguru.co.uk/?p=1949</guid>
		<description><![CDATA[Today I&#8217;m going to tweak the marvellous P2 Theme by Automattic. P2 is one of my all time favourite themes &#8211; not only because it transforms WordPress into something completely different, but also because it&#8217;s an innovative way we communicate internally here at WP Hosting. If you don&#8217;t know P2 yet, do check it out [...]]]></description>
			<content:encoded><![CDATA[<p></p><p><img class="alignright size-full wp-image-1987" title="Screen Shot 2012-03-24 at 12.21.12" src="http://wpguru.co.uk/wp-content/uploads/2012/03/Screen-Shot-2012-03-24-at-12.21.12.png" alt="" width="158" height="131" />Today I&#8217;m going to tweak the marvellous <a href="http://p2theme.com" target="_blank">P2 Theme by Automattic</a>.</p>
<p>P2 is one of my all time favourite themes &#8211; not only because it transforms WordPress into something completely different, but also because it&#8217;s an innovative way we communicate internally here at WP Hosting. If you don&#8217;t know P2 yet, do check it out at p2theme.com and watch the video.</p>
<p class="note">At the time of writing P2 is at Version 1.3.3 and has been since November last year. Code changes quickly, so by the time you&#8217;re reading this my ramblings may be out of date.</p>
<p>Let&#8217;s have a look at how we can add and amend the default categories (i.e. Status Update, Blog Post, Quote and Link).</p>
<p><span id="more-1949"></span></p>
<h3>Changing the Labels</h3>
<p>We&#8217;ll start by looking at how to change the labels at the top here:</p>
<div id="attachment_1951" class="wp-caption aligncenter" style="width: 407px">
	<img class="size-full wp-image-1951" title="P2 Screen Shot" src="http://wpguru.co.uk/wp-content/uploads/2012/03/Screen-Shot-2012-03-23-at-20.33.02.png" alt="" width="407" height="192" />
	<p class="wp-caption-text">P2 default categories - these are hard coded in Version 1.3.3</p>
</div>
<p>Take a look at a file called post-form.php in the root of the P2 directory. In it you&#8217;ll find this cryptic block of code:</p>
<pre>&lt;div id="postbox"&gt;
 &lt;ul id="post-types"&gt;
 &lt;li&gt;&lt;a id="status"&lt;?php if ( $post_type == 'status' ) : ?&gt;&lt;?php endif; ?&gt; href="&lt;?php echo site_url( '?p=status' ); ?&gt;" title="&lt;?php esc_attr_e( 'Status Update', 'p2' ); ?&gt;"&gt;&lt;?php _e( 'Status Update', 'p2' ); ?&gt;&lt;/a&gt;&lt;/li&gt;
 &lt;li&gt;&lt;a id="post"&lt;?php if ( $post_type == 'post' ) : ?&gt;&lt;?php endif; ?&gt; href="&lt;?php echo site_url( '?p=post' ); ?&gt;" title="&lt;?php esc_attr_e( 'Blog Post', 'p2' ); ?&gt;"&gt;&lt;?php _e( 'Blog Post', 'p2' ); ?&gt;&lt;/a&gt;&lt;/li&gt;
 &lt;li&gt;&lt;a id="link"&lt;?php if ( $post_type == 'link' ) : ?&gt;&lt;?php endif; ?&gt; href="&lt;?php echo site_url( '?p=link' ); ?&gt;" title="&lt;?php esc_attr_e( 'Link', 'p2' ); ?&gt;"&gt;&lt;?php _e( 'Link', 'p2' ); ?&gt;&lt;/a&gt;&lt;/li&gt;
 &lt;/ul&gt;</pre>
<p>This is an unordered list which displays the tabs, let&#8217;s call it the Post Menu for reference.</p>
<p>Notice how each item gets referred to a number of times here. The last two items in each line (for example &#8216;Status Update&#8217;) are the ID and displayed text. If all you want to do is change those labels, then go ahead and replace them with anything you like:</p>
<pre>&lt;li&gt;&lt;a id="status"&lt;?php if ( $post_type == 'status' ) : ?&gt;&lt;?php endif; ?&gt; href="&lt;?php echo site_url( '?p=status' ); ?&gt;" title="&lt;?php esc_attr_e( 'My Label', 'p2' ); ?&gt;"&gt;&lt;?php _e( 'My Label', 'p2' ); ?&gt;&lt;/a&gt;&lt;/li&gt;</pre>
<p>It&#8217;ll result in something like this:</p>
<div id="attachment_1953" class="wp-caption aligncenter" style="width: 383px">
	<img class="size-full wp-image-1953" title="Screen Shot 2012-03-23 at 20.40.13" src="http://wpguru.co.uk/wp-content/uploads/2012/03/Screen-Shot-2012-03-23-at-20.40.13.png" alt="" width="383" height="188" />
	<p class="wp-caption-text">Status Update now reads My Label - but it stills posts into &#39;status&#39;</p>
</div>
<p>If you post something with your new option highlighted, it will still be posted in the &#8220;status&#8221; category. The same goes for all four options &#8211; you can change the label with this option, but not the actual post category.</p>
<h3>Adding new Categories</h3>
<p>You&#8217;ll probably want to add your own category buttons, or perhaps change the existing categories to something else.</p>
<p>If you just go ahead and tweak the existing values, you&#8217;ll notice that P2 ignores your changes and posts everything in &#8220;status&#8221;. Let me assure you: you&#8217;re not mad, it&#8217;s just how P2 rolls:</p>
<pre>&lt;li&gt;&lt;a id="mycategory"&lt;?php if ( $post_type == 'mycategory' ) : ?&gt;&lt;?php endif; ?&gt; href="&lt;?php echo site_url( '?p=mycategory' ); ?&gt;" title="&lt;?php esc_attr_e( 'My Label', 'p2' ); ?&gt;"&gt;&lt;?php _e( 'My Label', 'p2' ); ?&gt;&lt;/a&gt;&lt;/li&gt;</pre>
<p>The reason for this is that there&#8217;s an array defined somewhere and the theme checks if you&#8217;re posting in any of those &#8220;valid&#8221; categories. Thanks to Nobble for mentioning this <a href="http://wordpress.org/support/topic/can-default-category-be-allowed-to-pass-through-accepted_post_cats-in-p2-theme" target="_blank">over a year ago on the WordPress Forum</a>.</p>
<p>Let&#8217;s take a look at ajax.php (it&#8217;s in a sub-folder called inc). Halfway down the file we&#8217;ll see the array being defined:</p>
<pre>$accepted_post_cats = apply_filters( 'p2_accepted_post_cats', array( 'post', 'quote', 'status', 'link' ) );
$post_cat = ( in_array( $_POST['post_cat'], $accepted_post_cats ) ) ? $_POST['post_cat'] : 'status';</pre>
<p>The first line defines the array of valid categories, and the second line makes sure that the category gets set to &#8220;status&#8221; if yours does not exist.</p>
<p>I always think it&#8217;s best to leave things as they are and just add to stuff for compatibility, so I&#8217;m adding &#8216;mycategory&#8217; to the array like so:</p>
<pre>$accepted_post_cats = apply_filters( 'p2_accepted_post_cats', array( 'post', 'quote', 'status', 'link', 'mycategory' ) );</pre>
<p>Wonderful! Notice that this will now create a new category or post in the existing one. Exactly what we want!</p>
<p>But how do we add our own items to the Post Menu? Let&#8217;s find out next.</p>
]]></content:encoded>
			<wfw:commentRss>http://wpguru.co.uk/2012/03/how-to-tweak-p2-adding-and-replacing-categories/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Snapshot Backup 2.1</title>
		<link>http://wpguru.co.uk/2012/03/snapshot-backup-2-1/</link>
		<comments>http://wpguru.co.uk/2012/03/snapshot-backup-2-1/#comments</comments>
		<pubDate>Thu, 15 Mar 2012 20:21:24 +0000</pubDate>
		<dc:creator>Jay Versluis</dc:creator>
				<category><![CDATA[Snapshot Backup Devlog]]></category>

		<guid isPermaLink="false">http://wpguru.co.uk/?p=1901</guid>
		<description><![CDATA[After over 20.000 downloads and one day before &#8220;the new iPad&#8221; hits the shelves, I give you an update on Snapshot Backup. I have finally found the time this week to work again on this project. It&#8217;s been too long, (8 months since my last update) but better late than never. It&#8217;s like a good [...]]]></description>
			<content:encoded><![CDATA[<p></p><p><img class="alignright size-full wp-image-1454" title="Snapshot-Header" src="http://wpguru.co.uk/wp-content/uploads/2011/07/Snapshot-Header.png" alt="" width="280" height="106" />After over 20.000 downloads and one day before &#8220;the new iPad&#8221; hits the shelves, I give you an update on Snapshot Backup. I have finally found the time this week to work again on this project. It&#8217;s been too long, (8 months since my last update) but better late than never. It&#8217;s like a good wine.</p>
<p>I&#8217;ll tell you upfront: if this was easy for me, and it wouldn&#8217;t have taken this long if my knowledge of PHP was better. The latest version is available immediately from the <a href="http://wordpress.org/extend/plugins/snapshot-backup/" target="_blank">WordPress repository</a>.</p>
<p>Here&#8217;s what I&#8217;ve been slaving away over, and what&#8217;s new in Version 2.1</p>
<p><span id="more-1901"></span></p>
<h3>Added Security</h3>
<p>As I said before, I&#8217;m not a coder &#8211; hence I don&#8217;t know many of the common practices of code sanitation and security implementation. Up until now this was something I was concerned about, but didn&#8217;t know much about.</p>
<p><a href="http://www.ait-pro.com/" target="_blank">Ed from AIT PRO</a> got in touch on the Forum and gave me some vital tips on how to add security to this plugin. Even tough it took me 4 months to implement those, I can sleep better at night for having done so. Files can no longer be called directly, and all FTP connections are now secured with proper checks.</p>
<p>Sadly I couldn&#8217;t implement these into all files, because some are included from within the script which means the automation stops working. Alas, some aspects have improved. I still have the nonces in forms to deal with next time round.</p>
<p>Thanks Ed, for your suggestions and your patience. Ed by the way is responsible for the <a href="http://wordpress.org/extend/plugins/bulletproof-security/" target="_blank">Bullet Proof Security Plugin</a> &#8211; do check it out.</p>
<h3>Automation Bug Fix</h3>
<p>Some of you have reported that Snapshot spawns various processes and even creates files every two minutes even though the Automation Feature is definitely switched off. I went back to the drawing board and complete re-wrote the process.</p>
<p>Scheduled tasks were not properly terminated and just &#8220;lurked&#8221; around &#8211; and they don&#8217;t get cleared automatically, so I&#8217;ve unscheduled those processes properly now.</p>
<p>What helped me a lot was a super handy plugin called <a href="http://www.simonwheatley.co.uk/wordpress/cron-view/" target="_blank">Cron View by Simon Wheatley</a>. This little gem shows all WP Cron processes on a single page, and with it I was able to see that Snapshot was in fact doing stuff every minute when the option was set to not use automation at all.</p>
<p>Thanks Simon, Cron View pointed me in the right direction!</p>
<h3>The Empty Database Problem</h3>
<p>Some of you told me that the .sql files were empty, but I could never reproduce the problem. Until one day &#8211; and I couldn&#8217;t explain it. Sleepless nights later I found the culprit: special characters in the database password. A dollar sign ($) for example.</p>
<p>Turns out that the mysqldump command differentiates between the -p option and the &#8211;password= option. The latter lets you call it WITH special characters, the other doesn&#8217;t. Who would have known? Is this documented anywhere? Guess it isn&#8217;t and I had to find out the hard way.</p>
<p>So just for the curious:</p>
<pre>mysqldump -h host -u user -ppa$$word &gt; file.sql</pre>
<p>doesn&#8217;t work. Try it out on the command line, you&#8217;ll get an error message. What WILL work however is this:</p>
<pre>mysqldump -h host -u user --password='pa$$word' &gt; file.sql</pre>
<p>No matter what characters the password has, this command will read out the database and produce a file. If it does not, please let me know.</p>
<p>To make it easy for us I&#8217;ve added a line which displays the size of your database when you create a snapshot manually.</p>
<h3>Custom FTP Port</h3>
<p>If you&#8217;re using anything other than the default port 21 you can now tell the plugin and it will obey. You can set this under &#8220;settings&#8221;. If you don&#8217;t specify anything here it&#8217;ll default to port 21.</p>
<h3>Newsletter</h3>
<p><a href="http://eepurl.com/j1Hzj" target="_blank"><img class="alignright  wp-image-1921" title="snapshot-qr" src="http://wpguru.co.uk/wp-content/uploads/2012/03/snapshot-qr-300x300.png" alt="" width="150" height="150" /></a>If you&#8217;d like to stay in touch with the latest developments of this plugin, then the easiest way is to signup to a new newsletter we&#8217;ve devised. When new things are happening, such as beta versions, pro versions, new features, you can find out before general release.</p>
<p><a href="http://eepurl.com/j1Hzj" target="_blank">Click here to sign up</a> &#8211; no viagra offers or any other spam, I promise! Or can this uber cool killer high-tech QR code with your advanced high-tech mobile device (like the iPad 3 with Retina Display and all).</p>
<h3>Other minor changes</h3>
<ul>
<li>Removed horrible red box from main screen</li>
<li>Test FTP Button now saves as well as tests settings</li>
<li>Blank sub-directory no longer gives error message</li>
<li>Fixed leading slash display bug in Manage Snapshots menu</li>
<li>Added cute Menu Icon (thanks to Dirceau from fasticon.com)</li>
<li>Removed promises I can&#8217;t keep</li>
</ul>
<h3>Things that didn&#8217;t make it this time</h3>
<p>I&#8217;ve tried to implement another archiving engine since some of you have reported that Snapshot is hogging resources on crowded servers. This is due to the low level TAR command which knows no boundaries &#8211; it uses most of the CPU resources on offer, which cheap oversold hosting providers frown upon.</p>
<p>To combat this I&#8217;ve looked into throttling the command &#8211; however the only approach I found was via a Python script (and since I know nothing of Python ruled this out).</p>
<p>Instead of TAR, I&#8217;ve also tried PHAR which is available on installations with PHP 5.3 and above. Sadly I cannot make head or tail of how on earth to make it work so I gave up for now. I think this could be a way to let PHP deal with the tarball rather than Linux. It would also make it possible for Snapshot to run on Windows servers.</p>
<p>Some day I&#8217;m sure I&#8217;ll figure it out &#8211; but that&#8217;s not today.</p>
<h3>Closing Thoughts</h3>
<p>I&#8217;ve started this plugin because I wanted to have one just like this. All other variations were too complex, too expensive, or too something else. I wanted a one-click solution which is extremely easy to use.</p>
<p>Hence I&#8217;m the visionary of what I wanted to use, but not an ideal executor &#8211; that&#8217;s why it took me ages to get back to an update. Sadly I&#8217;m not a PHP coder so things that take a coder an hour take me about a week (not to mention frustration and pain). I&#8217;m enduring it because I believe in the project &#8211; and deep down I believe I can learn a little bit every time.</p>
<p>Hopefully I can push out smaller updates more frequently in the future &#8211; I have so many other ideas of what this plugin could turn into. I&#8217;d like to try and implement different storage options next &#8211; so watch this space.</p>
<p>I hope you enjoy this version of Snapshot Backup, a lot of time and effort has gone into it. As always, I welcome your thoughts in a comment below.</p>
<p>Until next time <img src='http://wpguru.co.uk/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://wpguru.co.uk/2012/03/snapshot-backup-2-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to install CentOS on your laptop with Parallels Desktop</title>
		<link>http://wpguru.co.uk/2012/03/how-to-install-centos-on-your-laptop-with-parallels-desktop/</link>
		<comments>http://wpguru.co.uk/2012/03/how-to-install-centos-on-your-laptop-with-parallels-desktop/#comments</comments>
		<pubDate>Sun, 04 Mar 2012 00:32:39 +0000</pubDate>
		<dc:creator>Jay Versluis</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://wpguru.co.uk/?p=1861</guid>
		<description><![CDATA[You can never have enough servers flying around, be that for testing, playing or developing. Today I decided that I wanted my local copy of CentOS on my Mac Book Pro &#8211; and thanks to Parallels Desktop I can run this in a virtual container alongside Mac OS X. Nice! It&#8217;s a bit complex so [...]]]></description>
			<content:encoded><![CDATA[<p></p><p><img class="alignright size-medium wp-image-555" title="CentOS" src="http://wpguru.co.uk/wp-content/uploads/2010/08/CentOS-300x114.jpg" alt="" width="300" height="114" />You can never have enough servers flying around, be that for testing, playing or developing. Today I decided that I wanted my local copy of CentOS on my Mac Book Pro &#8211; and thanks to Parallels Desktop I can run this in a virtual container alongside Mac OS X. Nice!</p>
<p>It&#8217;s a bit complex so I took some notes &#8211; may they be useful for both you and me at some point in the future.</p>
<p>I&#8217;m installing CentOS 6.2 in 64bit on OS X Lion on a 13&#8243; Mac Book Pro with 8GB of RAM and an Intel i7. I&#8217;m using Parallels Desktop 7 for this exercise.</p>
<p><span id="more-1861"></span></p>
<h3>Installing Parallels Desktop</h3>
<p><img class="alignright size-full wp-image-1653" title="Plesk-Logo" src="http://wpguru.co.uk/wp-content/uploads/2011/11/Plesk-Logo.png" alt="" width="170" height="170" />You can get a free trial version of Parallels Desktop and see if it floats your boat. You can download it here: <a href="http://www.parallels.com/products/desktop" target="_blank">http://www.parallels.com/products/desktop</a> and install it. They&#8217;ll email you an activation code. Pop it in and you&#8217;re good to go.</p>
<p>Since this product is geared towards people wanting to run Windows on their Macs its emphasis is on you either buying a copy of Windows through the interface, or installing a copy from disk. There are also quick links to other Linux distributions on the bottom, none of them are CentOS though.</p>
<p>So we&#8217;ll choose option 2 (i.e. Install Windows from a disk or image) and choose an ISO image we&#8217;d like to install. This will be the netinstall.iso file we&#8217;re downloading in the next step.</p>
<h3>Downloading the CentOS installer</h3>
<p>Next we&#8217;ll want to get hold of an autoinstaller for CentOS. In version 6 this process has changed compared to previous versions. We&#8217;ll want to first download a file called netinstall.iso from any of the mirrors, like this one here:</p>
<p><a href="http://mirror.flhsi.com/centos/6.2/isos/x86_64/" target="_blank">http://mirror.flhsi.com/centos/6.2/isos/x86_64/</a></p>
<p>I&#8217;m sure you can start the installation straight from a URL but I haven&#8217;t tired this. Once the file is downlaoded, choose it from the Parallels Desktop Installer and it will create a new virtual container. Then the installation begins.</p>
<p>Parallels Desktop will give you the opportunity to configure the container: how much RAM, how much hard drive space, etc. Go with the defaults here, or ramp up the RAM if you have it. I went with 2GB for now, but depending on what you&#8217;d like to do with your environment you may want to increase this a little. Make sure you leave some room for your actual Mac OS of course&#8230;</p>
<h3>Installing CentOS virtually</h3>
<p>The first question the installer will ask is &#8220;where is the rest of the files&#8221;? Give it the following URL to make it happy:</p>
<p>http://mirror.centos.org/centos/6.2/os/x86_64/</p>
<p>It can now download everything else it needs automatically. The next question you&#8217;ll be asked is about special storage systems. Go with the first option and click OK.</p>
<p>Next up is &#8220;what shall I do with the files on this hard drive&#8221;? Remember this is all virtual so deleting all files doesn&#8217;t meant your Mac HDD gets wiped. Select &#8220;delete all data&#8221; (the default) and you&#8217;ll still be OK. Trust me on this&#8230;</p>
<p>Once you&#8217;ve chosen your root password and timezone, you&#8217;ll have to decide what kind of system you&#8217;d like to run here. Your choices are minimal system, web server, virtual host, development machine and some others. I chose virtual host because I&#8217;d like to use this system just as I use my remote servers. The main difference here are the installed services and the absence / presence of the GUI.</p>
<p>If you&#8217;re not sure, remember that you can install as many virtual machines as you have hard drive space available &#8211; and you can just as easily delete / clone / backup / restore the ones you&#8217;ve created. Don&#8217;t be shy, try them all (if you have the time).</p>
<p>Once you make your decision, installation is under full way and can take about 20mins. Grab a cup of tea and come back to be greeted by a prompt to &#8220;reboot your machine&#8221;. Let&#8217;s do that.</p>
<h3>Hello CentOS!</h3>
<p>After the reboot, your system will greet you with a black login screen, just the way we love it from our Terminal or PuTTY application. Log on as root and hack away.</p>
<p><img class="aligncenter size-large wp-image-1865" title="Screen Shot 2012-03-03 at 19.31.40" src="http://wpguru.co.uk/wp-content/uploads/2012/03/Screen-Shot-2012-03-03-at-19.31.40-480x303.png" alt="" width="480" height="303" /></p>
<h3>Further Reading</h3>
<p>These articles have helped me in my journey to local CentOSness:</p>
<ul>
<li><a href="http://scottlinux.com/2011/07/17/centos-6-netinstall-url/">http://scottlinux.com/2011/07/17/centos-6-netinstall-url/</a></li>
<li><a href="http://steveswinsburg.wordpress.com/2011/07/12/centos-6-remote-net-install/">http://steveswinsburg.wordpress.com/2011/07/12/centos-6-remote-net-install/</a></li>
<li>List of <a href="http://www.centos.org/modules/tinycontent/index.php?id=30" target="_blank">CentOS Mirrors at http://centos.org</a></li>
<li>Download <a href="http://www.parallels.com/products/desktop">Parallels Desktop for Mac</a></li>
</ul>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://wpguru.co.uk/2012/03/how-to-install-centos-on-your-laptop-with-parallels-desktop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to remove Customer and Business Manager in Plesk</title>
		<link>http://wpguru.co.uk/2012/02/how-to-remove-customer-and-business-manager-in-plesk/</link>
		<comments>http://wpguru.co.uk/2012/02/how-to-remove-customer-and-business-manager-in-plesk/#comments</comments>
		<pubDate>Mon, 20 Feb 2012 00:38:04 +0000</pubDate>
		<dc:creator>Jay Versluis</dc:creator>
				<category><![CDATA[Plesk]]></category>

		<guid isPermaLink="false">http://wpguru.co.uk/?p=1843</guid>
		<description><![CDATA[One of the questions that came up at Parallels Summit recently was how to uninstall Customer and Business manager. Plesk doesn&#8217;t offer a solution to uninstall things &#8211; even though you can add modules, once they&#8217;re installed they&#8217;re installed. Luckily I remember a good forum thread that&#8217;s a bit long so I&#8217;ll give you a [...]]]></description>
			<content:encoded><![CDATA[<p></p><div id="attachment_1853" class="wp-caption alignright" style="width: 204px">
	<img class="size-full wp-image-1853" title="Let's remove those links" src="http://wpguru.co.uk/wp-content/uploads/2012/02/Screen-Shot-2012-02-19-at-19.56.37.png" alt="" width="204" height="113" />
	<p class="wp-caption-text">Let&#39;s remove those links</p>
</div>
<p>One of the questions that came up at Parallels Summit recently was how to uninstall Customer and Business manager. Plesk doesn&#8217;t offer a solution to uninstall things &#8211; even though you can add modules, once they&#8217;re installed they&#8217;re installed.</p>
<p>Luckily I remember a good forum thread that&#8217;s a bit long so I&#8217;ll give you a concise version here.</p>
<p>Note: this works in Plesk 10.4.4 for Linux &#8211; I haven&#8217;t tried earlier or later versions at the time of writing. If you have any feedback, please leave a comment.</p>
<p><span id="more-1843"></span></p>
<h3>Part 1: Removing the RPM package</h3>
<p>Log in with your favourite SSH tool and issue the following command as root:</p>
<pre>rpm -e plesk-billing</pre>
<p>Now the files are removed, however the Plesk GUI will still tell you that &#8220;the installation was successful&#8221; and if you click the link provided it&#8217;ll be re-installed. So ignore that link and move on to</p>
<h3>Part 2: Database Cleanup</h3>
<p>Head over to the phpMyAdmin tool (under Tools and Settings &#8211; Database Servers) and open the psa database. In it you&#8217;ll find two values which we need to clear out.</p>
<p>Find a table called &#8216;cl_param&#8217;, then delete the value &#8216;ppb-url&#8217;. Restart plesk from the command line via</p>
<pre>service psa restart</pre>
<p>When you log back in, Customer and Business Manager should be history &#8211; including all those extra links on the left hand side.</p>
<h3>Live Demo</h3>
<p>While writing this article I&#8217;ve actually done this on one of my systems &#8211; follow my steps here if you like:</p>
<p><iframe width="500" height="375" src="http://www.youtube.com/embed/WzKWDoNftmg?fs=1&#038;feature=oembed" frameborder="0" allowfullscreen></iframe></p>
<h3>Further Reading</h3>
<p>Here&#8217;s the original <a href="http://forum.parallels.com/showthread.php?t=105577&amp;highlight=remove+billing" target="_blank">forum thread</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://wpguru.co.uk/2012/02/how-to-remove-customer-and-business-manager-in-plesk/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>FIXED: The Problem with running PHP as FastCGI Application (WordPress and Plesk)</title>
		<link>http://wpguru.co.uk/2012/02/the-problem-with-running-php-as-fastcgi-application/</link>
		<comments>http://wpguru.co.uk/2012/02/the-problem-with-running-php-as-fastcgi-application/#comments</comments>
		<pubDate>Mon, 13 Feb 2012 14:01:21 +0000</pubDate>
		<dc:creator>Jay Versluis</dc:creator>
				<category><![CDATA[Plesk]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[FastCGI]]></category>
		<category><![CDATA[mod_fcgid]]></category>

		<guid isPermaLink="false">http://wpguru.co.uk/?p=1835</guid>
		<description><![CDATA[We&#8217;re currently on our way to Kissimmee, FL to join Parallels Summmit, an annual conference from the people who make Plesk. We&#8217;re also taking exams in Plesk 10.4.4 so we&#8217;re studying it in-depth &#8211; I&#8217;ve been using the software for over two years now but never had formal training in it. Well here goes! In [...]]]></description>
			<content:encoded><![CDATA[<p></p><p><img class="alignright size-full wp-image-1653" title="Plesk-Logo" src="http://wpguru.co.uk/wp-content/uploads/2011/11/Plesk-Logo.png" alt="" width="170" height="170" />We&#8217;re currently on our way to Kissimmee, FL to join Parallels Summmit, an annual conference from the people who make Plesk. We&#8217;re also taking exams in Plesk 10.4.4 so we&#8217;re studying it in-depth &#8211; I&#8217;ve been using the software for over two years now but never had formal training in it. Well here goes!</p>
<p>In preparation for the exam tomorrow I&#8217;ve come across something the instructor mentioned: namely the benefits of running PHP as a FastCGI application instead of an Apache module. Sadly I&#8217;ve also come across some drawbacks when using this option in regards to WordPress. I thought I&#8217;d mention those here, alongside how to avoid those.</p>
<p>UPDATE: Thanks to Boldock this problem can be fixed <img src='http://wpguru.co.uk/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p><span id="more-1835"></span></p>
<h3>Apache Module vs. FastCGI</h3>
<p>First of all let&#8217;s have a look at why you&#8217;d want to run PHP as anything other than an Apache module. More times than I can count I&#8217;ve had to tweak ownership or file permissions in WordPress installations to make WordPress read / write / amend files &#8211; it needs this to use many of the cool features, such image uploads or one-click upgrades.</p>
<p>If PHP is run as an Apache Module, then when WordPress creates a file it does this as the &#8220;apache&#8221; user. Similarly, when it needs overwrite files it needs those files to be writable by the Apache group, or the files need to be owned by &#8220;apache&#8221; (or they need to be 777 so that everyone can overwrite them &#8211; which is not good).</p>
<p>If PHP would instead be run as FastCGI, then the actual file owner of the account could let PHP write to it&#8217;s own files &#8211; they woulnd&#8217;t need to be &#8220;apache&#8221; owned nor writable. That&#8217;s great news. Imagine you had 100 websites and all files would be owned by &#8220;apache&#8221; &#8211; it would be a nightmare to track down if a script has gone awry which site it originated from. Therefore, FastCGI is a dream come true. If it would work properly that is.</p>
<h3>The Drawbacks for WordPress</h3>
<p>Turns out that there are also a couple of drawbacks in regards to WordPress when it comes to using this new Plesk feature:</p>
<p>I tried to install a theme via the ZIP uploader (Over Easy by Woo Themes, it&#8217;s 909k in size so not very big), and all I got was a reproducible 500 Internal Server Error. This did not happen when I switched PHP back to being run as an Apache Module.</p>
<p>Also, mobile posting via WordPress for iOS does not work for image sizes large and above. Small and medium sizes still work, but the app gives a &#8220;Blog returned invalid data&#8221; error &#8211; not so when run as an Apache Module.</p>
<p>This could be a bug in Plesk, this could be a memory problem somewhere &#8211; I&#8217;ll certainly bring it up at the summit. Maybe all uploads of a certain size have a problem, even though it&#8217;s not related to the PHP max memory sizes (if tested it with up to 6GB!).</p>
<h3>The Solution</h3>
<p>The reason this seems to be happening is that FastCGI is running low on memory. By default the Apache configuration does not include a statement to allocate enough memory, but we can do this by adding the following line to httpd.conf (thanks to <a href="http://wpburo.com" target="_blank">Baldock</a> for this tip):</p>
<pre>FcgidMaxRequestLen 33554432</pre>
<p>Restart Apache with &#8220;service httpd restart&#8221; and all your troubles go away.</p>
<h3>Conclusion</h3>
<p>FastCGI is a great idea in principle, and if your applications play ball then I&#8217;d vote for this option any time. However, if things don’t work out you need to find another way.</p>
<p>Adding the above to your apache config is one option, but only possible if you&#8217;re running a dedicated server or VPS. If that&#8217;s not the case, you can also switch PHP back to be run as standard CGI Application. It still works fine and provides site isolation over an Apache module.</p>
<p>There are a few other options you have: suPHP, mod_ruid2 and mpm-itk are things to look into, but that&#8217;s a bit more hard core to implement. See below for this suggestion from the Parallels Forum.</p>
<p>If everything else fails, I&#8217;m afraid you&#8217;re stuck with an Apache module and file permission hell.</p>
<p>Either way, stay sane&#8230;</p>
<h3>Further Reading</h3>
<p>Here are some useful links discussing this issue. I&#8217;ll add my own future findings on the comments below &#8211; feel free contribute.</p>
<ul>
<li>We&#8217;re discussing this topic in the <a href="http://wordpress.org/support/topic/php-support-fastcgi-or-apache-module" target="_blank">WordPress Forum</a> &#8211; check out an excellent guide by Luke America</li>
<li>Paul&#8217;s blog Return True shows another alternative: <a href="http://return-true.com/2010/05/wordpress-php-cgi-vs-php-fcgi/" target="_blank">we can use CGI instead of FastCGI</a></li>
<li><a href="http://httpd.apache.org/mod_fcgid/" target="_blank">FastCGI Homepage</a> on the Apache Website</li>
<li><a href="http://forum.parallels.com/showthread.php?s=476cd8e22a8e29c9af039622667d3b1b&amp;p=618347#post618347" target="_blank">Parallels Forum Thread</a> showing two other options: mod_ruid2 and mpm-itk</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://wpguru.co.uk/2012/02/the-problem-with-running-php-as-fastcgi-application/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>How to deploy HyperDB</title>
		<link>http://wpguru.co.uk/2012/01/how-to-deploy-hyperdb/</link>
		<comments>http://wpguru.co.uk/2012/01/how-to-deploy-hyperdb/#comments</comments>
		<pubDate>Sat, 28 Jan 2012 11:42:09 +0000</pubDate>
		<dc:creator>Jay Versluis</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[HyperDB]]></category>

		<guid isPermaLink="false">http://wpguru.co.uk/?p=1762</guid>
		<description><![CDATA[Ever since I&#8217;ve started experimenting with HyperDB I thought that once I&#8217;ve got enough servers at my disposal, and if I ever figure out how to setup MySQL replication I&#8217;d bring the two together. I believe that day has finally come: HyperDB is now deployed across over 60 sites I&#8217;m taking care of. I want [...]]]></description>
			<content:encoded><![CDATA[<p></p><p><a href="http://wpguru.co.uk/2012/01/how-to-deploy-hyperdb/screen-shot-2012-01-19-at-23-24-30/" rel="attachment wp-att-1765"><img class="alignright size-medium wp-image-1765" title="Screen Shot 2012-01-19 at 23.24.30" src="http://wpguru.co.uk/wp-content/uploads/2012/01/Screen-Shot-2012-01-19-at-23.24.30-300x161.png" alt="" width="300" height="161" /></a>Ever since I&#8217;ve <a href="http://wpguru.co.uk/2010/07/testing-hyperdb/">started experimenting with HyperDB</a> I thought that once I&#8217;ve got enough servers at my disposal, and if I ever figure out how to setup MySQL replication I&#8217;d bring the two together. I believe that day has finally come: <a href="http://wordpress.org/extend/plugins/hyperdb/" target="_blank">HyperDB</a> is now deployed across over 60 sites I&#8217;m taking care of.</p>
<p>I want to share with you my configuration and some of the pitfalls I&#8217;ve come across &#8211; if it helps, great. But mainly these notes are for me to remember how I did it when the next cluster needs to be built.</p>
<p><span id="more-1762"></span></p>
<h3>My Setup</h3>
<p>Currently I&#8217;m hosting sites with one main server running CentOS 6 and Plesk 10.4 &#8211; that&#8217;s for web and email. On another server I&#8217;m hosting my databases. This server is also running Plesk which makes replication a little bit more difficult.</p>
<p>I want to build a &#8220;cluster&#8221; of 4 database servers in total, two masters which replicate each other and can be used for read and write queries, and two slaves which replicate one master each. These are for read queries. Thanks to HyperDB I can decide whether I want to use my masters for write only and leave the read queries to my slaves. I could even expand on those slaves later if I wanted to.</p>
<p class="note">I have considered circular multi-master replication, but that&#8217; just giving me a headache. Imagine one going down, then all of them are out of sync. It&#8217;s got MESSY written all over. If I need more masters later, I&#8217;d rather build another cluster altogether.</p>
<p> At the time of writing I&#8217;m dealing with WordPress 3.3.1 and HyperDB 1.1. MySQL on my system is at version 5.1 for the masters and 5.5 for the slaves. I know this sounds dangerous, and 5.5 has some additional configuration options in my.cnf, as well as an additional database (performance_schema). But testing shows that these replicate well despite the different versions.</p>
<h3>Before we begin</h3>
<p class="alert">HyperDB is great, but it DOES NOT replicate your servers for you. You need to do this yourself. Once replication is in place, HyperDB will work its magic &#8211; but it won&#8217;t build a cluster for you.</p>
<p>First we need to setup two multi-masters, so two servers need to replicate onto each other. I&#8217;ve written how to do this in another article. Once that&#8217;s done we need to introduce one slave to Master 1, so technically Master 1 replicates onto two machines. Master 2 will currently only replicate onto Master 1 because we&#8217;ll re-introduce our current standalone database server as Slave 2. More about that later.</p>
<p>To test if this is working, I like having 4 SSH windows open at a time. Three of them are logged into my database servers, and one of them is an ad-hoc. This is what it looks like:</p>
<div id="attachment_1764" class="wp-caption alignnone" style="width: 480px">
	<a href="http://wpguru.co.uk/2012/01/how-to-deploy-hyperdb/screen-shot-2012-01-19-at-23-10-51/" rel="attachment wp-att-1764"><img class="size-large wp-image-1764" title="Screen Shot 2012-01-19 at 23.10.51" src="http://wpguru.co.uk/wp-content/uploads/2012/01/Screen-Shot-2012-01-19-at-23.10.51-480x292.png" alt="" width="480" height="292" /></a>
	<p class="wp-caption-text">You can never have enough SSH Terminals open. I use the standard Mac Terminal app for this</p>
</div>
<p>I like creating a database on one of the servers and check the other ones to make sure it&#8217;s been replicated properly. You do this with three easy MySQL commands:</p>
<pre>create database aaa;
show databases;
drop database aaa;</pre>
<p>These create, show all and delete database &#8220;aaa&#8221;. In an ideal world, you can create on Master 1, it should show up on both Master 2 and Slave 1. You should also be able to delete the same database from Master 2 and it should vanish from Master 1 and Slave 1.</p>
<p class="alert">Beware: if only ONE mistake happens, the replication on the problematic server will immediately stop replication until you fix the issue. By &#8220;mistake&#8221; I mean that if you&#8217;re dropping a database that the slave doesn&#8217;t know for example, or changing a value which does not exist. The only remedy in such cases is to stop the slave, pointing it to the synced master log position and then starting it again.</p>
<p>While you&#8217;re testing you should also emulate what happens when a server goes down. So switch Master 1 off by using the following shell command:</p>
<pre>service mysqld stop</pre>
<p>Then create a database on Master 2 and switch Master 1 back on via</p>
<pre>service mysqld start</pre>
<p>In an ideal world Master 1 should show your database. Slave 1 on the other hand may need another minute to catch up &#8211; depending on how often you&#8217;ve told him to reconnect to the master. Mine is set to re-connect once every minute, so grab a coffee and check again. Do it the other way round too so you&#8217;re absolutely certain that things replicate even when a server can&#8217;t be reached.</p>
]]></content:encoded>
			<wfw:commentRss>http://wpguru.co.uk/2012/01/how-to-deploy-hyperdb/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

