<?xml version="1.0"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Theo Gray</title>
<link>http://www.theogray.com/blog/</link>
<description></description>
<copyright>Copyright 2013, Theo Gray</copyright>
<generator>Blog Admin v2.1</generator>
<ttl>60</ttl>
<lastBuildDate>Thu, 23 May 2013 11:48:43 GMT</lastBuildDate>
<pubDate>Thu, 23 May 2013 11:48:43 GMT</pubDate>
<language>en-us</language>
<atom:link href="http://www.theogray.com/blog/feed.xml" rel="self" type="application/rss+xml" />
<image>
  <title>Theo Gray</title>
  <url>http://www.theogray.com/i/tg150x50.gif</url>
  <link>http://www.theogray.com/blog/</link>
</image>
<item>
  <title>Reading IPv6 address AFINET6 from WTSQuerySessionInformation in VB6</title>
  <link>http://www.theogray.com/blog/2013/05/reading-ipv6-address-afinet6-from-wtsquerysessioni</link>
  <description><![CDATA[Solved: How to retrieve IPv6 address from WTSQuerySessionInformation in VB6 when WTS_CLIENT_ADDRESS.AddressFamily returns AF_INET6.<br /> <br /><a href="http://www.theogray.com/blog/2013/05/reading-ipv6-address-afinet6-from-wtsquerysessioni">Read full article...</a>]]></description>
  <pubDate>Tue, 21 May 2013 11:12:12 GMT</pubDate>
  <category>Windows Server</category>
  <category>VB</category>
  <category>Microsoft</category>
  <category>Remote Desktop Services</category>
  <category>Terminal Services</category>
  <category>TS Gateway</category>
  <guid isPermaLink="true">http://www.theogray.com/blog/2013/05/reading-ipv6-address-afinet6-from-wtsquerysessioni</guid>
  <comments>http://www.theogray.com/blog/2013/05/reading-ipv6-address-afinet6-from-wtsquerysessioni#readercomments</comments>
</item>
<item>
  <title>Using Json.Net to deserialize for WebApi methods</title>
  <link>http://www.theogray.com/blog/2013/03/using-jsonnet-to-deserialise-in-web-api</link>
  <description><![CDATA[<p>Having battled with the problems of the default Json deserialiser in WebApi, I wanted to use Json.Net instead.</p>
<p>The way I ultimately want to do this would be to pass the model in as a parameter and have it deserialized by Json.Net automatically, which by the looks of it is done with a MediaFormatter (presumably that is what I'll end up doing once I've looked into it further).</p>
<pre class="brush:vb;light:true;">Public Sub Post(model As MyModelView) As String
    'Do what you need to store the data
    Return "OK"
End Sub</pre>
<p>The following solution isn't quite as pretty, but is a simple way to deserialize incoming data to WebApi methods, using Json.Net:</p>
<h3>1. Create an Extension method within a Module</h3>
<pre class="brush:vb;light:true;">Module Extensions

    ' Deserializes the specified Request content from Json to the specified type
    Function FromJson(Of T)(ByVal Request As System.Net.Http.HttpRequestMessage) As T
        Dim data As String = Request.Content.ReadAsStringAsync().Result
        Return Newtonsoft.Json.JsonConvert.DeserializeObject(Of T)(data)
    End Function

End Module</pre>
<h3>2. Deserialise instead of using parameters</h3>
<p>Use the simple extension above instead of having a method parameter:</p>
<pre class="brush:vb;light:true;">Public Sub Post() As String
    Dim model As MyModelView = Request.FromJson(Of MyModelView)()
    'Do what you need to store the data
    Return "OK"
End Sub</pre>]]></description>
  <pubDate>Fri, 15 Mar 2013 17:01:07 GMT</pubDate>
  <category>VB</category>
  <category>Net</category>
  <category>Microsoft</category>
  <category>WebApi</category>
  <category>MVC</category>
  <guid isPermaLink="true">http://www.theogray.com/blog/2013/03/using-jsonnet-to-deserialise-in-web-api</guid>
  <comments>http://www.theogray.com/blog/2013/03/using-jsonnet-to-deserialise-in-web-api#readercomments</comments>
