<?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>[ t h e f r a g g l e . c o m ] &#187; geek</title>
	<atom:link href="http://www.thefraggle.com/tag/geek/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thefraggle.com</link>
	<description>technology, photography and anything else that springs to mind.</description>
	<lastBuildDate>Tue, 22 Sep 2009 15:02:25 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>iSCSI quick-start guide.</title>
		<link>http://www.thefraggle.com/2009/09/14/iscsi-quick-start-guide/</link>
		<comments>http://www.thefraggle.com/2009/09/14/iscsi-quick-start-guide/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 14:19:00 +0000</pubDate>
		<dc:creator>Chris Ganderton</dc:creator>
				<category><![CDATA[]]></category>
		<category><![CDATA[disk]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[solaris]]></category>
		<category><![CDATA[storage]]></category>

		<guid isPermaLink="false">http://www.thefraggle.com/?p=72</guid>
		<description><![CDATA[I had to configure an iSCSI target for testing purposes, the steps I followed are below.
This assumes that you have the tgtadm software installed, and that you are making use of LVM.
1. create the backing volume in lvm
we have one volume group, called vg01, if you want to see what volume groups you have available, [...]]]></description>
			<content:encoded><![CDATA[<p>I had to configure an iSCSI target for testing purposes, the steps I followed are below.</p>
<p>This assumes that you have the tgtadm software installed, and that you are making use of LVM.</p>
<h5>1. create the backing volume in lvm</h5>
<p>we have one volume group, called vg01, if you want to see what volume groups you have available, issue:</p>
<p style="padding-left: 30px;"><code>$ vgs<br />
VG   #PV #LV #SN Attr   VSize  VFree<br />
vg01   1   6   0 wz--n- 501G    295G</code></p>
<p>To create your volume, issue something like this:</p>
<p style="padding-left: 30px;"><code>$ lvcreate -L50G vg01 -n iscsiback01</code></p>
<p>Logical volume &#8220;iscsiback01&#8243; created</p>
<h5>2. set up the iSCSI target</h5>
<h6>2.1 create the iSCSI target</h6>
<p style="padding-left: 30px;"><code>$ tgtadm --lld iscsi --op new --mode target --tid 1 -T test-file01:storagetest</code></p>
<p>To verify this was created successfully:</p>
<p style="padding-left: 30px;"><code>$ tgtadm --lld iscsi --op show --mode target</code></p>
<p style="padding-left: 30px;"><code> Target 1: test-file01:storagetest<br />
System information:<br />
Driver: iscsi<br />
State: ready<br />
I_T nexus information:<br />
LUN information:<br />
LUN: 0<br />
Type: controller<br />
SCSI ID: deadbeaf1:0<br />
SCSI SN: beaf10<br />
Size: 0 MB<br />
Online: Yes<br />
Removable media: No<br />
Backing store: No backing store<br />
Account information:<br />
ACL information:<br />
</code></p>
<h6>2.2  Add a LUN to the target</h6>
<p style="padding-left: 30px;"><code>$ tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 -b /dev/vg01/iscsiback01</code></p>
<h6>2.3 Allow access to the new target</h6>
<p style="padding-left: 30px;"><code>$ tgtadm --lld iscsi --op bind --mode target --tid 1 -I ALL</code></p>
<p>Instead of using &#8220;ALL&#8221; you can specify addresses that you want to be allowed to access these LUNs.</p>
<h5>3. Set up an iSCSI initiator</h5>
<p>Lets assume that our iSCSI target server is sat on 192.168.10.1, on the initiator you need to issue the following to discover the targets on there</p>
<p style="padding-left: 30px;"><code>$ iscsiadm --mode discovery --type sendtargets --portal 192.168.10.1<br />
192.168.10.1:3260,1 test-file01:storagetest<br />
</code></p>
<p>Once you&#8217;ve done this log into the target session</p>
<p style="padding-left: 30px;"><code>$ iscsiadm --mode node --targetname test-file01:storagetest --portal 192.168.10.1:3260 --login</code></p>
<p>Once you&#8217;ve done this, the first LUN should be added as a new sdX device, &#8220;fdisk -l&#8221; should show this new disk, if not, restart the iscsi service on the initiator and then perform a partprobe.</p>
<p>If you add a new LUN to the target, you can always refresh your iscsi session to force it to show up:</p>
<p style="padding-left: 30px;"><code>$ iscsiadm -m session -R</code></p>
<p>It&#8217;s worth noting that this tool won&#8217;t save any of this configuration to a config file. I resorted to entering the commands above into /etc/rc.local to make sure they were run on boot. You also need to make sure that iscsid and tgtadm are set to start on boot, if you&#8217;re using RHEL or clone of that, a simple:</p>
<p style="padding-left: 30px;"><code><br />
$ chkconfig iscsid on<br />
$ chkconfig tgtadm on</code></p>
<p>Will do this for you, if you&#8217;re using debian:</p>
<p style="padding-left: 30px;"><code><br />
$ update-rc.d iscsid defaults<br />
$ update-rc.d tgtadm defaults</code></p>
<p>Should do the same.</p>
<p>See <a title="TGT Project" href="http://stgt.berlios.de/" target="_blank">http://stgt.berlios.de/</a> for more information about tgt</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thefraggle.com/2009/09/14/iscsi-quick-start-guide/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>xen vcpu pinning defaults aren&#8217;t ideal</title>
		<link>http://www.thefraggle.com/2009/09/01/xen-vcpu-pinning-defaults-arent-ideal/</link>
		<comments>http://www.thefraggle.com/2009/09/01/xen-vcpu-pinning-defaults-arent-ideal/#comments</comments>
		<pubDate>Tue, 01 Sep 2009 23:11:52 +0000</pubDate>
		<dc:creator>Chris Ganderton</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://www.thefraggle.com/2009/09/01/xen-vcpu-pinning-defaults-arent-ideal/</guid>
		<description><![CDATA[I noticed an oddity the other day with a xen Domain0 host we have. There&#8217;s a cron scripted job that verifies the RPM database and the RPM&#8217;s that are installed on the system, for some reason this job failed, but kept the process open, and kept spinning around trying to do it&#8217;s job. Now, I [...]]]></description>
			<content:encoded><![CDATA[<p>I noticed an oddity the other day with a xen Domain0 host we have. There&#8217;s a cron scripted job that verifies the RPM database and the RPM&#8217;s that are installed on the system, for some reason this job failed, but kept the process open, and kept spinning around trying to do it&#8217;s job. Now, I really ought to have set up a &#8220;process count&#8221; check on the nagios monitoring we have here, but I didn&#8217;t have this at the time, so didn&#8217;t pick it up for a few days. Whilst this was all going on, the Domain0 got pretty busy and started having to use time on the other CPU&#8217;s as well as the main VCPU that wasn&#8217;t pinned to anything but the Domain0.</p>
<p>You can see this from the list below of the vcpu resources used by a xen server currently:</p>
<p>[root@somedomain0 ~]# xm vcpu-list<br />
Name                              ID VCPUs   CPU State   Time(s) CPU Affinity<br />
Domain-0                           0     0     0   -b-  1535018.3 0<br />
Domain-0                           0     1     1   -b-  139549.6 1<br />
Domain-0                           0     2     2   -b-  943651.0 2<br />
Domain-0                           0     3     3   -b-   53883.4 3<br />
Domain-0                           0     4     4   -b-  336268.9 4<br />
Domain-0                           0     5     5   -b-   65240.1 5<br />
Domain-0                           0     6     6   -b-   42854.6 6<br />
Domain-0                           0     7     7   r&#8211;   67960.9 7<br />
domain1                           4     0     2   r&#8211;  1791844.4 1-2<br />
domain1                           4     1     1   r&#8211;  1619120.1 1-2<br />
domain2                       5     0     3   -b-  511300.0 3-5<br />
domain2                       5     1     3   -b-  456253.1 3-5<br />
domain2                       5     2     5   -b-  456516.1 3-5<br />
domain3                     6     0     6   -b-  166344.6 6-7<br />
domain3                     6     1     7   -b-  137435.2 6-7</p>
<p>You’ll see Domain-0 which is the control domain, is pinned to all the other cpu’s that should only be used by the guests.</p>
<p>This isn&#8217;t ideal, and as a result you find that usually instead of a vmstat looking quite healthy and the &#8220;steal %&#8221; value that shows up being at 0, it&#8217;ll start to creep up. This means that the scheduler on the Domain0 side is interrupting the VCPU and requires CPU time from it, interrupting whatever is happening on the DomainU side.</p>
<p>There is a vcpu-pin action available within the xm command, which isn&#8217;t ideal to be used when you have the server live. What I found best, was to change the boot configuration for the Domain0 from the following:</p>
<p>title Enterprise Linux (2.6.18-128.el5xen)<br />
root (hd0,0)<br />
kernel /xen.gz-2.6.18-128.el5<br />
module /vmlinuz-2.6.18-128.el5xen ro root=/dev/vg01/root console=tty0 rhgb quiet<br />
module /initrd-2.6.18-128.el5xen.img</p>
<p>To the following:</p>
<p>title Enterprise Linux (2.6.18-128.el5xen)<br />
root (hd0,0)<br />
kernel /xen.gz-2.6.18-128.el5 <strong>dom0_max_vcpus=1</strong><br />
module /vmlinuz-2.6.18-128.el5xen ro root=/dev/vg01/root console=tty0 rhgb quiet<br />
module /initrd-2.6.18-128.el5xen.img</p>
<p>You&#8217;ll notice the option <strong>dom0_max_vcpus=1</strong>, this tells the Domain0 to pin to only one available VCPU, the one it&#8217;ll choose should be the first one.</p>
<p>You’ll see a difference in the vcpu-list afterwards like this:</p>
<p>[root@somedomain0 ~]# xm vcpu-list<br />
Name                              ID VCPUs   CPU State   Time(s) CPU Affinity<br />
Domain-0                           0     0     0   r&#8211;      54.0 0<br />
domain1                           3     0     7   -b-       3.2 6-7<br />
domain1                           3     1     6   -b-       3.0 6-7<br />
domain2                          1     0     1   -b-      10.3 1-2<br />
domain2                           1     1     2   -b-       2.9 1-2<br />
domain3                          2     0     3   -b-       3.7 3-5<br />
domain3                          2     1     4   -b-       2.5 3-5<br />
domain3                          2     2     5   -b-       0.9 3-5</p>
<p>It&#8217;s worth noting that you can also limit this on the fly, by using the following command:</p>
<p>xm vcpu-pin Domain0 0 0</p>
<p>Which can be useful if you can&#8217;t get the down time for a box and it&#8217;s guests.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thefraggle.com/2009/09/01/xen-vcpu-pinning-defaults-arent-ideal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>removing blank newlines using sed.</title>
		<link>http://www.thefraggle.com/2008/02/17/removing-blank-newlines-using-sed/</link>
		<comments>http://www.thefraggle.com/2008/02/17/removing-blank-newlines-using-sed/#comments</comments>
		<pubDate>Sun, 17 Feb 2008 21:47:07 +0000</pubDate>
		<dc:creator>Chris Ganderton</dc:creator>
				<category><![CDATA[General Life]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[stuff]]></category>

		<guid isPermaLink="false">http://www.thefraggle.com/2008/02/17/removing-blank-newlines-using-sed/</guid>
		<description><![CDATA[Most people won&#8217;t find this paticularly useful, but as I&#8217;m prone to forget things:
sed -e '/^$/d'
will delete blank newlines from whatever it&#8217;s input is.
]]></description>
			<content:encoded><![CDATA[<p>Most people won&#8217;t find this paticularly useful, but as I&#8217;m prone to forget things:</p>
<p><code>sed -e '/^$/d'</code></p>
<p>will delete blank newlines from whatever it&#8217;s input is.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thefraggle.com/2008/02/17/removing-blank-newlines-using-sed/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>TanTan flickr photo gallery broken after upgrade to Wordpress 2.3</title>
		<link>http://www.thefraggle.com/2007/10/27/fixing-tantan-flickr/</link>
		<comments>http://www.thefraggle.com/2007/10/27/fixing-tantan-flickr/#comments</comments>
		<pubDate>Sat, 27 Oct 2007 19:30:53 +0000</pubDate>
		<dc:creator>Chris Ganderton</dc:creator>
				<category><![CDATA[General Life]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[servers]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.thefraggle.com/2007/10/27/fixing-tantan-flickr/</guid>
		<description><![CDATA[So I realised that the admin part of the Flickr Photo gallery plugin I use (which is at http://www.thefraggle.com/flickr/) was a bit broken after upgrading wordpress to v2.3.
It appeared to work with the configuration I had set previously. However, when on the options page for the plugin, it was complaining of not being able to [...]]]></description>
			<content:encoded><![CDATA[<p>So I realised that the admin part of the <a href="http://tantannoodles.com/toolkit/photo-album/" title="tantan" target="_blank">Flickr Photo gallery</a> plugin I use (which is at <a href="http://www.thefraggle.com/flickr/" title="mobocracy@flickr" target="_blank">http://www.thefraggle.com/flickr/</a>) was a bit broken after upgrading wordpress to v2.3.</p>
<p>It appeared to work with the configuration I had set previously. However, when on the options page for the plugin, it was complaining of not being able to <a href="http://img.thefraggle.info/wp-imglib/broken-flickr-plugin.jpg" title="broken flickr" target="_blank">find a standard wordpress include</a>.</p>
<p>A quick google search showed me a couple of resources, that <a href="http://blog.bittube.com/2007/09/28/fix-for-tantan-flickr-reports-plugin-on-wordpress-23/" title="http://blog.bittube.com/2007/09/28/fix-for-tantan-flickr-reports-plugin-on-wordpress-23/" target="_blank">told me</a> where I needed to make a slight alteration to the source of my flickr plugin &#8230;</p>
<p>in the file &#8220;<em>/path/to/your/wordpress-install/wp-content/plugins/silaspartners/flickr/admin-options-load.php</em>&#8221;</p>
<pre>    require_once(dirname(__FILE__).$tmpPath.'/wp-admin/admin-db.php');</pre>
<p>needs to change to</p>
<pre>    require_once(dirname(__FILE__).$tmpPath.'/wp-admin/includes/user.php');</pre>
<p>Once that&#8217;s done, the plugin works a treat!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thefraggle.com/2007/10/27/fixing-tantan-flickr/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>upgrading to wordpress 2.3</title>
		<link>http://www.thefraggle.com/2007/10/22/upgrading-to-wordpress-23/</link>
		<comments>http://www.thefraggle.com/2007/10/22/upgrading-to-wordpress-23/#comments</comments>
		<pubDate>Mon, 22 Oct 2007 18:24:29 +0000</pubDate>
		<dc:creator>Chris Ganderton</dc:creator>
				<category><![CDATA[General Life]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.thefraggle.com/2007/10/22/upgrading-to-wordpress-23/</guid>
		<description><![CDATA[This Was quite an easy upgrade really, and prompted me to split off my different website content stuff a bit differently.
The upgrade went as expected and so far doesn&#8217;t seem to have broken anything. The big win for me though is the new native tags feature. I&#8217;d tried messing about in previous releases with the [...]]]></description>
			<content:encoded><![CDATA[<p>This Was quite an easy upgrade really, and prompted me to split off my different website content stuff a bit differently.</p>
<p>The upgrade went as expected and so far doesn&#8217;t seem to have broken anything. The big win for me though is the new native tags feature. I&#8217;d tried messing about in previous releases with the categories, but tagging really does seem a bit of a better way to do it.</p>
<p>It took me a few minutes of google searching and looking around <a href="http://codex.wordpress.org/" title="wordpress codex">codex</a>, but managed to find the code examples on making a &#8220;tag cloud&#8221;.</p>
<p>Basically you need to call the following function:</p>
<pre>	wp_tag_cloud();</pre>
<p>At it&#8217;s most basic, you can tell it the maximum size of the text for the entities that have been tagged least, and the maximum size for entities that have been tagged the most, so I use something like follows as the code for my sidebar:</p>
<pre>	&lt;p id="TagCloud"&gt;</pre>
<pre>	&lt;?php wp_tag_cloud('smallest=8&amp;largest=25'); ?&gt;</pre>
<pre>	&lt;/p&gt;</pre>
<p>I just put this into the sidebar.php file under the current theme I&#8217;m using, and hey presto, I have a tag cloud in my sidebar!</p>
<p>You can also do nifty things like have a tag archive, so that whenever you go to <a href="http://www.thefraggle.com/tag/photography" title="photography tag archive">http://www.thefraggle.com/tag/photography</a> you can see a tag cloud at the top of the page, then the listing of the articles tagged with the selected tag.</p>
<p>All that was involved here was creating a file called <em>tag.php</em> in my themes directory, then filling this with the way I wanted the page to look, basically with a call to <em>wp_tag_cloud()</em> and a loop to display the tagged articles:</p>
<pre> ...</pre>
<pre>        &lt;h2 class="storytitle"&gt;Search Content Through Tags&lt;/h2&gt;</pre>
<pre>        &lt;p id="TagCloud"&gt;</pre>
<pre>                &lt;?php wp_tag_cloud(''); ?&gt;</pre>
<pre>        &lt;/p&gt;</pre>
<pre>
        &lt;div style='clear: both;'&gt;&lt;/div&gt;</pre>
<pre>        &lt;br /&gt;&lt;br /&gt;</pre>
<pre>
        &lt;?php if (have_posts()) : ?&gt;</pre>
<pre>                &lt;?php while (have_posts()) : the_post(); ?&gt;</pre>
<pre>                &lt;h2&gt;&lt;a href="&lt;?php the_permalink() ?&gt;"</pre>
<pre>            rel="bookmark" title="Permanent Link to&lt;?php the_title(); ?&gt;"&gt;</pre>
<pre>            &lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h2&gt;</pre>
<pre></pre>
<pre>        &lt;div class="entry"&gt;</pre>
<pre>                &lt;?php the_content('Read the rest of this entry Â»'); ?&gt;</pre>
<pre>            &lt;/div&gt;</pre>
<pre>
        &lt;?php endwhile; ?&gt;</pre>
<pre>        &lt;?php endif; ?&gt;</pre>
<pre>...</pre>
<p>There&#8217;s more to my paticular tag.php file, as I have formatting things to make the page match the rest of the site and it&#8217;s template, but you get the gist <img src='http://www.thefraggle.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>If you want to find out more information on the tagging features that wordpress-2.3 can do, then take a look at <a href="http://codex.wordpress.org/Template_Tags/wp_tag_cloud" title="Wordpress Codex documentation for wp_tag_cloud" target="_blank">http://codex.wordpress.org/Template_Tags/wp_tag_cloud</a></p>
<p>There don&#8217;t seem to be a huge amount of plugins yet that help you manage your tags, but there is one that seems to do pretty much everything I think I would need to. It&#8217;s called &#8220;Simple Tags&#8221; and I found it via the all knowing Wordpress Plugin Directory, <a href="http://wordpress.org/extend/plugins/simple-tags/" title="simple tags plugin page" target="_blank">http://wordpress.org/extend/plugins/simple-tags/</a></p>
<p>There&#8217;s not a huge amount to say about it, but from there you can add and delete tags, mass edit the tags for posts and find untagged posts and pages.</p>
<p>Overall, I&#8217;d highly suggest to anyone that if you have the time to be bothered, and don&#8217;t have any plugins that might break due to the upgrade, get your upgrade on and get wordpress up to v2.3 <img src='http://www.thefraggle.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>Suggestions and other ideas welcome on what else I can do with this nifty new feature <img src='http://www.thefraggle.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.thefraggle.com/2007/10/22/upgrading-to-wordpress-23/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
