<?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>Anchor Web Hosting Blog &#187; windows</title>
	<atom:link href="http://www.anchor.com.au/blog/tag/windows/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.anchor.com.au/blog</link>
	<description>A view into the Anchor Engineroom</description>
	<lastBuildDate>Thu, 29 Jul 2010 06:35:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Automated server updates</title>
		<link>http://www.anchor.com.au/blog/2010/03/automated-server-updates/</link>
		<comments>http://www.anchor.com.au/blog/2010/03/automated-server-updates/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 06:31:39 +0000</pubDate>
		<dc:creator>Barney Desmond</dc:creator>
				<category><![CDATA[WTF]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[redhat]]></category>
		<category><![CDATA[updates]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.anchor.com.au/blog/?p=1271</guid>
		<description><![CDATA[This is going to be a contentious one, but here at Anchor we think automatically applying updates to servers is a Good Thing. It&#8217;s definitely not for everyone, but in an environment like ours with hundreds of managed servers it&#8217;s the only way you&#8217;re going to get things done and get any sleep at night. [...]]]></description>
			<content:encoded><![CDATA[<p>This is going to be a contentious one, but here at Anchor we think automatically applying updates to servers is a Good Thing. It&#8217;s definitely not for everyone, but in an environment like ours with hundreds of managed servers it&#8217;s the only way you&#8217;re going to get things done and get any sleep at night.</p>
<p>Sysadmin of note <a href="http://en.wikipedia.org/wiki/Tom_Limoncelli">Tom Limoncelli</a> advocates rolling out updates to progressively more machines with prior testing beforehand to mitigate the scope of potential problems (it&#8217;s called &#8220;one, some, many&#8221;). It&#8217;s certainly a good strategy for a large number of homogenous computers, but what we&#8217;re talking about here is a bit smaller-scale.</p>
<p>Specifically, we have customers with servers that we never touch, we call this <a href="http://www.anchor.com.au/dedicated-hosting/dedicated-support.py#monitor">Anchor Monitor</a>. These customers often have particular environments that they&#8217;re better off supporting themselves, so we monitor the machine to ensure it&#8217;s still on the network, and leave it at that. Unfortunately they&#8217;re not always kept up to date, so one of the more recent improvements to our process has been to enable automatic updating by default &#8211; it&#8217;s up to the customer if they want to change this once it&#8217;s handed over to them.</p>
<p>We&#8217;ve <a href="http://www.anchor.com.au/hosting/dedicated/Automatic-updates-for-servers">written this into a short procedure</a> if you&#8217;re interested. It applies directly to Debian and Redhat distributions, but it&#8217;s easily portable to other systems. If you run Windows, it&#8217;ll already be hassling you every 20min for updates. <img src='http://www.anchor.com.au/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.anchor.com.au/blog/2010/03/automated-server-updates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>When HA won&#8217;t play the way you want it to</title>
		<link>http://www.anchor.com.au/blog/2009/09/when-ha-wont-play-the-way-you-want-it-to/</link>
		<comments>http://www.anchor.com.au/blog/2009/09/when-ha-wont-play-the-way-you-want-it-to/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 03:26:29 +0000</pubDate>
		<dc:creator>oliver</dc:creator>
				<category><![CDATA[FTW]]></category>
		<category><![CDATA[drbd]]></category>
		<category><![CDATA[fail]]></category>
		<category><![CDATA[ha]]></category>
		<category><![CDATA[heartbeat]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[shoehorn]]></category>
		<category><![CDATA[win]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.anchor.com.au/blog/?p=1116</guid>
		<description><![CDATA[In an ideal world every service would support High Availability and Load Balancing, would scale up easily and cleanly and all of us systems administrators would be paid bucketloads to play golf all day while the computers did all the hard work. To quote Dylan Moran of Black Books fame, &#8220;Don&#8217;t make me laugh&#8230;bitterly&#8221;. I&#8217;ll [...]]]></description>
			<content:encoded><![CDATA[<p>In an ideal world every service would support High Availability and Load Balancing, would scale up easily and cleanly and all of us systems administrators would be paid bucketloads to play golf all day while the computers did all the hard work. To quote Dylan Moran of Black Books fame, &#8220;Don&#8217;t make me laugh&#8230;bitterly&#8221;.</p>
<p>I&#8217;ll cut to the chase &#8211; sometimes you have to really shoehorn technologies to do what you want. Fortunately I love doing this, and the technologies of today&#8217;s article are virtualised Windows 2008 on Xen, and Oracle XE 10g. Neither likes to play ball, for a few reasons:</p>
<ul>
<li>Generally speaking, when you virtualise an OS you want to have para-virtualisation drivers enhancing the hardware support. Open Source Xen has PV drivers, but they are not signed with a legitimate certificate. Windows 2008 does not play nicely with unsigned or test-cert-signed drivers.</li>
<li>Oracle is just a messy, messy, nasty thing. Yes, paid versions undoubtedly support all manner of loadbalancing and HA options, but the free one does not.</li>
</ul>
<h2>Adding HA to Windows 2008 on Xen</h2>
<p>The basic procedure was as follows:</p>
<ul>
<li>Install the telnet server within Windows (making sure to lock it down in the firewall to only be accessible by the host machines)</li>
<li>Create a special admin account and password used for triggering a shutdown</li>
<li>Create an Expect script which logs into the VM via telnet, and issues the shutdown command</li>
<li>Create a modified version of the Heartbeat Xen resource agent which calls the expect script to shut down the VM (and wait a safe period of time) before &#8220;xm shutdown&#8221; is called. Without this, &#8220;xm shutdown&#8221; will simply power off the VM (in absence of working PV drivers).</li>
</ul>
<p>The VM was already running on a DRBD volume between the two HA Xen servers, so I was able to just create a standard set of Heartbeat resources to control DRBD primary/secondary mode and the startup/shutdown of the HA WIndows VM. For your benefit (if you want to recreate it) here is the expect script:</p>
<pre>#!/usr/bin/expect -f
#
# Script which "automates" shutting down a Windows VM

# Don't log telnet output and commands to stdout, and set a reasonable timeout.
log_user 0
set timeout 3

# Log in via telnet and issue commands. Fairly straightforward.
spawn -noecho /usr/bin/telnet 192.168.1.1
sleep 0.5

# login as the "shutdown" user
expect {
 -re "login: $" {send "shutdown\r"}
 timeout exit
}
sleep 0.5
expect {
 -re "password: $" {send "mysecretpassword\r"}
 timeout exit
}
sleep 0.5
expect {
 -re "&gt;$" {send "shutdown /s /t 0\r"}
 timeout exit
}
sleep 0.1
expect {
 -re "&gt;$" {send "exit\r"}
 timeout exit
}
exit</pre>
<p>The rest is fairly self-explanatory if you understand Heartbeat.</p>
<h2>Oracle XE 10g</h2>
<p>This was more of a learning process, since usually you just install Oracle and leave it the hell alone. Not so for me.</p>
<ul>
<li>Install Oracle on both nodes using (fortunately) the RPMs they provide</li>
<li>Configure Oracle on both nodes including creating the databases, using the same password for SYSDBA</li>
<li>Shutdown both instances of Oracle</li>
<li>Create the DRBD resource, and mount it on the primary node</li>
<li>On the primary node, move the contents of /usr/lib/oracle/xe/oradata and /usr/lib/oracle/xe/app/oracle/flash_recovery_area onto the mounted DRBD</li>
<li>On the secondary node, delete the aforementioned paths</li>
<li>Bind mount the oradata and flash recovery area from the mounted DRBD volume into the correct places in the directory tree.</li>
<li>Start Oracle</li>
</ul>
<p>After I had created a Heartbeat resource group which contained the DRBD resource, the DRBD filesystem mount, the aforementioned bind mounts and the Oracle service itself I was quite pleased to see that Oracle plays quite nicely with our shoehorned HA setup. You&#8217;ll want to make sure you have a <a href="http://www.anchor.com.au/blog/2009/07/oracle-why-dost-thou-sucketh-so-prodigiously/">properly fixed</a> Oracle init script though, as the supplied one is fairly bad.</p>
<p>After making Oracle and Windows 2008 work nicely in HA, I&#8217;m almost certain any service no matter how bad can be shoehorned in a similar way to give you decent availability even when it was n&#8217;t originally intended.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.anchor.com.au/blog/2009/09/when-ha-wont-play-the-way-you-want-it-to/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>This just in, from the Department of the Bleedin&#8217; Obvious</title>
		<link>http://www.anchor.com.au/blog/2009/09/this-just-in-from-the-department-of-the-bleedin-obvious/</link>
		<comments>http://www.anchor.com.au/blog/2009/09/this-just-in-from-the-department-of-the-bleedin-obvious/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 02:20:01 +0000</pubDate>
		<dc:creator>Barney Desmond</dc:creator>
				<category><![CDATA[WTF]]></category>
		<category><![CDATA[fail]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[marketing]]></category>
		<category><![CDATA[spam]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.anchor.com.au/blog/?p=1113</guid>
		<description><![CDATA[I kid you not, we just received this in a piece of marketing guff from our favourite enterprise vendor. &#8220;Industry analysts predict that Linux and Windows will soon dominate the operating system space. How you respond to this is critical.&#8221; Meanwhile, industry analysts predict that more than 98% of the population will be consuming oxygen [...]]]></description>
			<content:encoded><![CDATA[<p>I kid you not, we just received this in a piece of marketing guff from our favourite enterprise vendor.</p>
<blockquote><p>&#8220;Industry analysts predict that Linux and Windows will soon dominate the operating system space. How you respond to this is critical.&#8221;</p></blockquote>
<p>Meanwhile, industry analysts predict that more than 98% of the population will be consuming oxygen by 2010.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.anchor.com.au/blog/2009/09/this-just-in-from-the-department-of-the-bleedin-obvious/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A great Windows FTP &amp; SFTP Client</title>
		<link>http://www.anchor.com.au/blog/2009/04/windows-ftp-scp-and-sftp-client/</link>
		<comments>http://www.anchor.com.au/blog/2009/04/windows-ftp-scp-and-sftp-client/#comments</comments>
		<pubDate>Tue, 21 Apr 2009 23:34:04 +0000</pubDate>
		<dc:creator>Paul De Audney</dc:creator>
				<category><![CDATA[FTW]]></category>
		<category><![CDATA[Awesome]]></category>
		<category><![CDATA[FTP]]></category>
		<category><![CDATA[SCP]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.anchor.com.au/blog/?p=804</guid>
		<description><![CDATA[A question I get asked reasonably often is &#8220;Do you know any good free FTP programs?&#8221; Yes, I do. It is WinSCP. Some of the cool features are: It does what it is designed to do and does it excellently. SFTP, SCP &#38; FTP support (ditch FTP and use SFTP!) I&#8217;ve never seen it crash. [...]]]></description>
			<content:encoded><![CDATA[<p>A question I get asked reasonably often is &#8220;Do you know any good free FTP programs?&#8221; Yes, I do. It is WinSCP.</p>
<p>Some of the cool <a title="WinSCP feature listing" href="http://winscp.net/eng/docs/introduction#features" target="_blank">features</a> are:</p>
<ul>
<li>It does what it is designed to do and does it excellently. </li>
<li>SFTP, SCP &amp; FTP support (ditch FTP and use SFTP!)</li>
<li>I&#8217;ve never seen it crash.</li>
<li>Transfer resuming on broken and cancelled downloads.</li>
<li>Supports <a href="http://www.anchor.com.au/hosting/dedicated/SSH_Public_Key_Authentication">SSH keys</a>, so you do not need to remember another password.</li>
<li><a title="WinSCP scripting support" href="http://winscp.net/eng/docs/scripting" target="_blank">Scripting</a> support; schedule your own remote backups or have sane website rollout procedures!</li>
</ul>
<p>The WinSCP site describes it as &#8220;WinSCP is an open source SFTP client and FTP client for Windows. Its main function is the secure file transfer between a local and a remote computer. Beyond this, WinSCP offers basic file manager functionality. It uses Secure Shell (SSH) and supports, in addition to Secure FTP, also legacy SCP protocol.&#8221;</p>
<p>You can download it from <a title="WinSCP download page" href="http://winscp.net/eng/download.php" target="_blank">here</a> and the obligatory screen shots can be found <a title="WinSCP screenshots" href="http://winscp.net/eng/docs/screenshots" target="_blank">here</a>.</p>
<p>All of Anchor&#8217;s <a title="Shared hosting plans" href="http://www.anchor.com.au/web-hosting/website-hosting.py" target="_blank">shared hosting</a> plans support SSH &amp; SFTP connections. If you want to read more about how to use SSH, we have some wiki articles that we prepared earlier. These were targeted to cover <a title="dedicated servers" href="http://www.anchor.com.au/dedicated-hosting/dedicated-servers.py" target="_blank">dedicated</a> &amp; <a title="VPS servers" href="http://www.anchor.com.au/vps/virtual-private-server.py" target="_blank">VPS</a> servers however they are still relevant.</p>
<ul>
<li><a title="SSH Publick Key Authentication" href="http://anchor.com.au/hosting/dedicated/SSH_Public_Key_Authentication" target="_blank">SSH Public Key Authentication</a></li>
<li><a title="Securing remote access via SSH and remote server security" href="http://anchor.com.au/hosting/dedicated/Securing_Remote_Access_via_SSH_and_Server_Security" target="_blank">Securing Remote Access via SSH and Server Security</a></li>
</ul>
<p>If you manage an important site, rollout scripts can really make your web site updates pain free. I encourage anyone not using rollout scripts to have a look at the scripting capabilities of WinSCP.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.anchor.com.au/blog/2009/04/windows-ftp-scp-and-sftp-client/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Filebucketing to the MAXXXXX</title>
		<link>http://www.anchor.com.au/blog/2009/03/filebucketing-to-the-maxxxxx/</link>
		<comments>http://www.anchor.com.au/blog/2009/03/filebucketing-to-the-maxxxxx/#comments</comments>
		<pubDate>Thu, 12 Mar 2009 02:41:08 +0000</pubDate>
		<dc:creator>oliver</dc:creator>
				<category><![CDATA[WTF]]></category>
		<category><![CDATA[fail]]></category>
		<category><![CDATA[filebucket]]></category>
		<category><![CDATA[state]]></category>
		<category><![CDATA[weblogic]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.anchor.com.au/blog/?p=549</guid>
		<description><![CDATA[Every now and then we see an example of application failure so astounding it literally brings tears to our eyes. We have a client whose legacy application is unfortunately still running on an ancient version of Oracle Weblogic and which must be maintained until the new, flashy .NET version of their site is complete. We [...]]]></description>
			<content:encoded><![CDATA[<p>Every now and then we see an example of application failure so astounding it literally brings tears to our eyes. We have a client whose legacy application is unfortunately still running on an ancient version of Oracle Weblogic and which must be maintained until the new, flashy .NET version of their site is complete.</p>
<p>We were alerted this morning to a problem with some of the Weblogic content &#8211; the pages were timing out. Diagnostics were fairly fruitless &#8211; packet captures showed nothing useful, and the logging from Weblogic left much to be desired. We started considering more outlandish possibilities such as I/O load causing issues, recently applied updates and so on. Even rebooting was considered (given it is running on Windows).</p>
<p>The first clue of note was the open file list from the Weblogic processes &#8211; one such example stood out:</p>
<pre>﻿<span style="font-size: small;">C:\weblogic\state\Sa0V\b1gR\O1Ok\WqYN\9kiv\IQT2\SHGx\C3ri\aE1z\L1YH\X5QW\
gdkB\B2PB\pPPw\uHDK\p1a7\I0l5\94sU\kQ43\+533\5517\5738\7484\6253\_-10\
6273\1519\_6_8\888_\8888\_700\2_702_8\888_

</span></pre>
<p><span style="font-size: small;">For the sake of your screen, I have manually wrapped this Godzilla-like filename.</span></p>
<pre></pre>
<pre></pre>
<p>Perhaps you are familiar with <a href="http://www.anchor.com.au/hosting/dedicated/efficient_file_storage">file bucketing</a> already, but if not, typically the directory structure used will have a relatively sane scheme for locating files and only extend a few levels deep. What we saw in this instance was a completely new breed of monster. Admittedly the absolute path of this file is less than 200 characters out of a limit of more than 32,000 but the naming strategy and depth of the structure has us flummoxed.</p>
<p>But this was only the tip of the proverbial iceberg. When we requested Windows to show us the properties of this state folder it took over an hour to completely calculate the file and folder totals, and the result is impressive:</p>
<div id="attachment_551" class="wp-caption aligncenter" style="width: 380px"><img class="size-full wp-image-551" src="http://www.anchor.com.au/blog/wp-content/uploads/2009/03/weblogicfail.png" alt="Web logic makes efficient use of the filesystem" width="370" height="476" /><p class="wp-caption-text">Web logic makes efficient use of the filesystem</p></div>
<p>Yes you read that right &#8211; over 10 million nested directories. By this stage we had already moved the state directory out of the way and created a new one, and restarted Weblogic. It seemed happy and quite responsive after that. My suspicion is that someone developing this application at some point ran into a limitation with their filebucketing algorithm, and resolved to solve the problem <strong>once and for all, </strong>evidently by making it possible to efficiently filebucket every file in the known universe.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.anchor.com.au/blog/2009/03/filebucketing-to-the-maxxxxx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Patch Tuesday again</title>
		<link>http://www.anchor.com.au/blog/2008/12/patch-tuesday-again/</link>
		<comments>http://www.anchor.com.au/blog/2008/12/patch-tuesday-again/#comments</comments>
		<pubDate>Sun, 14 Dec 2008 22:35:17 +0000</pubDate>
		<dc:creator>Barney Desmond</dc:creator>
				<category><![CDATA[WTF]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[patch tuesday]]></category>
		<category><![CDATA[reboot]]></category>
		<category><![CDATA[schedule]]></category>
		<category><![CDATA[updates]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.anchor.com.au/blog/?p=197</guid>
		<description><![CDATA[If you&#8217;re one of our dedicated server customers, you&#8217;ve got the option of a paid support package, the choices being Anchor Secure and Anchor Complete. Whatever you choose (or if you decide you don&#8217;t need one), we just hope it&#8217;s the right one for you. One of the services we provide with a support package [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re one of our <a href="http://www.anchor.com.au/dedicated-hosting/dedicated-servers.py">dedicated server</a> customers, you&#8217;ve got the option of a paid <a href="http://www.anchor.com.au/dedicated-hosting/dedicated-support.py">support package</a>, the choices being Anchor Secure and Anchor Complete. Whatever you choose (or if you decide you don&#8217;t need one), we just hope it&#8217;s <a href="http://www.anchor.com.au/hosting/dedicated/dedicated_server_support">the right one for you</a>.</p>
<p>One of the services we provide with a support package is keeping your system up to date. For Linux machines this means installing updated packages as they&#8217;re released, and for Windows this means staying on top of Windows Update. We can do a lot of this without you ever noticing, but Windows Updates almost always require a reboot of the machine, which we schedule with our customers by email.</p>
<p>This brings us to an amusing little snippet from one of our customers.</p>
<blockquote><p>Anchor: <em>We&#8217;re going to reboot your server next Wednesday at about 11pm, please tell us if that&#8217;ll cause any problems.</em></p>
<p>Customer: <em>Ah, I was not aware of Microsoft&#8217;s update schedule.</em></p></blockquote>
<p>Great Lord almighty, there are undiscovered tribes in the Amazon that know that Microsoft releases patches on the second Tuesday of the month!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.anchor.com.au/blog/2008/12/patch-tuesday-again/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bug report: &#8220;all&#8221; does not mean all, for some values of &#8220;all&#8221;</title>
		<link>http://www.anchor.com.au/blog/2008/11/bug-report-all-does-not-mean-all-for-some-values-of-all/</link>
		<comments>http://www.anchor.com.au/blog/2008/11/bug-report-all-does-not-mean-all-for-some-values-of-all/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 01:11:35 +0000</pubDate>
		<dc:creator>Barney Desmond</dc:creator>
				<category><![CDATA[WTF]]></category>
		<category><![CDATA[all files]]></category>
		<category><![CDATA[grep]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[text]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.anchor.com.au/blog/?p=54</guid>
		<description><![CDATA[We&#8217;ve discovered some interesting things about Windows, and they never fail to cause some head-scratching. We had cause to go rooting through a customer&#8217;s wordpress installation recently to hunt down the cause of PHP errors, and discovered two WTFs here. The first was the breakage of various scripts in the wp-admin directory. Through means unknown, [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve discovered some interesting things about Windows, and they never fail to cause some head-scratching. We had cause to go rooting through a customer&#8217;s wordpress installation recently to hunt down the cause of PHP errors, and discovered two WTFs here.</p>
<p>The first was the breakage of various scripts in the wp-admin directory. Through means unknown, every array definition was broken by the addition of a file path. If you grok PHP, you&#8217;ll recognise that this isn&#8217;t syntactically valid:</p>
<blockquote>
<pre><span style="#999999;"><span style="#999999;"><span style="#999999;"><span style="#339966;"><span style="#339966;"><span style="#339966;">$defaults</span></span></span> <span style="#999999;">=</span> <span style="#999999;"><span style="#0000ff;"><span style="#0000ff;"><span style="#0000ff;">array</span></span></span>(</span></span></span></span></pre>
<pre><span style="#999999;"><span style="#999999;"><span style="#999999;"><span style="#999999;"><span style="#000000;"><span style="#ff0000;"><span style="#ff0000;"><span style="#ff0000;">'show_option_all'</span></span></span>../../../<span style="#000000;"><span style="#000000;"><span style="#000000;">wordpress</span></span></span>/<span style="#000000;"><span style="#000000;"><span style="#000000;">wp-includes</span></span></span>/ =&gt; <span style="#ff0000;"><span style="#ff0000;"><span style="#ff0000;">''</span></span></span>,
<span style="#ff0000;"><span style="#ff0000;"><span>'show_option_none'</span></span></span>../../../<span style="#000000;"><span style="#000000;"><span style="#000000;">wordpress</span></span></span>/<span style="#000000;"><span style="#000000;"><span style="#000000;">wp-includes</span></span></span>/ =&gt; <span style="#ff0000;"><span style="#ff0000;"><span style="#ff0000;">''</span></span></span></span></span></span></span></span></pre>
<pre><span style="#999999;"><span style="#999999;"><span style="#999999;"><span style="#999999;">);</span></span></span></span></pre>
</blockquote>
<p>Python is our preferred in-house language, but breadth of knowledge is more important for a sysadmin. Cleaning up the PHP was a snap, but it&#8217;s a mystery as to how this happened in the first place; according to the customer it &#8220;just stopped working&#8221;. It looks a bit like someone got busy with a site-wide find-and-replace. This isn&#8217;t implausible, but it seems far less likely given that this is on a Windows machine.</p>
<p><span id="more-54"></span></p>
<p>Speaking of find and replace, just the finding dodgy strings proved to be more difficult than expected. Given that it was one customer&#8217;s site that was affected, it should be easy to search for all occurrences of <span style="#999999;"><span style="#999999;"><span style="#999999;"><span style="#000000;"><span style="#339966;"><span style="#ff0000;">../../../<span style="#000000;"><span style="#000000;">wordpress</span></span>/<span style="#000000;"><span style="#000000;">wp-includes</span></span>/</span></span> and be done with it.</span></span></span></span></p>
<p>Certainly under linux you&#8217;d use grep, put it in recursive mode and ask it to list the relevant files.</p>
<pre>grep -r -l '<span style="#999999;"><span style="#999999;"><span style="#999999;"><span style="#000000;">../../../<span style="#000000;"><span style="#000000;">wordpress</span></span>/<span style="#000000;"><span style="#000000;">wp-includes</span></span>/' /path/to/customers/site
</span></span></span></span></pre>
<p>Under Windows you&#8217;d use the usual file-search tool. Leave the filename field blank so we don&#8217;t limit it, then put the search string in the box below. Just to be really sure, we&#8217;ll open the Advanced Options and select &#8220;All Files and Folders&#8221;. Root the search at the customer&#8217;s site and fire it up, this is exactly what we need. Except that Windows won&#8217;t find the string in your PHP files.</p>
<p>As you may have guessed, this is when &#8220;all files&#8221; doesn&#8217;t actually mean all files. It even seems this is a known issue, and there&#8217;s a &#8220;fix&#8221; noted by someone else. The long and the short of it is that PHP files aren&#8217;t &#8220;recognised&#8221; by Windows, so it won&#8217;t try to search them; the latter page describes what you have to do to work around it.</p>
<p><a href="http://support.microsoft.com/?kbid=309173">http://support.microsoft.com/?kbid=309173</a></p>
<p><a href="http://cow.neondragon.net/index.php/72-Searching-Php-Files-With-Windows-Search">http://cow.neondragon.net/index.php/72-Searching-Php-Files-With-Windows-Search</a></p>
<p>In fairness, there&#8217;s a certain amount of logic to it. You probably don&#8217;t want to be searching for text in binary files like DLLs or video clips. That said, it badly breaks the expected behaviour of the search tool. If you&#8217;re searching for text in all files, it should (to our mind) be understood that you&#8217;re literally searching in <em>every</em> file.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.anchor.com.au/blog/2008/11/bug-report-all-does-not-mean-all-for-some-values-of-all/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A tale of two drives</title>
		<link>http://www.anchor.com.au/blog/2008/10/a-tale-of-two-drives/</link>
		<comments>http://www.anchor.com.au/blog/2008/10/a-tale-of-two-drives/#comments</comments>
		<pubDate>Thu, 09 Oct 2008 00:09:06 +0000</pubDate>
		<dc:creator>Barney Desmond</dc:creator>
				<category><![CDATA[WTF]]></category>
		<category><![CDATA[crash]]></category>
		<category><![CDATA[fail]]></category>
		<category><![CDATA[hard disk]]></category>
		<category><![CDATA[raid]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.anchor.com.au/blog/?p=17</guid>
		<description><![CDATA[It&#8217;s no secret that we&#8217;d rather be working on Linux than Windows here at Anchor. It is, by and large, much more annoying to actually get anything done, but it also just breaks in opaque and unexplained ways. O Windowes, let me count the ways in which you are broken! This is one such problem [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s no secret that we&#8217;d rather be working on Linux than Windows here at Anchor. It is, by and large, much more annoying to actually get anything done, but it also just breaks in opaque and unexplained ways. <em>O Windowes, let me count the ways in which you are broken!</em> This is one such problem we ran into yesterday.</p>
<p>Hard drive failure is a fact of life when you run servers, by sheer virtue of that fact that you have hundreds of them. To mitigate the risk and reduce unscheduled downtime, we use Window&#8217;s built-in software RAID feature. It&#8217;s not an enterprise solution, but it gets the job done. What&#8217;s important is staying online and not losing data.</p>
<p>Did I mention that trying to monitor a Windows box is a nightmare? A colleague of mine wrote <a href="http://www.anchor.com.au/hosting/dedicated/monitoring_windows_software_raid" target="_blank">a script to allow us to keep a watchful eye on Windows RAID volumes</a>, it&#8217;s a lifesaver. A recently-deployed machine got a broken mirror, which we were able to act on immediately. We removed the dodgy mirror and prepared a replacement (we always have plenty of spares, of course). Allow me now to re-enact this scene&#8230;</p>
<blockquote><p>Windows (sounding almost efficient): The driver has detected that device \Device\Harddisk1\DR9 has predicted that it will fail</p>
<p>Sysadmin: Thanks, Windows, I&#8217;ll get right on that. You didn&#8217;t say whether that was SMART, or just voodoo, but whatever, it&#8217;s good to know.</p>
<p><em>The bad drive is removed and a replacement installed in the hotswap drive bay</em></p>
<p>Sysadmin: Okay, Windows, do your stuff. &#8220;Scan for new hardware&#8221;, please.</p>
<p><em>A pause.</em></p>
<p>Sysadmin: Ahem, Windows, &#8220;Scan for new hardware&#8221; and find my drive.</p>
<p>Windows: &#8216;Ey there, chaps. Do what now, you say? AIEEEEGRH!!</p>
<p><em>The server stops responding entirely, necessitating a touch of the reset button</em></p></blockquote>
<p>Needless to say, we&#8217;re rather unimpressed, and have to call the customer to let them know why it&#8217;s just dropped offline.</p>
<p>A quick check of the logs is in order. It&#8217;s also frustrating that there&#8217;s no sane way to scroll through log entries in Windows with something like a text editor, or to &#8220;tail&#8221; a log as it&#8217;s updated in realtime.</p>
<blockquote><p>09:36 &#8211; The previous system shutdown at 9:21:23 AM on 8/10/2008 was unexpected.</p>
<p><em>Okay, it went down at 09:21, which is correct. Now if we look back in time a little&#8230;</em></p>
<p>09:21 &#8211; dmio: Harddisk1 write error at block 1953524618 due to disk removal</p></blockquote>
<p>*sigh* And this is after the disk was removed cleanly&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.anchor.com.au/blog/2008/10/a-tale-of-two-drives/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