</item>
<item>
  <title>Christmas Puzzle 2012 - Dedicated to Lynne Truss</title>
  <link>http://www.theogray.com/blog/2012/12/christmas-puzzle-2012-dedicated-to-lynne-truss</link>
  <description><![CDATA[<p><a href="http://www.christmaspuzzle.co.uk/"><img align="right" alt="Christmas Puzzle" border="0" class="inline_right noborder" height="109" hspace="12" src="http://www.eatonbray.com/news/images/christmas-puzzle.gif" width="200" /></a>This year's annual Charity Christmas Puzzle has now been posted, and is available to download.</p>
<p>This, the 22nd annual Puzzle that Gordon Gray has set, has a theme designed to help completion and will appeal to people who enjoy doing Crossword puzzles, such as in the Daily Telegraph (though it is not a Crossword puzzle). Puzzlers have plenty of time to find the answers and Puzzles should be returned, with donation, by 27 January 2013.</p>
<p>All the money you donate, except for the prize-money, will go to charity.</p>
<p><strong>Four winners will each receive a &pound;30 prize.<br />Everyone who enters will qualify for a prize draw.</strong></p>
<p>So what are you waiting for, give it a go and download the&nbsp;<a href="http://www.christmaspuzzle.co.uk/">Christmas Puzzle</a>&nbsp;now.</p>]]></description>
  <pubDate>Sat, 08 Dec 2012 00:00:00 GMT</pubDate>
  <category>Christmas</category>
  <category>Puzzle</category>
  <guid isPermaLink="true">http://www.theogray.com/blog/2012/12/christmas-puzzle-2012-dedicated-to-lynne-truss</guid>
  <comments>http://www.theogray.com/blog/2012/12/christmas-puzzle-2012-dedicated-to-lynne-truss#readercomments</comments>
</item>
<item>
  <title>Error loading TS Gateway Manager</title>
  <link>http://www.theogray.com/blog/2012/02/error-loading-ts-gateway-manager</link>
  <description><![CDATA[<p><img class="inline_right noborder" title="Remote Desktop Services" src="http://www.theogray.com/blog/images/rds.jpg" alt="Remote Desktop Services" width="110" height="105" align="right" /><em>Another random problem which luckily I found a <a rel="nofollow" href="http://www.microsoft-questions.com/microsoft/Windows-Terminaldienste/32347391/problem-mit-ts-gateway.aspx" target="_blank">German article</a> about.</em></p>
<h3>Problem</h3>
<p>When opening <strong>TS Gateway Manager</strong>, you get the following unhandled exception appear:</p>
<pre class="brush:js;light:true;">Unhandled Exception in Managed Code Snap-in
FX:{4a5cf35e-7944-4869-9407-de1cbe40a268}
Object reference not set to an instance of an object.
ExceptionType:
   System.NullReferenceException
Exception Stack Trace:
   at Microsoft.TerminalServices.Proxy.SnapIn.BackEnd.WmiTerminalServicesGatewayStore.AddServer(String serverName, Boolean getData)
   at Microsoft.TerminalServices.Proxy.SnapIn.TsProxyServer.ConnectToServer(IProgressDisplay progress)
   at Microsoft.TerminalServices.Proxy.SnapIn.SnapInStartPage.SnapInStartPageNode.ConnectToServer(String serverName, Boolean silent)
   at Microsoft.TerminalServices.Proxy.SnapIn.TSProxySnapIn.OnLoadCustomData(AsyncStatus status, Byte[] persistenceData)
   at Microsoft.ManagementConsole.SnapIn.ProcessRequest(Request request)
   at Microsoft.ManagementConsole.Internal.SnapInClient.Microsoft.ManagementConsole.Internal.IMessageClient.ProcessRequest(Request request)
   at Microsoft.ManagementConsole.Internal.IMessageClient.ProcessRequest(Request request)
   at Microsoft.ManagementConsole.Executive.RequestStatus.BeginRequest(IMessageClient messageClient, RequestInfo requestInfo)
   at Microsoft.ManagementConsole.Executive.SnapInRequestOperation.ProcessRequest()
   at Microsoft.ManagementConsole.Executive.Operation.OnThreadTransfer(SimpleOperationCallback callback)</pre>
<h3>Solution</h3>
<p>Make sure you have a website called "Default Web Site" in IIS...&nbsp;It doesn't matter what you do with any other properties of the website, just make sure the name on the IIS tree is "Default Web Site"!</p>
<p>You would have thought this sort of exception should be picked up with a nice friendly error message, but there you go.</p>]]></description>
  <pubDate>Wed, 01 Feb 2012 14:27:32 GMT</pubDate>
  <category>Windows Server</category>
  <category>Remote Desktop Services</category>
  <category>Terminal Services</category>
  <category>TS Gateway</category>
  <guid isPermaLink="true">http://www.theogray.com/blog/2012/02/error-loading-ts-gateway-manager</guid>
  <comments>http://www.theogray.com/blog/2012/02/error-loading-ts-gateway-manager#readercomments</comments>
