<?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>ieatpenguin &#187; Software</title>
	<atom:link href="http://r-dunn.co.uk/ieatpenguin/category/computing/software/feed/" rel="self" type="application/rss+xml" />
	<link>http://r-dunn.co.uk/ieatpenguin</link>
	<description>I run, therefore I am</description>
	<lastBuildDate>Tue, 01 May 2012 12:39:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Creating IIS 6 Directories by C#</title>
		<link>http://r-dunn.co.uk/ieatpenguin/computing/software/962/</link>
		<comments>http://r-dunn.co.uk/ieatpenguin/computing/software/962/#comments</comments>
		<pubDate>Fri, 10 Feb 2012 15:11:29 +0000</pubDate>
		<dc:creator>Russell</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://r-dunn.co.uk/ieatpenguin/?p=962</guid>
		<description><![CDATA[I&#8217;ve been writing this for a while today and couldn&#8217;t figure out why I couldn&#8217;t get the application to create within IIS. The virtual directory created without problems, but after that nothing happened. It turns out that the msdn library &#8230; <a href="http://r-dunn.co.uk/ieatpenguin/computing/software/962/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>I&#8217;ve been writing this for a while today and couldn&#8217;t figure out why I couldn&#8217;t get the application to create within IIS. The virtual directory created without problems, but after that nothing happened. It turns out that the msdn library was incorrect!</p>
<p>Here is a working IIS 6 virtual directory creator. The only paramaters that need to be changed are in the <strong>// Set</strong> comment. </p>
<p><pre><code>// IIS 6 Virtual Directory Builder and Configuration
// http://r-dunn.co.uk/ieatpenguin/computing/software/962/
// Please feel free to use and distribute

// Set variables: Site_Name,Path_to_wwwroot,Virtual_Directory_Name,Path_to_virtual_dir
// Change the port number after &quot;ServerBindings&quot; if you wish to use a different port.

using System;
using System.IO;
using System.DirectoryServices;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Collections;

namespace System_DirectoryServices_DirectoryEntry_ConfigIIS
{
&nbsp;&nbsp;class Program
&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;static void Main(string[] args)
&nbsp;&nbsp;&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CreateSite(&quot;IIS://Localhost/W3SVC&quot;, &quot;555&quot;, &quot;Site_Name&quot;, &quot;Path_to_wwwroot&quot;);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SetSingleProperty(&quot;IIS://Localhost/W3SVC/555&quot;, &quot;ServerBindings&quot;, &quot;:8080:&quot;);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CreateVDir(&quot;IIS://Localhost/W3SVC/1/Root&quot;, &quot;Virtual_Directory_Name&quot;, &quot;Path_to_virtual_dir&quot;);
&nbsp;&nbsp;&nbsp;&nbsp;}

&nbsp;&nbsp;&nbsp;&nbsp;static void CreateSite(string metabasePath, string siteID, string siteName, string physicalPath)
&nbsp;&nbsp;&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;metabasePath is of the form &quot;IIS://&lt;servername&gt;/&lt;service&gt;&quot;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;&nbsp;&nbsp;for example &quot;IIS://localhost/W3SVC&quot; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;siteID is of the form &quot;&lt;number&gt;&quot;, for example &quot;555&quot;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Console.WriteLine(&quot;\nCreating site {0}/{1}, mapping the Root application to {2}:&quot;, 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;metabasePath, siteID, physicalPath);

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;try
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DirectoryEntry service = new DirectoryEntry(metabasePath);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;string className = service.SchemaClassName.ToString();
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (className.EndsWith(&quot;Service&quot;))
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DirectoryEntries sites = service.Children;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DirectoryEntry newSite = sites.Add(siteID, (className.Replace(&quot;Service&quot;, &quot;Server&quot;)));
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newSite.Properties[&quot;ServerComment&quot;][0] = siteName;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newSite.CommitChanges();

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DirectoryEntry newRoot;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newRoot = newSite.Children.Add(&quot;Root&quot;, &quot;IIsWebVirtualDir&quot;);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newRoot.Properties[&quot;Path&quot;][0] = physicalPath;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newRoot.Properties[&quot;AccessScript&quot;][0] = true;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newRoot.CommitChanges();

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Console.WriteLine(&quot; Done. Your site will not start until you set the ServerBindings or SecureBindings property.&quot;);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Console.WriteLine(&quot; Failed. A site can only be created in a service node.&quot;);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;catch (Exception ex)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Console.WriteLine(&quot;Failed in CreateSite with the following exception: \n{0}&quot;, ex.Message);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;}

&nbsp;&nbsp;&nbsp;&nbsp;static void SetSingleProperty(string metabasePath, string propertyName, object newValue)
&nbsp;&nbsp;&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;metabasePath is of the form &quot;IIS://&lt;servername&gt;/&lt;path&gt;&quot;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;&nbsp;&nbsp;for example &quot;IIS://localhost/W3SVC/1&quot; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Console.WriteLine(&quot;\nSetting single property at {0}/{1} to {2} ({3}):&quot;,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;metabasePath, propertyName, newValue, newValue.GetType().ToString());

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;try
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DirectoryEntry path = new DirectoryEntry(metabasePath);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PropertyValueCollection propValues = path.Properties[propertyName];
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;string oldType = propValues.Value.GetType().ToString();
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;string newType = newValue.GetType().ToString();
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Console.WriteLine(&quot; Old value of {0} is {1} ({2})&quot;, propertyName, propValues.Value, oldType);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (newType == oldType)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;path.Properties[propertyName][0] = newValue;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;path.CommitChanges();
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Console.WriteLine(&quot;Done&quot;);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Console.WriteLine(&quot; Failed in SetSingleProperty; type of new value does not match property&quot;);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;catch (Exception ex)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (&quot;HRESULT 0x80005006&quot; == ex.Message)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Console.WriteLine(&quot; Property {0} does not exist at {1}&quot;, propertyName, metabasePath);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Console.WriteLine(&quot;Failed in SetSingleProperty with the following exception: \n{0}&quot;, ex.Message);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;}

&nbsp;&nbsp;&nbsp;&nbsp;static void CreateVDir(string metabasePath, string vDirName, string physicalPath)
&nbsp;&nbsp;&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;metabasePath is of the form &quot;IIS://&lt;servername&gt;/&lt;service&gt;/&lt;siteID&gt;/Root[/&lt;vdir&gt;]&quot;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;&nbsp;&nbsp;for example &quot;IIS://localhost/W3SVC/1/Root&quot; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Console.WriteLine(&quot;\nCreating virtual directory {0}/{1}, mapping the Root application to {2}:&quot;,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;metabasePath, vDirName, physicalPath);

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;try
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DirectoryEntry site = new DirectoryEntry(metabasePath);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;string className = site.SchemaClassName.ToString();
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ((className.EndsWith(&quot;Server&quot;)) || (className.EndsWith(&quot;VirtualDir&quot;)))
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DirectoryEntries vdirs = site.Children;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DirectoryEntry newVDir = vdirs.Add(vDirName, (className.Replace(&quot;Service&quot;, &quot;VirtualDir&quot;)));
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newVDir.Properties[&quot;Path&quot;][0] = physicalPath;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newVDir.Properties[&quot;AccessScript&quot;][0] = true;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Create Application, set appropriate documents and permissions
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newVDir.Invoke(&quot;AppCreate&quot;, new object[1] { 1 });
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newVDir.Properties[&quot;AppFriendlyName&quot;].Value = vDirName;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newVDir.Properties[&quot;EnableDirBrowsing&quot;][0] = false;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newVDir.Properties[&quot;AccessRead&quot;][0] = true;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newVDir.Properties[&quot;AccessExecute&quot;][0] = true;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newVDir.Properties[&quot;AccessWrite&quot;][0] = false;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newVDir.Properties[&quot;EnableDefaultDoc&quot;][0] = true;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newVDir.Properties[&quot;DefaultDoc&quot;][0] = &quot;ReportsIsapi.dll?Login,ReportsIsapi.dll&quot;;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newVDir.Properties[&quot;AspEnableParentPaths&quot;][0] = true;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newVDir.CommitChanges();

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Console.WriteLine(&quot; Done.&quot;);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Console.WriteLine(&quot; Failed. A virtual directory can only be created in a site or virtual directory node.&quot;);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;catch (Exception ex)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Console.WriteLine(&quot;Failed in CreateVDir with the following exception: \n{0}&quot;, ex.Message);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;}
}</code></pre></p>
<p>Don&#8217;t forget to use a double &#8216;\\&#8217; in your pathnames to avoid the compiler interpreting them as an escape sequence. I certainly did.</p>
<div class="shr-publisher-962"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://r-dunn.co.uk/ieatpenguin/computing/software/962/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Backing up The Latest File &#8211; Name Unknown</title>
		<link>http://r-dunn.co.uk/ieatpenguin/computing/software/backing-up-the-latest-file-name-unknown/</link>
		<comments>http://r-dunn.co.uk/ieatpenguin/computing/software/backing-up-the-latest-file-name-unknown/#comments</comments>
		<pubDate>Wed, 11 Jan 2012 09:51:32 +0000</pubDate>
		<dc:creator>Russell</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://r-dunn.co.uk/ieatpenguin/?p=953</guid>
		<description><![CDATA[It&#8217;s a common enough issue for me that I want to be able to backup the latest backup of a database, and using variables to set date and time I never quite know what the filename of the backup will &#8230; <a href="http://r-dunn.co.uk/ieatpenguin/computing/software/backing-up-the-latest-file-name-unknown/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>It&#8217;s a common enough issue for me that I want to be able to backup the latest backup of a database, and using variables to set date and time I never quite know what the filename of the backup will be.</p>
<p><pre><code>::copy latest file to network server
set LF=
for /F %%i in (&#039;dir /Od /b *.sql&#039;) DO set LF=%%i
:
echo%TIME% on %DATE%: Latest Backup is %LF% &gt;&gt; Backup.file
:
xcopy /Y %LF% \\networkserver\bugzilla</code></pre></p>
<p>My solution is to sort the backup directory by date, and create a variable based on the filename of the most recent file.</p>
<p>I then echo the time and date to a file (Backup.file) so that I have a log of the backup process that I can check should I need to in the future.</p>
<p>Finally, the script copies the latest backup to a network location.</p>
<p>This was used in conjunction with my <a href="http://r-dunn.co.uk/ieatpenguin/computing/software/automated-backup-of-bugzilla-database-on-windows/" title="bugzilla backup script">bugzilla backup script</a>, hence the directory names, but it can of course be used for anything.</p>
<div class="shr-publisher-953"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://r-dunn.co.uk/ieatpenguin/computing/software/backing-up-the-latest-file-name-unknown/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automated Backup of Bugzilla Database on Windows</title>
		<link>http://r-dunn.co.uk/ieatpenguin/computing/software/automated-backup-of-bugzilla-database-on-windows/</link>
		<comments>http://r-dunn.co.uk/ieatpenguin/computing/software/automated-backup-of-bugzilla-database-on-windows/#comments</comments>
		<pubDate>Fri, 06 Jan 2012 17:01:39 +0000</pubDate>
		<dc:creator>Russell</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://r-dunn.co.uk/ieatpenguin/?p=948</guid>
		<description><![CDATA[Bugzilla isn&#8217;t really designed to be used on Windows, but once set up its fairly easy to administer. One obviously important thing is backing up the database. Using the niftily built in mysqldump I used the following solution. Note this &#8230; <a href="http://r-dunn.co.uk/ieatpenguin/computing/software/automated-backup-of-bugzilla-database-on-windows/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>Bugzilla isn&#8217;t really designed to be used on Windows, but once set up its fairly easy to administer.</p>
<p>One obviously important thing is backing up the database. Using the niftily built in mysqldump I used the following solution. Note this assumes default settings were used in the installation of Bugzilla.</p>
<p>First, add mysql to the windows path if it hasn&#8217;t been done so already, by running up a command prompt:</p>
<p><code>PATH=%PATH%;C:\Program Files\Bugzilla\mysql\bin\</code></p>
<p>I then use a command file to create the backup dump, and then append the date and time to the file name. Note I have also created a user (backup) on the bugzilla database with a limited set of privileges (Select, Lock Table, Show Databases, Event). </p>
<p><pre><code>rem commmand to dump the database to file
mysqldump -ubackup -pbackup Bugs &gt; c:\bugsbackup\bz.sql

rem set date and time into useable file format
set _my_datetime=%date%_%time%
set _my_datetime=%_my_datetime: =_%
set _my_datetime=%_my_datetime::=%
set _my_datetime=%_my_datetime:/=_%
set _my_datetime=%_my_datetime:.=_%

rem rename file
ren &quot;c:\bugsbackup\bz.sql&quot; bz_%_my_datetime%.sql</code></pre></p>
<p>This command file can of course be added to scheduled tasks and run as frequently as you want.</p>
<div class="shr-publisher-948"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://r-dunn.co.uk/ieatpenguin/computing/software/automated-backup-of-bugzilla-database-on-windows/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SecurityTools</title>
		<link>http://r-dunn.co.uk/ieatpenguin/computing/software/securitytools/</link>
		<comments>http://r-dunn.co.uk/ieatpenguin/computing/software/securitytools/#comments</comments>
		<pubDate>Mon, 28 Feb 2011 15:01:05 +0000</pubDate>
		<dc:creator>Russell</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://r-dunn.co.uk/ieatpenguin/?p=709</guid>
		<description><![CDATA[This is a nasty little program that masquerades as a security program that has found lots of viruses on your PC, and will clean them if you unlock it &#8211; eg if you hand over your credit card details. The &#8230; <a href="http://r-dunn.co.uk/ieatpenguin/computing/software/securitytools/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>This is a nasty little program that masquerades as a security program that has found lots of viruses on your PC, and will clean them if you unlock it &#8211; eg if you hand over your credit card details.</p>
<p>The easiest fix I&#8217;ve found is using ComboFix, and then deleting the [random letter/numbers] folders found under &#8216;\Documents And Settings\All Users\&#8217;.</p>
<div class="shr-publisher-709"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://r-dunn.co.uk/ieatpenguin/computing/software/securitytools/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows Home Server v2 (Vail) is dead in the water</title>
		<link>http://r-dunn.co.uk/ieatpenguin/computing/software/windows-home-server-v2-vail-is-dead-in-the-water/</link>
		<comments>http://r-dunn.co.uk/ieatpenguin/computing/software/windows-home-server-v2-vail-is-dead-in-the-water/#comments</comments>
		<pubDate>Wed, 24 Nov 2010 16:19:42 +0000</pubDate>
		<dc:creator>Russell</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://r-dunn.co.uk/ieatpenguin/?p=694</guid>
		<description><![CDATA[I&#8217;m a big fan of windows home server. They failed to deliver on some things, such as Media Centre integration, but that doesn&#8217;t really bother me. It&#8217;s a decent piece of server kit with a nice UI built over the &#8230; <a href="http://r-dunn.co.uk/ieatpenguin/computing/software/windows-home-server-v2-vail-is-dead-in-the-water/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>I&#8217;m a big fan of windows home server. They failed to deliver on some things, such as Media Centre integration, but that doesn&#8217;t really bother me. It&#8217;s a decent piece of server kit with a nice UI built over the top of Server 2008.</p>
<p>The best feature of it has to be Drive Extender, a disk management tool that allows you to pool your drives, of any size, and provides one click duplication, making installing new disks and taking backups a breeze for the home user. The clue is in the title: Windows Home Server.</p>
<p>Vail has been in the works for a while, and a <a href=" http://windowsteamblog.com/windows/b/windowshomeserver/archive/2010/11/23/windows-home-server-code-name-vail-update.aspx">recent post</a> on the WHS blog has announced that the number one feature has been stripped. I&#8217;m fortunate enough, I guess, in that I understand how RAIDs work, and know how to set them up. However, I use WHS because I don&#8217;t have too. I spend enough time at work with computers that I don&#8217;t want to at home.</p>
<p>Absolutely unbelievable. Microsoft manage to alienate their core customer base (of this product) in one fell swoop.</p>
<p>Still, at least it saves me the cost of the upgrade.</p>
<div class="shr-publisher-694"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://r-dunn.co.uk/ieatpenguin/computing/software/windows-home-server-v2-vail-is-dead-in-the-water/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Userenv Error 1500/1505/1508 &#8211; Profile Unable to Login</title>
		<link>http://r-dunn.co.uk/ieatpenguin/computing/software/userenv-error-150015051508-profile-unable-to-login/</link>
		<comments>http://r-dunn.co.uk/ieatpenguin/computing/software/userenv-error-150015051508-profile-unable-to-login/#comments</comments>
		<pubDate>Mon, 27 Sep 2010 15:39:27 +0000</pubDate>
		<dc:creator>Russell</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://r-dunn.co.uk/ieatpenguin/?p=682</guid>
		<description><![CDATA[Windows cannot log you on because your profile cannot be loaded. Check that you are connected to the network, or that your network is functioning correctly. If this problem persists, contact your network administrator. This annoying error message plagued me &#8230; <a href="http://r-dunn.co.uk/ieatpenguin/computing/software/userenv-error-150015051508-profile-unable-to-login/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><blockquote><p>Windows cannot log you on because your profile cannot be loaded. Check that you are connected to the network, or that your network is functioning correctly. If this problem persists, contact your network administrator. </p></blockquote>
<p>This annoying error message plagued me for quite a long time until I eventually found the solution. The problem appears to be with the pagefile not being able to perform user profile allocation properly.</p>
<p>After a fair bit of searching and tinkering, I eventually hit upon the following solution:</p>
<ul>
<li>First set the pagefile to by managed by the system.</li>
</ul>
<ul>
<li>Load regedit, and find: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management</li>
<li>Create a new DWORD called PoolUsageMaximum. Set this to 60 (Decimal).</li>
<li>Create/Modify PagedPoolSize (DWORD) to ffffffff (Hex).</li>
<li>Reboot.</li>
</ul>
<p>What this does is simply force the Memory Manager in windows to attempt to trim the pagefile when it is 60% full, rather than its default 80%. This therefore starts the pagefile trim earlier, hopefully enabling the computer to cope with surges in memory demand more efficiently.</p>
<div class="shr-publisher-682"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://r-dunn.co.uk/ieatpenguin/computing/software/userenv-error-150015051508-profile-unable-to-login/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MSSQL &#8211; How To Output To A File</title>
		<link>http://r-dunn.co.uk/ieatpenguin/computing/software/sql/o-mssql-how-to-output-to-a-file/</link>
		<comments>http://r-dunn.co.uk/ieatpenguin/computing/software/sql/o-mssql-how-to-output-to-a-file/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 08:15:07 +0000</pubDate>
		<dc:creator>Russell</dc:creator>
				<category><![CDATA[SQL]]></category>
		<category><![CDATA[MSSQL]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://r-dunn.co.uk/ieatpenguin/?p=627</guid>
		<description><![CDATA[There is a very, very simple one liner within MySQL to dump the results of a query into a text file. Nothing so simple exists within MSSQL, but there are fairly easy workarounds. Using BCP, one can use the xp_cmdshell &#8230; <a href="http://r-dunn.co.uk/ieatpenguin/computing/software/sql/o-mssql-how-to-output-to-a-file/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>There is a very, very simple one liner within MySQL to dump the results of a query into a text file. Nothing so simple exists within MSSQL, but there are fairly easy workarounds. Using BCP, one can use the xp_cmdshell to pass the results into the desired file.</p>
<p><pre><code>use &lt;em&gt;DatabaseName&lt;/em&gt;
go

declare @FileName varchar(50)
declare @bcpCommand varchar(2000)

set @FileName = REPLACE(&#039;c:\temp\bcp\postcodes_&#039;+CONVERT(char(8),GETDATE(),1)+&#039;.csv&#039;,&#039;/&#039;,&#039;-&#039;)

set @bcpCommand = &#039;bcp &quot;select left(postcode,4), count(*) from DatabaseName..TableName where customersequence = 0 group by left(postcode,4) order by count(*) desc&quot; queryout &quot;&#039;
set @bcpCommand = @bcpCommand + @FileName + &#039;&quot; -U username -P password -c&#039;

EXEC master..xp_cmdshell @bcpCommand</code></pre></p>
<p>This dumps a load of postcode information, based on usage, into a csv file in c:\temp\bcp. What the query is doesn&#8217;t really matter, just the bcp commands to provide us with the results in a file of our choosing (.csv in this case).</p>
<p>The @FileName command simply appends the current date to the file in order to keep track of queries.</p>
<div class="shr-publisher-627"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://r-dunn.co.uk/ieatpenguin/computing/software/sql/o-mssql-how-to-output-to-a-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Into outfile</title>
		<link>http://r-dunn.co.uk/ieatpenguin/computing/software/windows/into-outfile/</link>
		<comments>http://r-dunn.co.uk/ieatpenguin/computing/software/windows/into-outfile/#comments</comments>
		<pubDate>Wed, 07 Jul 2010 14:29:03 +0000</pubDate>
		<dc:creator>Russell</dc:creator>
				<category><![CDATA[SQL]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://r-dunn.co.uk/ieatpenguin/?p=623</guid>
		<description><![CDATA[Why oh why oh why is there nothing this simple within MSSQL? Sigh.]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>Why oh why oh why is there nothing this simple within MSSQL? Sigh.</p>
<div class="shr-publisher-623"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://r-dunn.co.uk/ieatpenguin/computing/software/windows/into-outfile/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mounting a network drive in Linux (Ubuntu)</title>
		<link>http://r-dunn.co.uk/ieatpenguin/computing/software/mounting-a-network-drive-in-linux/</link>
		<comments>http://r-dunn.co.uk/ieatpenguin/computing/software/mounting-a-network-drive-in-linux/#comments</comments>
		<pubDate>Sat, 27 Feb 2010 12:54:25 +0000</pubDate>
		<dc:creator>Russell</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Samba]]></category>

		<guid isPermaLink="false">http://r-dunn.co.uk/ieatpenguin/?p=571</guid>
		<description><![CDATA[This is a very simple thing to do, it isn&#8217;t however as simple as one might think if you are coming from a Windows background, and are used to mapping a network drive from the Tools menu. As a note &#8230; <a href="http://r-dunn.co.uk/ieatpenguin/computing/software/mounting-a-network-drive-in-linux/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>This is a very simple thing to do, it isn&#8217;t however as simple as one might think if you are coming from a Windows background, and are used to mapping a network drive from the Tools menu. As a note this is a guide for Ubuntu, although I have it working fine on both Ubuntu and Fedora, use the appropriate package manager/command line for Fed and the rest is the same.</p>
<p>First, we need to make sure that samba is installed:</p>
<blockquote><p>sudo apt-get install smbfs</p></blockquote>
<p>Next, we need to make a directory to mount the drive too. As an example, I&#8217;ve just reinstalled my Ubuntu (and Fedora) distribution, and so want to map the music drive on my server. I chose /media/ as the logical place to stick my network drives:</p>
<blockquote><p>sudo mkdir /media/music</p></blockquote>
<p>Next we need to tell the file system table where the drives are, and where to mount them. We also need to include our login credentials (will cover this later).</p>
<blockquote><p>gksudo gedit /etc/fstab</p></blockquote>
<p>Scroll to the bottom of the file and add the following:</p>
<blockquote><p>#Mounting Network Drives<br />
//SERVER/SHARE-NAME /MOUNT-POINT smbfs credentials=/credentials-file-location</p></blockquote>
<p>To make the above make a bit more sense, here is my configuration:</p>
<blockquote><p>//192.168.1.50/Music /media/music smbfs credentials=/home/russell/credentials.smbcredentials<br />
//192.168.1.50/Videos /media/videos smbfs credentials=/home/russell/credentials.smbcredentials<br />
//192.168.1.50/Software /media/software smbfs credentials=/home/russell/credentials.smbcredentials</p></blockquote>
<p>What this will do is to check within the credentials file (more on this at the bottom) your username and password for your server (I am running a Windows Home Server as an example).</p>
<p>Next, we need to make the filesystem mount the drive, which we do simply with:</p>
<blockquote><p>sudo mount -a</p></blockquote>
<p>Finally, we need to make that credentials file. Simply navigate to your chosen directory (I stuck it in my /home/russell directory for ease), create a new file with the following information:</p>
<blockquote><p>username=<em>username</em><br />
password=<em>password</em></p></blockquote>
<p>And save it with the same filename you gave the /fstab/. Thats it.</p>
<div class="shr-publisher-571"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://r-dunn.co.uk/ieatpenguin/computing/software/mounting-a-network-drive-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>EU Probes Google Antitrust Case</title>
		<link>http://r-dunn.co.uk/ieatpenguin/computing/software/eu-probes-google-antitrust-case/</link>
		<comments>http://r-dunn.co.uk/ieatpenguin/computing/software/eu-probes-google-antitrust-case/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 12:27:17 +0000</pubDate>
		<dc:creator>Russell</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Google]]></category>

		<guid isPermaLink="false">http://r-dunn.co.uk/ieatpenguin/?p=567</guid>
		<description><![CDATA[This is long, long, LONG overdue. I was going to write a few things, but this comment on the Times Website succinctly summed it up, so thanks to &#8220;I.M. Jolly&#8221;. The difference between &#8220;do no Evil..&#8221; Google and Microsoft is, &#8230; <a href="http://r-dunn.co.uk/ieatpenguin/computing/software/eu-probes-google-antitrust-case/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>This is long, long, LONG overdue.</p>
<p>I was going to write a few things, but this comment on the Times Website succinctly summed it up, so thanks to &#8220;I.M. Jolly&#8221;.</p>
<blockquote><p>The difference between &#8220;do no Evil..&#8221; Google and Microsoft is, MS are a damn sight less hypocritical about their monopoly postion. And abuse thereof.</p>
<p>If the simple fact that &#8220;Google is rapidly increasing how much it spends on lobbying in the United States..&#8221; doesnt tell you anything, I dont know what else will &#8211; ok Google fanboys, you can now go back to your Google searches for everything, Your GMail with targeted ads based on the content of your mails and put your head back under the pillow. For the rest of us, I am sure we can agree that some scrutiny of a company which has basically won control of the internet, while gaining a very, very large amount of personal users data and their surfing habits, is entirely overdue.</p>
<p>Or, maybe, as the Google CEO (Eric Schmidt) himself says, &#8220;&#8221;If you have something that you don&#8217;t want anyone to know, maybe you shouldn&#8217;t be doing it in the first place..&#8221; &#8211; unless of course, that knowledge is personal details of his, obtained by CNET Journalists only via Google searches. Google blacklisted CNET for about a year over this, then again, they really do have to the power to be both evil and hypocritical, whenever it suits. The public have somewhat less choice in blacklisting which Information Google collects from them.</p>
<p>However, Google only use the info they have collected on YOU to sell ads, dont they? No problem there, then.</p></blockquote>
<div class="shr-publisher-567"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://r-dunn.co.uk/ieatpenguin/computing/software/eu-probes-google-antitrust-case/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

