<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));

try {
var pageTracker = _gat._getTracker("UA-15604457-1");
pageTracker._trackPageview();
} catch(err) {}</description><title>Petes random thoughts and jottings</title><generator>Tumblr (3.0; @thepizzaboy)</generator><link>http://thepizzaboy.tumblr.com/</link><item><title>Chrome 19: xmlhttprequest open() with authentication is broken</title><description>&lt;p&gt;Good old Chrome autoupdated itself last week. All was fine except now I can&amp;#8217;t seemlessly log into my web applications.&lt;/p&gt;

&lt;p&gt;Turns out it has stopped supporting embedded identities eg: http://username:password@google.com&lt;br/&gt;
(note: that is not my real username and password!) That is fine but it looks like when you use the following code:&lt;/p&gt;

&lt;p&gt;var xhr = new XMLHttpRequest();&lt;br/&gt;
xhr.open(&amp;#8220;GET&amp;#8221;, &amp;#8220;/data&amp;#8221;, false, &amp;#8220;pete&amp;#8221;, &amp;#8220;test1&amp;#8221;); &lt;/p&gt;

&lt;p&gt;It doesn&amp;#8217;t use the username and password anymore and instead the user gets the authentication dialog box. &lt;/p&gt;

&lt;p&gt;Surely this is a bug?!&lt;/p&gt;

&lt;p&gt;I thought I had got a workaround by adding the following code:&lt;br/&gt;
xhr.setRequestHeader(&amp;#8220;Authorization&amp;#8221;,&amp;#8221;Basic cGV0ZTp0ZXN0Mg==&amp;#8221;);&lt;br/&gt;
This does work but the browser doesn&amp;#8217;t save the credentials, so if the browser gets sent to a secure page, you still get the popup authorisation dialog.&lt;/p&gt;

&lt;p&gt;My choices are:&lt;br/&gt;
1. Wait to see if they fix this problem&lt;br/&gt;
2. Don&amp;#8217;t support Chrome anymore&lt;br/&gt;
3. Rewrite the authentication system&lt;/p&gt;

&lt;p&gt;It looks like point 3 is the way to go. I might have to start using cookies within the authentication process, I really liked using the Basic HTTP authentication because it can be used by the browser and programmatically very easily. If I introduce cookies, then programmatically retrieving data gets harder and a lot messier.&lt;/p&gt;</description><link>http://thepizzaboy.tumblr.com/post/23476848375</link><guid>http://thepizzaboy.tumblr.com/post/23476848375</guid><pubDate>Mon, 21 May 2012 08:31:19 -0400</pubDate></item><item><title>Have we been Hacked?: An investigation</title><description>&lt;p&gt;I started to get a lot of spam email from one email address, about 10 every minute: they were all going into my junk mail folder but after a few hours I was curious as to why this was happening.&lt;/p&gt;

&lt;p&gt;In outlook, I opened the email and then selected &amp;#8216;Properties&amp;#8217; (in outlook 2010, click on File menu then click properties button). You get to see the headers for the email, of interest was the Received: header which identifies the source.&lt;/p&gt;

&lt;p&gt;Unfortunately the IP address it was coming from was one of our servers&amp;#8230; uh oh&amp;#8230;..&lt;/p&gt;

&lt;p&gt;Perhaps we had an smtp server sitting on there being used as our secondary mail server (in case our primary mail server went down) but no, the smtp server option hadn&amp;#8217;t been installed. I tried telnetting to port 25 on the box but no response so it didn&amp;#8217;t seem to be a piece of software (rogue or otherwise~) acting as an smtp server.)&lt;/p&gt;

&lt;p&gt;Next brainwave: I used netstat on the commandline to see if port 25 was currently in use. The command is:&lt;br/&gt;
netstat -ano   formats the data quite nicely and if you do the following:&lt;br/&gt;
netstat -ano |findstr :25  you can find only entries that are communicating to/from port 25.&lt;/p&gt;

&lt;p&gt;Success, netstat told me which process  was being used by giving me the pid (process id). If you then go into resource monitor or task manager you can relate pid to a process (you might have to add pid as a column for task manager).&lt;br/&gt;
It was a w3wp.exe   - one of the application pools on IIS. Luckily we have started to use application pool identities on IIS so I knew which application pool was the culprit  (On resource manager, add column &amp;#8216;username&amp;#8217; to see the application pool name, in task manager, it shows it there by default)&lt;/p&gt;

&lt;p&gt;Ok, it happens to be one of our old websites but how is it occurring? For that particular website (we have 1 application pool per website which makes things a lot easier) I then looked into its log files stored here: %SystemDrive%\inetpub\logs\LogFiles\{id}  (Find the ID from IIS manager by clicking on the sites folder in the left hand side and you will see all the sites with their ids)&lt;/p&gt;

&lt;p&gt;Most log files were 1Mb each, except for today which so far is 24Mb! Ahah!  Success. Looking into the log file told us which page was being &amp;#8216;hacked&amp;#8217;. It was a tell a friend page where you could enter yours and a friends email address along with a message and the server would send the friend an email looking like it came from your email. A classic case of forgetting to put a captcha on the page. The page has been around for 4 years and only today someone discovered its vulnerabilities. Luckily I am BCCd on all emails sent which is why I got a lot of emails sent to me. If I hadn&amp;#8217;t been copied in, we wouldn&amp;#8217;t have found out until our email server had been blacklisted.&lt;/p&gt;

&lt;p&gt;I blacklisted the IP address which put an immediate stop to the problem but have deleted the page aswell. It was very rarely used (not for months) and so wont be missed. But a good learning experience all round.&lt;/p&gt;

&lt;p&gt;By amazing coincidence my second in command is on holiday this week. He says he is at Centre Parcs but if I found out he has gone to the Philippines (which is where the IP address of the hacker comes from), well, I hope for his sake, he brings me back a nice present.&lt;/p&gt;</description><link>http://thepizzaboy.tumblr.com/post/12560655589</link><guid>http://thepizzaboy.tumblr.com/post/12560655589</guid><pubDate>Wed, 09 Nov 2011 12:33:28 -0500</pubDate><category>iis7</category><category>netstat</category></item><item><title>Adding associations in a dbml: LinqtoSQL</title><description>&lt;p&gt;Adding association to a dbml; if they aren&amp;#8217;t working making sure both tables have a primary key!&lt;/p&gt;</description><link>http://thepizzaboy.tumblr.com/post/12158517626</link><guid>http://thepizzaboy.tumblr.com/post/12158517626</guid><pubDate>Mon, 31 Oct 2011 08:43:26 -0400</pubDate><category>linqtosql</category></item><item><title>You know you're old when...</title><description>&lt;p&gt;After helping my daughter (age 6) with singing Its a long way to Tipperary, she asked me:&lt;/p&gt;

&lt;p&gt;&lt;b&gt;&amp;#8220;Were you in the war Daddy?&amp;#8221;&lt;/b&gt;&lt;/p&gt;</description><link>http://thepizzaboy.tumblr.com/post/11058157806</link><guid>http://thepizzaboy.tumblr.com/post/11058157806</guid><pubDate>Wed, 05 Oct 2011 08:02:32 -0400</pubDate></item><item><title>Fix: IIS 7 SecurityException: Request for the permission of type 'System.Web.AspNetHostingPermission  failed </title><description>&lt;p&gt;IIS 7 recommends using ApplicationPoolIdentities for its application pools. This is instead of using NetworkService. One advantage of this is looking at Processes in Task Manger, the IIS Worker process has the username matching the application pool name and thus it is easier to see which is consuming more resources etc.&lt;/p&gt;

&lt;p&gt;BUT, if you switch to ApplicationPoolIdentity as the Identity you might come across the following error:&lt;/p&gt;

&lt;p&gt;[SecurityException: Request for the permission of type &amp;#8216;System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&amp;#8217; failed.]&lt;/p&gt;

&lt;p&gt;&lt;b&gt;To fix this, in advance settings for the application pool change load user profile to true.&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;For more information on ApplicationPoolIdentity see&lt;a href="http://learn.iis.net/page.aspx/624/application-pool-identities/"&gt; &lt;a href="http://learn.iis.net/page.aspx/624/application-pool-identities/"&gt;http://learn.iis.net/page.aspx/624/application-pool-identities/&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://thepizzaboy.tumblr.com/post/8823144581</link><guid>http://thepizzaboy.tumblr.com/post/8823144581</guid><pubDate>Fri, 12 Aug 2011 11:03:36 -0400</pubDate><category>iis7</category></item><item><title>Accessing Reporting Services API locally: User Denied problem</title><description>&lt;p&gt;We deployed to a new server this morning with SQL Server 2008 running on it. Our software was trying to programmatically access the Reporting services api (found at: http://localhost/ReportServer/ReportExecution2005.asmx) This would work but if we used &lt;a href="http://publicurl.com/ReportServer/ReportExecution2005.asmx"&gt;http://publicurl.com/ReportServer/ReportExecution2005.asmx&lt;/a&gt; then this would fail. This is because IIS doesnt allow you to access a domain if it is pointing back at the box you are on and if you wanted to use integrated authentication. This stuff is called loopback checking&lt;/p&gt;

&lt;p&gt;&lt;br/&gt;
To resolve this you need to make some changes to regedit: Follow the instructions found here: &lt;a href="http://support.microsoft.com/kb/896861"&gt;kb896861&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This will enable you to set up hostnames that loop back to the local machine and will be allowed by IIS.&lt;/p&gt;</description><link>http://thepizzaboy.tumblr.com/post/8686788633</link><guid>http://thepizzaboy.tumblr.com/post/8686788633</guid><pubDate>Tue, 09 Aug 2011 07:50:36 -0400</pubDate><category>Reporting Services</category><category>IIS</category></item><item><title>Identifying Reporting Services subscriptions in SQL Server Agent</title><description>&lt;p&gt;The jobs created by reporting services subscriptions have &amp;#8216;random&amp;#8217; names. Here is some sql that helps you identlfy the subscription and the report.&lt;/p&gt;

&lt;p&gt;SELECT     Schedule.ScheduleID AS SQLAgent_Job_Name, Subscriptions.Description AS sub_desc, Subscriptions.DeliveryExtension AS sub_delExt, &lt;br/&gt;
                      [Catalog].Name AS ReportName, [Catalog].Path AS ReportPath&lt;br/&gt;
FROM         ReportSchedule INNER JOIN&lt;br/&gt;
                      Schedule ON ReportSchedule.ScheduleID = Schedule.ScheduleID INNER JOIN&lt;br/&gt;
                      Subscriptions ON ReportSchedule.SubscriptionID = Subscriptions.SubscriptionID INNER JOIN&lt;br/&gt;
                      [Catalog] ON ReportSchedule.ReportID = [Catalog].ItemID AND Subscriptions.Report_OID = [Catalog].ItemID&lt;/p&gt;

&lt;p&gt;&lt;br/&gt;
Thansks to &lt;a href="http://www.sqlservercentral.com/Forums/Topic254010-150-1.aspx"&gt;SteveFromOz at Sqlservercentral forums&lt;/a&gt;&lt;/p&gt;</description><link>http://thepizzaboy.tumblr.com/post/8686365910</link><guid>http://thepizzaboy.tumblr.com/post/8686365910</guid><pubDate>Tue, 09 Aug 2011 07:24:20 -0400</pubDate><category>reporting services</category></item><item><title>HTML5 video tag gotcha - IE9</title><description>&lt;p&gt;If the tag doesn&amp;#8217;t work in IE9, but the video if you access it directly (it should play in Windows Media Player) - make sure the mime-type is set correctly.&lt;/p&gt;

&lt;p&gt;The mime type for &lt;b&gt;.mp4&lt;/b&gt; is&lt;b&gt; video/mp4&lt;/b&gt;   Other browsers seem to cope with the bad mime type but IE9 refused to play the video. Its nice to see IE9 being a stickler for standards for a change!&lt;/p&gt;</description><link>http://thepizzaboy.tumblr.com/post/7011790760</link><guid>http://thepizzaboy.tumblr.com/post/7011790760</guid><pubDate>Tue, 28 Jun 2011 11:06:00 -0400</pubDate><category>HTML5</category><category>video tag</category><category>IE9</category></item><item><title>HTML5 Video Tag - New Learnings</title><description>&lt;p&gt;We host quite a few videos on our website, currently they are stored as flv files and played through a flash player (We user JW Player), but we get quite a few requests of people using non-flash devices (ipad, iphone etc) who want to watch the video and so I am quite keen to use the new HTML5 &amp;lt;video&amp;gt; tag.&lt;/p&gt;

&lt;p&gt;There are 3 main formats to consider: WebM, Mpeg4 and OGG. I used ffmpeg to convert the flv file to .mp4(codec h264) and .ogv (codec: ogg theora) files but found the quality better on mp4 and the file size smaller. I havent tried WebM so will leave that for a later experiment.&lt;/p&gt;

&lt;p&gt;Best practice recommends that you should have available all 3 formats for each video with Flash player to fall back on (using the H264 video as Flash supports it). We have too many videos to have lots of formats supported, I wanted to keep it as simple as possible ie only have 1 format so I went with H264 mp4. The reason is: Flash supports H264 but doesn&amp;#8217;t currently support Ogg files or VP8 codec. All the devices that cant play flash support H264.&lt;/p&gt;

&lt;p&gt;Until I develop an automated system that allows me to upload a video and get it automatically exported into the different formats I will stick with mpeg4.&lt;/p&gt;</description><link>http://thepizzaboy.tumblr.com/post/7011623648</link><guid>http://thepizzaboy.tumblr.com/post/7011623648</guid><pubDate>Tue, 28 Jun 2011 10:58:00 -0400</pubDate><category>HTML5</category><category>video tag</category></item><item><title>protocol relative urls</title><description>&lt;p&gt;We do development on our test boxes using http (on our intranet) but use https on our production servers. I also use googles cdn to host the jquery files I use. The question is do I use http or https to link to them, or use javascript to change the link or perhaps get the server to create the src link. The best solution is to use protocol relative urls! Heres an example:&lt;/p&gt;
&lt;pre class="brush: html"&gt;&amp;lt;script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.js"&amp;gt;&amp;lt;/script&amp;gt;
&lt;/pre&gt;
&lt;p&gt;Drop the protocol and just start with double slash. The browser will then use the same protocol as the current page. NOTE: if you do this with stylesheets (css files) then IE7 &amp;amp; IE8 will download these files twice, I&amp;#8217;ll need to check whether IE9 has this problem. I only really link to javascript (and media) files externally so protocol relative files work for me.&lt;/p&gt;</description><link>http://thepizzaboy.tumblr.com/post/5387177791</link><guid>http://thepizzaboy.tumblr.com/post/5387177791</guid><pubDate>Wed, 11 May 2011 05:27:00 -0400</pubDate></item><item><title>Special offer pricing FAIL</title><description>&lt;img src="http://25.media.tumblr.com/tumblr_lh8od7RrEd1qbq1imo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Special offer pricing FAIL&lt;/p&gt;</description><link>http://thepizzaboy.tumblr.com/post/3527900908</link><guid>http://thepizzaboy.tumblr.com/post/3527900908</guid><pubDate>Sat, 26 Feb 2011 14:19:55 -0500</pubDate></item><item><title>Mime types on IIS7</title><description>&lt;p&gt;I host quite a few mp4 videos on our webserver which runs IIS7. By default, IIS7 doesnt have the mime type set for mp4 and thus returns an error of 404 if you try to access the file. This is done for security reasons (so people cant access secure files by default eg .inc, .cs etc). Thats a valid point but mp4 is quite common as a format especially these days so why isnt that one made available?! Anyway, in IIS7 I came across quite a nice solution, you can additional mime types to the web.config. Here is a sample:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;lt;system.webServer&amp;gt;&lt;br/&gt; &amp;lt;staticContent&amp;gt;&lt;br/&gt; &amp;lt;mimeMap fileExtension=&amp;#8221;.mp4&amp;#8221; mimeType=&amp;#8221;video/mp4&amp;#8221; /&amp;gt;&lt;br/&gt; &amp;lt;mimeMap fileExtension=&amp;#8221;.m4v&amp;#8221; mimeType=&amp;#8221;video/m4v&amp;#8221; /&amp;gt;&lt;br/&gt; &amp;lt;/staticContent&amp;gt;&lt;br/&gt;&lt;/span&gt;&lt;span&gt;&amp;lt;/system.webServer&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I like that, if we ever move to another server thats one less thing to have to remember to set up.&lt;/span&gt;&lt;/p&gt;</description><link>http://thepizzaboy.tumblr.com/post/3360268634</link><guid>http://thepizzaboy.tumblr.com/post/3360268634</guid><pubDate>Fri, 18 Feb 2011 04:32:00 -0500</pubDate><category>IIS7</category><category>mime</category></item><item><title>CSRF and REST: A simple way of stopping CSRF?!</title><description>&lt;a href="http://michael-coates.blogspot.com/2010/05/csrf-attacks-and-forged-headers.html"&gt;CSRF and REST: A simple way of stopping CSRF?!&lt;/a&gt;</description><link>http://thepizzaboy.tumblr.com/post/2975091112</link><guid>http://thepizzaboy.tumblr.com/post/2975091112</guid><pubDate>Fri, 28 Jan 2011 08:31:05 -0500</pubDate></item><item><title>IIS 7 Enabling PUT request</title><description>&lt;p&gt;Im doing some funky restful services and was setting it up on a laptop. BUT PUT requests werent working (always returning a 405 error - Method not allowed). The fix was to uninstall WebDav publishing as a feature of IIS. And then it worked straight away.&lt;/p&gt;
&lt;p&gt;Some people were talking about Webdav is forcing you to make authorised requests for PUT but I was and it wasnt working. Simplest solution was to remove it as I didnt need it.&lt;/p&gt;</description><link>http://thepizzaboy.tumblr.com/post/2416876873</link><guid>http://thepizzaboy.tumblr.com/post/2416876873</guid><pubDate>Wed, 22 Dec 2010 11:01:50 -0500</pubDate><category>IIS7</category></item><item><title>Moving css styles inline for better compatibility in email</title><description>&lt;a href="http://premailer.dialect.ca/"&gt;Moving css styles inline for better compatibility in email&lt;/a&gt;</description><link>http://thepizzaboy.tumblr.com/post/2347690996</link><guid>http://thepizzaboy.tumblr.com/post/2347690996</guid><pubDate>Fri, 17 Dec 2010 07:00:03 -0500</pubDate></item><item><title>IIS 7 and Custom Errors</title><description>&lt;p&gt;Ive got a nice restful service going on (yay openrasta), works well in IIS6 but is giving me default error messages in IIS 7. To turn it off add the following to web.config:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;
&lt;pre&gt;&lt;code&gt;   &amp;lt;system.webServer&amp;gt;
        &amp;lt;httpErrors existingResponse="PassThrough" /&amp;gt;
    &amp;lt;/system.webServer&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;All happy again! I need to look into what other options there are for this setting but it gets me out of a fix for the time being&lt;/p&gt;</description><link>http://thepizzaboy.tumblr.com/post/2313902670</link><guid>http://thepizzaboy.tumblr.com/post/2313902670</guid><pubDate>Tue, 14 Dec 2010 12:38:40 -0500</pubDate></item><item><title>HttpContext.Current.Profile is null in iis7</title><description>&lt;a href="http://www.michaelteper.com/archive/2009/10/21/httpcontext.current.profile-is-null-in-iis7-vista-windows-7-2008-server.aspx"&gt;HttpContext.Current.Profile is null in iis7&lt;/a&gt;: &lt;p&gt;Fixed by adding an additional attribute to the modules section in system.webserver&lt;/p&gt;</description><link>http://thepizzaboy.tumblr.com/post/1680259426</link><guid>http://thepizzaboy.tumblr.com/post/1680259426</guid><pubDate>Thu, 25 Nov 2010 08:40:00 -0500</pubDate></item><item><title>Getting web config settings when in design mode in Visual Studio </title><description>&lt;a href="http://flimflan.com/blog/AccessingWebconfigAtDesignTimeInNET20.aspx"&gt;Getting web config settings when in design mode in Visual Studio &lt;/a&gt;</description><link>http://thepizzaboy.tumblr.com/post/1470057001</link><guid>http://thepizzaboy.tumblr.com/post/1470057001</guid><pubDate>Wed, 03 Nov 2010 07:37:26 -0400</pubDate></item><item><title>Converting a data column into comma separated string</title><description>&lt;a href="http://stackoverflow.com/questions/194852/in-sql-server-how-do-you-concatenate-many-rows-into-a-single-text-string"&gt;Converting a data column into comma separated string&lt;/a&gt;: &lt;p&gt;The for xml auto works very nicely&lt;/p&gt;</description><link>http://thepizzaboy.tumblr.com/post/1406524996</link><guid>http://thepizzaboy.tumblr.com/post/1406524996</guid><pubDate>Tue, 26 Oct 2010 09:04:23 -0400</pubDate></item><item><title>Safari bug with XmlHTTPRequest authentication:  @ symbol</title><description>&lt;p&gt;I was testing with safari 5 on Windows and came across the following bug. If the username or password contains an @ symbol, then the xmlHTTPrequest will fail. It wont make a request, instead will generate a blank error.  The solution is to replace @ with %40  (eg. username.replace(&amp;#8220;@&amp;#8221;,&amp;#8221;%40&amp;#8221;)) for username and password. This works and the server automatically decodes the username /password back to the original.&lt;/p&gt;

&lt;p&gt;Sweet!&lt;/p&gt;</description><link>http://thepizzaboy.tumblr.com/post/1357654632</link><guid>http://thepizzaboy.tumblr.com/post/1357654632</guid><pubDate>Wed, 20 Oct 2010 05:25:05 -0400</pubDate><category>ajax</category></item></channel></rss>