</item>
<item>
  <title>Christmas Puzzle 2011 - Snakes and ladders</title>
  <link>http://www.theogray.com/blog/2011/12/christmas-puzzle-2011-snakes-ladders</link>
  <description><![CDATA[<p><a href="http://www.christmaspuzzle.co.uk/"><img class="inline_right noborder" src="http://www.eatonbray.com/news/images/christmas-puzzle.gif" alt="Christmas Puzzle" hspace="12" width="200" align="right" /></a>This year's annual Charity <a href="http://www.christmaspuzzle.co.uk/">Christmas Puzzle</a> has now been posted, and is available to download.</p>
<p>This, the 21st annual Puzzle that Gordon Gray has set, has a theme designed to help completion and will appeal to people who enjoy doing Crossword puzzles, such as in the Daily Telegraph (though it is not a Crossword puzzle). Puzzlers have plenty of time to find the answers and Puzzles should be returned, with donation, by 22nd January 2012.</p>
<p><strong>Four winners will each receive a &pound;30 prize.<br />Everyone who enters will qualify for a &pound;30 prize draw.</strong></p>
<p>So what are you waiting for, give it a go and download the <a href="http://www.christmaspuzzle.co.uk/">Christmas Puzzle</a> now.</p>]]></description>
  <pubDate>Tue, 06 Dec 2011 00:00:00 GMT</pubDate>
  <category>Christmas Puzzle</category>
  <guid isPermaLink="true">http://www.theogray.com/blog/2011/12/christmas-puzzle-2011-snakes-ladders</guid>
  <comments>http://www.theogray.com/blog/2011/12/christmas-puzzle-2011-snakes-ladders#readercomments</comments>
