<?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>GingerSwan.com</title>
	<atom:link href="http://www.gingerswan.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gingerswan.com</link>
	<description>My rantings</description>
	<lastBuildDate>Mon, 19 Sep 2011 19:11:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Server load problems.  Varnish vs Nginx vs Apache vs PHP DSO vs FCGI vs suPHP vs APC vs eAccelerator vs memcached</title>
		<link>http://www.gingerswan.com/2011/09/19/server-load-problems-varnish-vs-nginx-vs-apache-vs-php-dso-vs-fcgi-vs-suphp-vs-apc-vs-eaccelerator-vs-memcached/</link>
		<comments>http://www.gingerswan.com/2011/09/19/server-load-problems-varnish-vs-nginx-vs-apache-vs-php-dso-vs-fcgi-vs-suphp-vs-apc-vs-eaccelerator-vs-memcached/#comments</comments>
		<pubDate>Mon, 19 Sep 2011 19:11:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Server Stuff]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[apc]]></category>
		<category><![CDATA[cpanel]]></category>
		<category><![CDATA[dso]]></category>
		<category><![CDATA[eaccelerator]]></category>
		<category><![CDATA[fcgi]]></category>
		<category><![CDATA[memcached]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[suphp]]></category>
		<category><![CDATA[varnish]]></category>

		<guid isPermaLink="false">http://www.gingerswan.com/?p=27</guid>
		<description><![CDATA[<p>After noticing one of my servers was down i needed a solution to the server load problems i was having.</p> <p>My sites on the server usually handle the loads that are on them but i was getting a huge spike in traffic that was causing the server to start swapping in and out of the [...]]]></description>
			<content:encoded><![CDATA[<p>After noticing one of my servers was down i needed a solution to the server load problems i was having.</p>
<p>My sites on the server usually handle the loads that are on them but i was getting a huge spike in traffic that was causing the server to start swapping in and out of the swap&#8230;.. which snowballed and caused the server to go from a load average of about 1 to well over 100!!!</p>
<p>What was to be done?</p>
<p>I already use supercache on all my sites along with widget cache.  This helps greatly but the problem is i am running multiple sites on these servers and i really need to prevent the servers from becoming overloaded.</p>
<p>&nbsp;</p>
<p>I was using Apache + mod_fcgi and nginx on cpanel.  It worked well until i went over a certain amount of traffic at the same time.</p>
<p>I quickly replaced nginx with the varnish cpanel plugin which helped a little and caused the load to drop.</p>
<p>I also noticed that FCGI was running away with processes and helping cause the swapping.  Exchaning this for suPHP did help but i found the performance wan&#8217;t anywhere near as good.</p>
<p>As i am the only person on the server i have since moved to DSO which dropped my load average down to around 1 which is perfect for me.</p>
<p>The only problem being that dso runs as the apache user nobody:nobody.   as i wanted to change from super cache to w3 (as i&#8217;ve seen some stats indicating that w3 total cache can handle a higher load) i have had to go through sorting file permissions of each site so that the W3 plugin can write the cache.</p>
<p>playing around with APC , eAccelerator and memcached  i have found the best results are in using enhanced disk for my page cache and APC for the database, object and minify.  MY sites are now ready for any spike in traffic that can be thrown at them!</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gingerswan.com/2011/09/19/server-load-problems-varnish-vs-nginx-vs-apache-vs-php-dso-vs-fcgi-vs-suphp-vs-apc-vs-eaccelerator-vs-memcached/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>messing around with preg_replace&#8230;.</title>
		<link>http://www.gingerswan.com/2011/09/06/messing-around-with-preg_replace/</link>
		<comments>http://www.gingerswan.com/2011/09/06/messing-around-with-preg_replace/#comments</comments>
		<pubDate>Tue, 06 Sep 2011 08:52:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[id]]></category>
		<category><![CDATA[loop]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[preg_replace]]></category>
		<category><![CDATA[query]]></category>
		<category><![CDATA[slug]]></category>
		<category><![CDATA[tags]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.gingerswan.com/?p=22</guid>
		<description><![CDATA[<p>I am probably trying to reinvent the wheel here but&#8230;..</p> <p>I wanted to get the top 20 or so tags from a wordpress blog and to use the tags for a loop of 3 posts from each tag.</p> <p>The only function i could find to get the most used tags was wp_tag_cloud</p> <p>by taking it [...]]]></description>
			<content:encoded><![CDATA[<p>I am probably trying to reinvent the wheel here but&#8230;..</p>
<p>I wanted to get the top 20 or so tags from a wordpress blog and to use the tags for a loop of 3 posts from each tag.</p>
<p>The only function i could find to get the most used tags was wp_tag_cloud</p>
<p>by taking it into an array i could get the top 20 tags.</p>
<p><em><strong><code> $tags = wp_tag_cloud( array( 'number' =&gt; '20', 'order' =&gt; 'DESC', 'echo' =&gt; 'false', 'format' =&gt; 'array' ) );</code></strong></em></p>
<p>I looped through this array using:</p>
<p><em><strong> foreach($tags as $tag)</strong></em></p>
<p>unfortunately the wp_tag_cloud did not return a list of tag id&#8217;s for me to  loop through.</p>
<p>each $tag was in the format of a url,  i.e. &lt;a id=&#8221;" href=&#8221;http://domain.com/tag/post_slug&#8221; style=&#8221;"&gt;tag name&lt;/a&gt;</p>
<p>So i needed to extract data from this to find the tag.  i chose to extract the tag slug which would be in the url.</p>
<p><strong><em>$tagslug= preg_replace(&#8216;%&lt;a .*? ?href=["\']([^"\']*).*?&gt;.*?&lt;/a&gt;%i&#8217;, &#8216;$1&#8242;, $tag);</em></strong></p>
<p>returned the url for me.  Unfortunately my regular expression skills are pretty poor and couldn&#8217;t work out how to extract the slug straight away using markers. (my university professor would not be proud.)</p>
<p>so i took the url and ran another preg_replace on it to get the tag slug</p>
<p><em><strong>$tagslug = preg_replace(&#8220;/.*\.(com|gov|org|net|mil|edu)\/tag\/([a-z_\-]+).*/i&#8221;,&#8217;$2&#8242;,$tagslug);</strong></em></p>
<p>This finally returned the tag&#8217;s slug for me,  I had a wee function called get_tag_id_by_slug i made so i called that.</p>
<p><strong><em>$thetagid= get_tag_id_by_slug($tagslug);</em></strong></p>
<p>which returned the tag id number for me, so finally i could use<br />
<em><strong>$term = get_tag($thetagid); </strong></em></p>
<p>to get the actual term to use in my wordpress loop</p>
<p><em><strong>$new_query = new WP_Query(&#8216;r_sortby=highest_rated&amp;r_orderby=desc&amp;posts_per_page=4&amp;tag=&#8217;. $term-&gt;slug); </strong></em><br />
<em><strong>while ( $new_query-&gt;have_posts() ) : $new_query-&gt;the_post();</strong></em></p>
<p>&nbsp;</p>
<p>My function to get the id from the slug is:</p>
<p><em><strong>function get_tag_id_by_slug($tag_slug) {</strong></em><br />
<em><strong>global $wpdb;</strong></em><br />
<em><strong>$tag_ID = $wpdb-&gt;get_var(&#8220;SELECT * FROM &#8220;.$wpdb-&gt;terms.&#8221; WHERE `slug` = &#8216;&#8221;.$tag_slug.&#8221;&#8216;&#8221;);</strong></em><br />
<em><strong>return $tag_ID;}</strong></em></p>
<p>&nbsp;</p>
<p>After doing all this i decided that its all very well to automate things but some of my most used tags were very similar and i didn&#8217;t want a loop containing the same 4 posts over and over with a new title.  So in the end i just went with.</p>
<p><strong><em>$tags=get_tags(&#8216;include=7,8,11,30,45&#8242;);</em></strong></p>
<p>and looped that!</p>
<p>DOH!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gingerswan.com/2011/09/06/messing-around-with-preg_replace/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash Games</title>
		<link>http://www.gingerswan.com/2011/05/11/flash-games/</link>
		<comments>http://www.gingerswan.com/2011/05/11/flash-games/#comments</comments>
		<pubDate>Wed, 11 May 2011 20:53:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[flash games]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.gingerswan.com/?p=19</guid>
		<description><![CDATA[<p>I have made a plugin for wordpress to display up to 200 flash games within your wordpress blog.</p> <p>It is a relatively simple plugin that pulls data from my arcade website <a href="http://lingolux.com">Lingolux flash games</a>.</p> <p>At the backend Lingolux uses a simple wordpress WP_Query loop to pull data from the site as specified by the [...]]]></description>
			<content:encoded><![CDATA[<p>I have made a plugin for wordpress to display up to 200 flash games within your wordpress blog.</p>
<p>It is a relatively simple plugin that pulls data from my arcade website <a href="http://lingolux.com">Lingolux flash games</a>.</p>
<p>At the backend Lingolux uses a simple wordpress WP_Query loop to pull data from the site as specified by the plugin.<br />
This allows the user to select the number of games and whether to display new games, top games, or both.</p>
<p>Although most blogs will cache the page themselves i did not want my plugin to overwhelm my website so i implemented a simple caching system in php.<br />
I found the information <a href="http://www.theukwebdesigncompany.com/articles/php-caching.php">here<br />
</a></p>
<p><code><br />
<?php<br />
      $cachefile = "cache/".$reqfilename.".html";<br />
      $cachetime = 5 * 60; // 5 minutes<br />
      // Serve from the cache if it is younger than $cachetime<br />
      if (file_exists($cachefile) &#038;&#038; (time() - $cachetime<br />
         < filemtime($cachefile)))<br />
      {<br />
         include($cachefile);<br />
         echo "<!-- Cached ".date('jS F Y H:i', filemtime($cachefile))."  -->";<br />
         exit;<br />
      }<br />
      ob_start(); // start the output buffer<br />
?><br />
I placed the wp query here<br />
<?php<br />
       // open the cache file for writing<br />
       $fp = fopen($cachefile, 'w');<br />
       // save the contents of output buffer to the file<br />
	    fwrite($fp, ob_get_contents());<br />
		// close the file<br />
        fclose($fp);<br />
		// Send the output to the browser<br />
        ob_end_flush();<br />
?><br />
</code></p>
<p>This provided some simple caching of the backend.</p>
<p>The plugin also uses a simple lightbox to display the flash.<br />
You can see the plugin in operation <a href="http://www.gingerswan.com/flash-games/"> here</a> and you can download it from the wordpress site <a href="http://wordpress.org/extend/plugins/flash-games-page/">here</a><br />
<a href="http://wordpress.org/extend/plugins/flash-games-page/">Flash Games Page</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gingerswan.com/2011/05/11/flash-games/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SPL reconstruction</title>
		<link>http://www.gingerswan.com/2011/01/04/spl-reconstruction/</link>
		<comments>http://www.gingerswan.com/2011/01/04/spl-reconstruction/#comments</comments>
		<pubDate>Tue, 04 Jan 2011 23:22:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Scottish Football]]></category>

		<guid isPermaLink="false">http://www.gingerswan.com/blog/?p=12</guid>
		<description><![CDATA[<p>I think the 10 team league could work&#8230;. but only if they did something radical!</p> <p>How about adopting The South American style system?</p> <p>An &#8220;opening tournament&#8221; where each of the 10 play each other twice, a champion is declared.<br /> Relegation wise, they could have 1 or 2 down 1 or 2 up (or playoffs [...]]]></description>
			<content:encoded><![CDATA[<p>I think the 10 team league could work&#8230;. but only if they did something radical!</p>
<p>How about adopting The South American style system?</p>
<p>An &#8220;opening tournament&#8221; where each of the 10 play each other twice, a champion is declared.<br />
Relegation wise, they could have 1 or 2 down 1 or 2 up (or playoffs whatever = extra tv money etc).</p>
<p>Then comes the &#8220;closing tournament&#8221; every team plays each other twice again and another champion is declared. If the same team wins twice then they are the &#8220;overall winners&#8221; but if you have 2 different teams then you get a huge money spinning &#8220;champions playoff&#8221; a game to decide who gets the champions league place. The the other european spots can be decided with the much the much touted playoffs based on league positions over the 2 seasons.</p>
<p>This would give the other teams more of a chance of winning the league as you don&#8217;t have to play the old firm 4 times a season, other problems that usually affect challengers (injuries, suspensions and squad size) don&#8217;t cause as many problems as each season only lasts half a year.</p>
<p>It would alleviate the huge economic hit of being relegated as you now have the possibility of being promoted twice a year.</p>
<p>It would also introduce the huge money spinner playoffs everyone wants.</p>
<p>TV still get their 4 old firm games a year and the fans get more of a chance of winning the league!</p>
<p>The idea of B teams should be scrapped.<br />
It would be horrible to be stuck in a league with Ranger/Celtic reserves&#8230; i can&#8217;t imagine many Raith Rovers/Dunfermline/Falkirk/etc fans wanting to go watch their team vs reserves!<br />
Placing them in regional leagues is pointless too&#8230; what benefit would they get out of playing milkmen and posties week in week out?<br />
They need to reintroduce the reserve leagues and encourage the big teams to link up with smaller teams for year long loans for the young players who are 5th/6th choice at their current clubs!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gingerswan.com/2011/01/04/spl-reconstruction/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>how to get round irelands piratebay block</title>
		<link>http://www.gingerswan.com/2010/01/25/how-to-get-round-irelands-piratebay-block/</link>
		<comments>http://www.gingerswan.com/2010/01/25/how-to-get-round-irelands-piratebay-block/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 18:40:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Help]]></category>

		<guid isPermaLink="false">http://www.gingerswan.com/blog/?p=10</guid>
		<description><![CDATA[<p><a href=" http://194.71.107.15" target="_blank">http://194.71.107.15 </a></p> <p>yup thats right its only a dns block!</p>]]></description>
			<content:encoded><![CDATA[<p><a href=" http://194.71.107.15" target="_blank">http://194.71.107.15 </a></p>
<p>yup thats right its only a dns block!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gingerswan.com/2010/01/25/how-to-get-round-irelands-piratebay-block/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Mr Crabbys Beach Ball Adventure Launched</title>
		<link>http://www.gingerswan.com/2009/12/05/mr-crabbys-beach-ball-adventure-launched/</link>
		<comments>http://www.gingerswan.com/2009/12/05/mr-crabbys-beach-ball-adventure-launched/#comments</comments>
		<pubDate>Sun, 06 Dec 2009 03:43:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Games Development]]></category>
		<category><![CDATA[arcade]]></category>
		<category><![CDATA[box2d]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[flash game]]></category>
		<category><![CDATA[lingolux]]></category>

		<guid isPermaLink="false">http://www.gingerswan.com/blog/?p=8</guid>
		<description><![CDATA[<p>My first game has been launched.</p> <p>Its a combination of <a href="http://www.lingolux.com/2009/11/18/mr-crabbys-beach-ball-adventure/">Arkanoid, Breakout and Peggle</a> using <a href="http://www.box2d.org/">Box2d Physics</a> it provides a unique gameplay experience.</p> <p>I programmed the game using <a href="http://www.flashdevelop.org/">FlashDevelop</a> and <a href="http://www.adobe.com/products/flex/">Adobe&#8217;s Flex API</a></p> <p><a href="http://www.myspace.com/thesevenacresmile">The Menu Music, Losing Music and Winning</a> music was made by <a href="http://www.myspace.com/thesevenacresmile">Seven Acre Smile</a> , you [...]]]></description>
			<content:encoded><![CDATA[<p>My first game has been launched.</p>
<div class="wp-caption alignnone" style="width: 110px"><img title="Mr Crabbys Beach Ball Adventure" src="http://thumbs.mochiads.com/c/g/beachball/_thumb_100x100.png" alt="Mr Crabbys Beach Ball Adventure" width="100" height="100" /><p class="wp-caption-text">Mr Crabbys Beach Ball Adventure</p></div>
<p>Its a combination of <a href="http://www.lingolux.com/2009/11/18/mr-crabbys-beach-ball-adventure/">Arkanoid, Breakout and Peggle</a> using <a href="http://www.box2d.org/">Box2d Physics</a> it provides a unique gameplay experience.</p>
<p>I programmed the game using <a href="http://www.flashdevelop.org/">FlashDevelop</a> and <a href="http://www.adobe.com/products/flex/">Adobe&#8217;s Flex API</a></p>
<p><a href="http://www.myspace.com/thesevenacresmile">The Menu Music, Losing Music and Winning</a> music was made by <a href="http://www.myspace.com/thesevenacresmile">Seven Acre Smile</a> , you can listen to the full songs here <a href="http://www.myspace.com/thesevenacresmile">http://www.myspace.com/thesevenacresmile</a></p>
<p>The Graphics were completed by Daniel Martin.</p>
<p>I decided to that my own site would be the <a href="http://www.flashgamelicense.com/view_library.php?page=primary-sponsorships">primary sponsor</a> of this game. You can play it now on my <a href="http://www.lingolux.com">Flash Game Portal</a> <a href="http://www.lingolux.com">LingoLux.com</a> amoungst other places on the internet.</p>
<p>I shall talk more about LingoLux in the future.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gingerswan.com/2009/12/05/mr-crabbys-beach-ball-adventure-launched/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Yuan PD300 aka DVB2GO vista 64bit BDA drivers!</title>
		<link>http://www.gingerswan.com/2009/10/24/yuan-pd300-aka-dvb2go-vista-64bit-bda-drivers/</link>
		<comments>http://www.gingerswan.com/2009/10/24/yuan-pd300-aka-dvb2go-vista-64bit-bda-drivers/#comments</comments>
		<pubDate>Sun, 25 Oct 2009 03:01:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Help]]></category>

		<guid isPermaLink="false">http://www.gingerswan.com/blog/?p=3</guid>
		<description><![CDATA[<p></p> <p>I&#8217;ve had this little card for ages but since I&#8217;ve been using vista 64bit i&#8217;ve been unable to use my Yuan pd300 (dvb2go)  stick&#8230;</p> <p>The <a href="http://www.yuan.com.tw/" target="_blank">Yuan</a> site is terrible and has no links to any sort of drivers&#8230;. and from what i remembered they even required a cdkey to use their drivers/software!!!</p> [...]]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-5" title="yuan dvb2go aka pd300" src="http://www.gingerswan.com/blog/wp-content/uploads/2009/10/yuandvb2go.jpg" alt="yuan dvb2go aka pd300" width="164" height="226" /></p>
<p>I&#8217;ve had this little card for ages but since I&#8217;ve been using vista 64bit i&#8217;ve been unable to use my Yuan pd300 (dvb2go)  stick&#8230;</p>
<p>The <a href="http://www.yuan.com.tw/" target="_blank">Yuan</a> site is terrible and has no links to any sort of drivers&#8230;. and from what i remembered they even required a cdkey to use their drivers/software!!!</p>
<p>But i read that the <a href="http://www.digitalspy.co.uk/forums/showthread.php?t=261814&amp;page=13" target="_blank">Freecom DVB-T and Yakumo DVB-T usb sticks</a> were very similar and that other people had been using the drivers for the other product in XP.</p>
<p>So searching for Yakumo drivers gave me no luck at all but Freecom do provide Vista 64bit drivers for their DVB-T!</p>
<p>You can get them <a href="http://www.freecom.com/objects/00010626.zip" target="_blank">here</a>.   But they will not work out of the box for your Yean PD300 you will need to edit the BDA_Loader_220A_x64.inf file.</p>
<p>under [WT220Uer.NTamd64]</p>
<p>add in</p>
<p>%WT220Uer.DeviceDesc%=LOADER.Device, USB\VID_14AA&amp;PID_0220</p>
<p>then plug in your Yuan pd300</p>
<p>Then</p>
<p>Control panel &gt; Device Manager</p>
<p>select the unrecognised usb device (your TV card)</p>
<p>install drivers and point them to the directory containing your BDA_Loader_220A_x64.inf file (you don&#8217;t need the 225 drivers)</p>
<p>and there you go! drivers for your DVB2Go stick!</p>
<p><a href="http://www.gingerswan.com/64bit.rar" target="_blank">Alternatively you can download the drivers here!</a> (rar file)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gingerswan.com/2009/10/24/yuan-pd300-aka-dvb2go-vista-64bit-bda-drivers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 3.147 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2012-01-08 12:26:32 -->