</item>
<item>
  <title>Slow Login to Windows Server 2008 R2 Remote Desktop</title>
  <link>http://www.theogray.com/blog/2011/08/slow-login-to-windows-server-2008-r2-remote-desktop</link>
  <description><![CDATA[<p><img class="inline_right noborder" title="Remote Desktop Services" src="http://www.theogray.com/blog/images/rds.jpg" alt="Remote Desktop Services" width="275" height="262" align="right" /><em>Having spent 5 weeks with Microsoft technicians trying to work this one out, and seeing plenty of unsolved forum posts on this topic, it seemed worth sharing as the final solution was fairly basic.</em></p>
<h3>Problem</h3>
<p>While logging into Terminal/Remote Desktop Services (TS/RDS) on Windows Server 2008 R2, both the "Securing remote connection..." and "Applying User Settings..." phases take a very long time (45 to 90 seconds in some cases) to complete.</p>
<h3>Solution</h3>
<p>Ensure that the IPv6 address assigned to the 6TO4 Tunnel (as well as the IPv4 address) of the Terminal Server is allowed on the domain controller for the following:</p>
<ul>
<li>All <em>Active Directory</em>&nbsp;rules</li>
<li>All <em>Kerberos</em>&nbsp;rules</li>
<li><em>Core Networking - IPv6 (IPv6-In)</em> for just the IPv4 address.</li>
</ul>
<p>&nbsp;</p>
<hr class="required" />
<p>During the case with Microsoft, many logs were taken from various machines, but it was the <a href="http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;id=4865" target="_blank">Netmon</a> traces that showed that multiple Kerberos packets were being sent by the TS server and not being acknowledged by the DC.</p>
<p>Checking the firewall logs for dropped packets on the domain controller showed that the Terminal Server was trying to connect to port 88 (Kerberos) using&nbsp;protocol 41 (used by the 6TO4 tunnel) from the IPv4 address and having the packets dropped. Once that had been opened, further packets from the 6TO4 tunnel IPv6 address were then being dropped for LDAP requests.</p>
<p>This was on Server 2008 R2, but there's no reason to think this wouldn't also solve similar issues on previous versions of Windows Server.</p>]]></description>
  <pubDate>Tue, 23 Aug 2011 09:15:00 GMT</pubDate>
  <category>Windows Server</category>
  <category>Remote Desktop Services</category>
  <category>Terminal Services</category>
  <guid isPermaLink="true">http://www.theogray.com/blog/2011/08/slow-login-to-windows-server-2008-r2-remote-desktop</guid>
  <comments>http://www.theogray.com/blog/2011/08/slow-login-to-windows-server-2008-r2-remote-desktop#readercomments</comments>
</item>
<item>
  <title>Christmas Puzzle 2010 - Winnie-the-Pooh</title>
  <link>http://www.theogray.com/blog/2010/12/christmas-puzzle-2010-winnie-the-pooh</link>
  <description><![CDATA[<p><a href="http://www.christmaspuzzle.co.uk/"><img class="inline_right noborder" src="http://www.eatonbray.com/news/images/christmas-puzzle.gif" alt="Christmas Puzzle" hspace="12" width="200" align="right" /></a>This year's annual Charity <a href="http://www.christmaspuzzle.co.uk/">Christmas Puzzle</a> has now been posted, and is available to download.</p>
<p>This, the 20th annual Puzzle that Gordon Gray has set, has a theme designed to help completion and will appeal to people who enjoy doing Crossword puzzles, such as in the Daily Telegraph (though it is not a Crossword puzzle). Puzzlers have plenty of time to find the answers and Puzzles should be returned, with donation, by 23rd January 2011.</p>
<p><strong>Four winners will each receive a &pound;30 prize.<br />Everyone who enters will qualify for a &pound;30 prize draw.</strong></p>
<p>So what are you waiting for, give it a go and download the <a href="http://www.christmaspuzzle.co.uk/">Christmas Puzzle</a> now.</p>]]></description>
  <pubDate>Wed, 08 Dec 2010 00:00:00 GMT</pubDate>
  <category>Christmas Puzzle</category>
  <guid isPermaLink="true">http://www.theogray.com/blog/2010/12/christmas-puzzle-2010-winnie-the-pooh</guid>
  <comments>http://www.theogray.com/blog/2010/12/christmas-puzzle-2010-winnie-the-pooh#readercomments</comments>
</item>
<item>
  <title>Telling Computers and Humans Apart in web forms without visible CAPTCHAs</title>
  <link>http://www.theogray.com/blog/2010/10/telling-computers-humans-apart-in-web-forms-without-captha</link>
  <description><![CDATA[<p>Many websites use <a href="http://en.wikipedia.org/wiki/CAPTCHA">CAPTCHAs</a> of one form or another to try and tell the difference between Humans and Computers interacting with web forms. As the <a href="http://www.bbc.co.uk/blogs/bbcinternet/2010/10/captcha_and_bbc_id.html" target="_blank">BBC have recently commented</a>, these can be cumbersome to implement and also annoying to users.</p>
<p>Automated ways to distinguish humans and computer bots when submitting data via a web page are relatively easy once you figure out the ways each interact with web servers.</p>
<p>The basic thing that almost all spambots have in common is that they</p>
<ol type="a">
  <li>Don't support session cookies,</li>
  <li>Don't run Javascript code, and</li>
  <li>Try to submit hyperlinks in one form or another</li>
</ol>
<p>Unfortunately, to implement a website form that requires both session cookies and Javascript to submit correctly requires a little more code than a basic &lt;form&gt; tag, but it shouldn't be difficult to make this code generic and manipulate the browser DOM to make the developer implementation very simple. On top of that, requiring moderation for anything that includes a hyperlink means that even the human spammers don't get through.</p>
<p>After very <a href="http://www.theogray.com/blog/2007/10/woo-ajax">close to three years</a> of running such a system on various websites that I look after, it is still yet to be cracked by any automated bots and also has not had any false-positives (apart from requiring moderation for a very small number of posts where people are submitting legitimate URLs). The only human (non-automated) spammer that has made it through to be moderated is from one IP address in Russia that regularly tries to include a link to a fake finance blog, so again something that's very easy to block with the right back end in place.</p>]]></description>
  <pubDate>Wed, 06 Oct 2010 15:39:20 GMT</pubDate>
  <category>Computers</category>
  <category>Websites</category>
  <guid isPermaLink="true">http://www.theogray.com/blog/2010/10/telling-computers-humans-apart-in-web-forms-without-captha</guid>
  <comments>http://www.theogray.com/blog/2010/10/telling-computers-humans-apart-in-web-forms-without-captha#readercomments</comments>
</item>
<item>
  <title>The International Routing System scam</title>
  <link>http://www.theogray.com/blog/2010/07/international-routing-system</link>
  <description><![CDATA[<p>I've just had a call from a charming Indian gentlemen telling me he was from the <strong>International Routing System</strong> and that my computer was generating a lot of traffic which was disrupting the "International Routing Systems".</p>
<p>Apparently he had my phone number because my IP address was creating all this traffic and so he wanted to show me how to cleanup my machine. I thought it could be fun to find out how he was going to try to scam me, so let him continue...</p>
<ul>
<li>Me: "So what's my IP address?"</li>
<li>IG: "I don't have that in front of me at the moment"</li>
<li>Me: "riigggt... so what would you like me to do to stop all this traffic blocking up the International Routings Systems?"</li>
<li>IG: "Please press the flag key and R on your keyboard"</li>
<li>Me: "OK"</li>
<li>IG: "type the letters 'i', 'n', 'f' - it stands for 'infection'"</li>
<li>Me: "OK, I've done that"</li>
<li>IG: "Now click OK"</li>
<li>Me: "Uh huh"</li>
<li>IG: "What do you see?"</li>
<li>Me: "A list of all the drivers installed on my computer"</li>
<li>IG: "You're wasting my time and your time, now bugger off"... beeeeeeeeeeeep</li>
</ul>
<p>Unfortunately caller ID only showed he was calling from an "International" number so I couldn't call him back to find out more about his wonderful International Routing System or what other things he was going to get me to do to my computer.</p>
<p>The <strong>International Routing System</strong> does not exist, and if you receive a call they will try to convince you to install virus-infected software, and probably to give them your credit card details. Either put the phone down immediately, or else laugh at every statement they make as it is pure fiction.</p>
<hr class="required" />
<p><em>Anyone worried that they have already let these people do something to your computer should run <a href="http://www.f-secure.com/en_EMEA/security/tools/online-scanner/" target="_blank">F-Secure's free online scanner</a> and if you don't already have any antivirus software installed on your machine, you should get something like <a href="http://www.microsoft.com/security_essentials/" target="_blank">Microsoft Security Essentials</a> which is a free antivirus package directly from Microsoft.</em></p>]]></description>
  <pubDate>Mon, 26 Jul 2010 12:17:53 GMT</pubDate>
  <category>Telephone Scams</category>
  <category>Internet Scams</category>
  <guid isPermaLink="true">http://www.theogray.com/blog/2010/07/international-routing-system</guid>
  <comments>http://www.theogray.com/blog/2010/07/international-routing-system#readercomments</comments>
</item>
<item>
  <title>The Secret Diary of Michael Schumacher... returns</title>
  <link>http://www.theogray.com/blog/2010/01/secret-diary-of-michael-schumacher-returns</link>
  <description><![CDATA[<p><img src="http://www.theogray.com/formula-1/images/part2010-0120.jpg" width="240" height="180" alt="Michael Schumacher" align="right" class="inline_right" />With the 2010 return of <a href="http://www.theogray.com/formula-1/schumacher-secret-diary.asp">The Secret Diary of Michael Schumacher</a> on Planet-F1, I've just added another year's worth of old entries back onto the interweb for your reading pleasure.</p>
<p>Read all his entries from 2002 to 2004, plus links to the latest entries in <a href="http://www.theogray.com/formula-1/schumacher-secret-diary.asp">The Secret Diary of Michael Schumacher</a>.</p>]]></description>
  <pubDate>Thu, 21 Jan 2010 00:00:00 GMT</pubDate>
  <category>Formula 1</category>
  <category>Michael Schumacher</category>
  <guid isPermaLink="true">http://www.theogray.com/blog/2010/01/secret-diary-of-michael-schumacher-returns</guid>
  <comments>http://www.theogray.com/blog/2010/01/secret-diary-of-michael-schumacher-returns#readercomments</comments>
</item>
<item>
  <title>Manual tagging on Facebook</title>
  <link>http://www.theogray.com/blog/2010/01/manual-tagging-on-facebook</link>
  <description><![CDATA[<p>Tagging of people in the text of status updates has been available on Facebook for a while now, but it still isn't available everywhere, such as comments and photo descriptions.</p>
<p>Luckily if you really want to tag someone in text in some of these other places (I've only made it work in photo descriptions so far) then you can do so. In addition you can manually tag people within status updates giving them whatever name you want.</p>
<p>All you have to do is include the following format in your text and Facebook will automatically display tag links:</p>
<pre class="brush:vb;light:true;">
Tagging @[USERID:blah] in a comment
</pre>
<p>Where <tt>USERID</tt> is the numeric Facebook ID of the user you want to tag, and <tt>blah</tt> can be any string.</p>
<p>So, for example:<br />
<tt>Tagging @[721981740:Theo] in a comment</tt></p>
<p>is displayed in Facebook as:<br />
<tt>Tagging <a href="http://www.facebook.com/profile.php?id=721981740">Theo</a> in a comment</tt></p>]]></description>
  <pubDate>Sat, 02 Jan 2010 10:42:22 GMT</pubDate>
  <category>Facebook</category>
  <guid isPermaLink="true">http://www.theogray.com/blog/2010/01/manual-tagging-on-facebook</guid>
  <comments>http://www.theogray.com/blog/2010/01/manual-tagging-on-facebook#readercomments</comments>
</item>
<item>
  <title>The Our Domain Set</title>
  <link>http://www.theogray.com/blog/2009/12/our-domain-set</link>
  <description><![CDATA[<p>It has to be said that over the years I have purchased quite a few domain names, but there was one that I have wanted for a while to add to the set of OurCarnival.co.uk, OurChurch.co.uk and OurPanto.co.uk - that being OurVillage.co.uk.</p>
<p>And yesterday I managed to buy it off the current owner, so finally the Eaton Bray website is available via <a href="http://www.ourvillage.co.uk/">www.ourvillage.co.uk</a>.</p>
<p>And if you hadn't heard yet, the <a href="http://www.christmaspuzzle.co.uk/">Christmas Puzzle</a> is now available to download!</p>]]></description>
  <pubDate>Tue, 08 Dec 2009 11:08:27 GMT</pubDate>
  <category>Eaton Bray</category>
  <category>Domain Names</category>
  <guid isPermaLink="true">http://www.theogray.com/blog/2009/12/our-domain-set</guid>
  <comments>http://www.theogray.com/blog/2009/12/our-domain-set#readercomments</comments>
</item>
</channel>
</rss>
