<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:blogChannel="http://backend.userland.com/blogChannelModule" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
  <channel>
    <title>RTur.net</title>
    <description>.NET and Open Source: better together</description>
    <link>http://rtur.net/blog/</link>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <generator>BlogEngine.NET 1.5.1.29</generator>
    <language>en-US</language>
    <blogChannel:blogRoll>http://rtur.net/blog/opml.axd</blogChannel:blogRoll>
    <blogChannel:blink>http://www.dotnetblogengine.net/syndication.axd</blogChannel:blink>
    <dc:creator>RTur.net</dc:creator>
    <dc:title>RTur.net</dc:title>
    <geo:lat>0.000000</geo:lat>
    <geo:long>0.000000</geo:long>
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/rtur" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
      <title>Syntax Highlighter extension for BlogEngine</title>
      <description>&lt;p&gt;&lt;a rel="lightbox" href="http://rtur.net/blog/image.axd?picture=logo.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="logo" src="http://rtur.net/blog/image.axd?picture=logo_thumb.jpg" border="0" alt="logo" width="175" height="115" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="capital"&gt;T&lt;/span&gt;here are several implementations of this extension for &lt;a href="http://dotnetblogengine.net/" target="_blank"&gt;BlogEngine&lt;/a&gt;, but I wanted it to work with &lt;a href="http://alexgorbatchev.com/wiki/SyntaxHighlighter" target="_blank"&gt;latest JS library&lt;/a&gt; and be more configurable. And also I wanted it play well with &lt;a href="http://tinymce.moxiecode.com/" target="_blank"&gt;TinyMCE&lt;/a&gt; - yes, it might come as a shock but some people don't use &lt;a href="http://download.live.com/writer" target="_blank"&gt;Windows Live Writer&lt;/a&gt;. I don't know why... So, if you go through usual routine downloading and moving files to corresponding location (you&amp;rsquo;ll need to overwrite couple) this is what you&amp;rsquo;ll get.&lt;/p&gt;
&lt;p&gt;1. Configurable options for syntax highlighting. You can set it way you like by checking your options in the admin/extensions/edit page.&lt;/p&gt;
&lt;p&gt;&lt;a rel="lightbox" href="http://rtur.net/blog/image.axd?picture=options.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 0px 20px 15px 0px; display: inline; border-top: 0px; border-right: 0px" title="options" src="http://rtur.net/blog/image.axd?picture=options_thumb.jpg" border="0" alt="options" width="690" height="342" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a rel="lightbox" href="http://rtur.net/blog/image.axd?picture=brushes.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="brushes" src="http://rtur.net/blog/image.axd?picture=brushes_thumb.jpg" border="0" alt="brushes" width="100" height="124" /&gt;&lt;/a&gt;2. Ability to select brushes. Latest Syntax Highlighter comes with 22 (!!!) built-in brushes, each represents language supported by this library. Every language comes with it&amp;rsquo;s own JavaScript file, and you don&amp;rsquo;t want reference those you don&amp;rsquo;t use. Here you can make a selection of languages you commonly use in your blog posts to lighten JS downloads and speed things up.&lt;/p&gt;
&lt;p style="clear: both"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a rel="lightbox" href="http://rtur.net/blog/image.axd?picture=themes.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="themes" src="http://rtur.net/blog/image.axd?picture=themes_thumb.jpg" border="0" alt="themes" width="100" height="127" /&gt;&lt;/a&gt;3. Themes selection. I was not particularly impressed with themes and decided to stick with default one, but if you are using dark colors on your blog, you might find that one of the custom themes serves you better. You can always&amp;nbsp; easily change it back and force from edit settings menu.&lt;/p&gt;
&lt;p style="clear: both"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a rel="lightbox" href="http://rtur.net/blog/image.axd?picture=codebtn.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="codebtn" src="http://rtur.net/blog/image.axd?picture=codebtn_thumb.jpg" border="0" alt="codebtn" width="100" height="33" /&gt;&lt;/a&gt;4. To make it a little easier to work with web editor, the &amp;ldquo;CODE&amp;rdquo; button added to the &lt;a href="http://tinymce.moxiecode.com/" target="_blank"&gt;TinyMCE&lt;/a&gt; toolbar. When in &amp;ldquo;edit&amp;rdquo; mode, click anywhere in the text and push button to add standard snippet to the editor, then modify it with your code and, if needed, change &amp;ldquo;brush&amp;rdquo; (language) from C# to the one of your choice. This clearly requires some extra work, but for now it will make things easier. The result of insertion should look exactly like this:&lt;/p&gt;
&lt;pre class="brush: c-sharp;"&gt;function foo()
{
    return 0;
}&lt;/pre&gt;
&lt;p&gt;I have also included &amp;ldquo;Settings.ascx.cs&amp;rdquo; file that fixes small glitch in &lt;a href="http://rtur.net/blog/category/Extension-Manager.aspx" target="_blank"&gt;Extension Manager&lt;/a&gt; &amp;ndash; &lt;a href="http://dotnetblogengine.net/" target="_blank"&gt;BlogEngine&lt;/a&gt; 1.5 has label width set to 100px and I have reset it to 250 to match text box size and let longer labels look better.&lt;/p&gt;
&lt;p&gt;I really think that we should add this formatter to the next &lt;a href="http://dotnetblogengine.net/" target="_blank"&gt;BlogEngine&lt;/a&gt; version and faze out current code formatter BE uses. It is much better supported and a lot more robust. Please feel free to download and try it, and you&amp;rsquo;ll see it for yourself.&lt;/p&gt;
&lt;p&gt;Update: there was a bug fix, RSS feed would not work when casting to Page. Download file is updated but if you already downloaded version with this issue, you only need to add one line of code to make it work with RSS feed.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;pre class="brush: c-sharp;"&gt;private void AddSyntaxHighlighter(object sender, ServingEventArgs e)
{
    // add this line to fix RSS
    if(e.Location == ServingLocation.Feed) return;

    ...

    context.Items[ExtensionName] = 1;
}&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="download"&gt;&lt;a href="http://rtur.net/blog/file.axd?file=2009%2f11%2fSyntaxHighlighter.zip"&gt;SyntaxHighlighter.zip (102.76 kb)&lt;/a&gt;&lt;/p&gt;</description>
      <link>http://feedproxy.google.com/~r/rtur/~3/bktmFfQx-0s/post.aspx</link>
      <author>rtur.net</author>
      <comments>http://rtur.net/blog/post/2009/11/15/Syntax-Highlighter-extension-for-BlogEngine.aspx#comment</comments>
      <guid isPermaLink="false">http://rtur.net/blog/post.aspx?id=27f87a0e-5a78-45b7-823f-87ca5fe92390</guid>
      <pubDate>Sun, 15 Nov 2009 16:33:00 -0600</pubDate>
      <category>Extensions</category>
      <dc:publisher>rtur.net</dc:publisher>
      <pingback:server>http://rtur.net/blog/pingback.axd</pingback:server>
      <pingback:target>http://rtur.net/blog/post.aspx?id=27f87a0e-5a78-45b7-823f-87ca5fe92390</pingback:target>
      <slash:comments>3</slash:comments>
      <trackback:ping>http://rtur.net/blog/trackback.axd?id=27f87a0e-5a78-45b7-823f-87ca5fe92390</trackback:ping>
      <wfw:comment>http://rtur.net/blog/post/2009/11/15/Syntax-Highlighter-extension-for-BlogEngine.aspx#comment</wfw:comment>
      <wfw:commentRss>http://rtur.net/blog/syndication.axd?post=27f87a0e-5a78-45b7-823f-87ca5fe92390</wfw:commentRss>
    <feedburner:origLink>http://rtur.net/blog/post.aspx?id=27f87a0e-5a78-45b7-823f-87ca5fe92390</feedburner:origLink></item>
    <item>
      <title>Blacklist added to Commentor</title>
      <description>&lt;a href="http://rtur.net/blog/image.axd?picture=Admen2.png" rel="lightbox"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Admen2" border="0" alt="Admen2" src="http://rtur.net/blog/image.axd?picture=Admen2_thumb.png" width="100" height="111"&gt;&lt;/a&gt;  &lt;p&gt;&lt;span class="capital"&gt;S&lt;/span&gt;ome people complain about &lt;a href="http://akismet.com/" target="_blank"&gt;Akismet&lt;/a&gt; not killing spam as effectively as they would like or hope. I think &lt;a href="http://akismet.com/" target="_blank"&gt;Akismet&lt;/a&gt; doing fine job identifying spam bots, but recently a lot of it coming from real people trying to make a little extra money, and those are challenging to deal with. Sometimes I get totally valid comment and the only odd thing about it is that guy’s name is “buy cheap watches” or something like it. It is tough to filter out programmatically. Probably, the best solution for a moment is similar counter-move when people tired of spam come together and create list of known spammers so that spam blocking applications can use it. &lt;/p&gt; &lt;p&gt;One of such sites is &lt;a title="http://www.stopforumspam.com" href="http://stopforumspam.com"&gt;stopforumspam.com&lt;/a&gt; and updated version of &lt;a href="http://rtur.net/blog/category/Commentor.aspx" target="_blank"&gt;Commentor&lt;/a&gt; (1.3.2) uses its API to check if person trying to add comment to the blog listed in the stopforumspam’s database. If it is, comment will be marked as spam without passing it to &lt;a href="http://akismet.com/" target="_blank"&gt;Akismet&lt;/a&gt; for validation.&lt;/p&gt; &lt;p&gt;New users can install &lt;a href="http://rtur.net/blog/category/Commentor.aspx" target="_blank"&gt;Commentor&lt;/a&gt; using instructions from &lt;a href="http://rtur.net/blog/post/2009/02/16/Commentor-e28093-new-version.aspx" target="_blank"&gt;this post&lt;/a&gt;. All download links are pointing to the same file. If you already have &lt;a href="http://rtur.net/blog/category/Commentor.aspx" target="_blank"&gt;Commentor&lt;/a&gt; installed, you only need to replace extension file – unzip and move “App_Code/Extensions/Commentor.cs” to the corresponding location at your blog.&lt;/p&gt; &lt;p&gt;The change itself is very simple and comes down to this function:&lt;/p&gt; &lt;p&gt;&lt;pre class="brush: c-sharp;"&gt;static bool IsBlackListed(string ip)
{
    try
    {
        string url = string.Format("http://www.stopforumspam.com/api?ip={0}", ip);

        HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
        HttpWebResponse response = (HttpWebResponse)request.GetResponse();
        StreamReader reader = new StreamReader(response.GetResponseStream());

        string value = reader.ReadToEnd();
        reader.Close();

        return value.ToLowerInvariant().Contains("&lt;appears&gt;yes&lt;/appears&gt;") ? true : false;
    }
    catch (Exception)
    {
        return false;
    }
}
&lt;/pre&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Got to love .NET!&lt;/p&gt;
&lt;p class="download"&gt;&lt;a href="http://rtur.net/blog/file.axd?file=2008%2f12%2fCommentor.zip"&gt;Commentor.zip (30.961 kb)&lt;/a&gt;&lt;/p&gt;</description>
      <link>http://feedproxy.google.com/~r/rtur/~3/Qf6ykLmcnkE/post.aspx</link>
      <author>rtur.net</author>
      <comments>http://rtur.net/blog/post/2009/11/07/Blacklist-added-to-Commentor.aspx#comment</comments>
      <guid isPermaLink="false">http://rtur.net/blog/post.aspx?id=848019c6-6f06-41d2-aa46-f50fb491a5dd</guid>
      <pubDate>Sat, 07 Nov 2009 18:04:28 -0600</pubDate>
      <category>Commentor</category>
      <dc:publisher>rtur.net</dc:publisher>
      <pingback:server>http://rtur.net/blog/pingback.axd</pingback:server>
      <pingback:target>http://rtur.net/blog/post.aspx?id=848019c6-6f06-41d2-aa46-f50fb491a5dd</pingback:target>
      <slash:comments>4</slash:comments>
      <trackback:ping>http://rtur.net/blog/trackback.axd?id=848019c6-6f06-41d2-aa46-f50fb491a5dd</trackback:ping>
      <wfw:comment>http://rtur.net/blog/post/2009/11/07/Blacklist-added-to-Commentor.aspx#comment</wfw:comment>
      <wfw:commentRss>http://rtur.net/blog/syndication.axd?post=848019c6-6f06-41d2-aa46-f50fb491a5dd</wfw:commentRss>
    <feedburner:origLink>http://rtur.net/blog/post.aspx?id=848019c6-6f06-41d2-aa46-f50fb491a5dd</feedburner:origLink></item>
    <item>
      <title>IIS 7 – Who is running the show?</title>
      <description>&lt;p&gt;&lt;a rel="lightbox" href="http://rtur.net/blog/image.axd?picture=iis7.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="iis7" src="http://rtur.net/blog/image.axd?picture=iis7_thumb.png" border="0" alt="iis7" width="141" height="103" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="capital"&gt;W&lt;/span&gt;hen you run ASP.NET site in Visual Studio things generally tend to work. It usually when you try to deploy it to live server when you get into trouble. This is why I wasn&amp;rsquo;t surprised when after setting up little continuous integration server my application that ran perfectly well in VS broke apart on local IIS 7. I went to IIS console and double-checked application settings and write permissions. Along with Network Service I gave access to ASPNET account, because IIS keeps changing identity and I felt lazy to figure out what account it uses in this particular case. &lt;/p&gt;
&lt;p&gt;&lt;a rel="lightbox" href="http://rtur.net/blog/image.axd?picture=yellow.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 0px 20px 10px 0px; display: inline; border-top: 0px; border-right: 0px" title="yellow" src="http://rtur.net/blog/image.axd?picture=yellow_thumb.png" border="0" alt="yellow" width="690" height="359" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Did not work. Still was getting annoying &amp;ldquo;access denied&amp;rdquo; errors. It puzzled me a little bit and I started to dig deeper. Turned out in IIS 7.x account that ASP.NET uses called&amp;hellip; ApplicationPoolIdentity!&lt;/p&gt;
&lt;p&gt;&lt;a rel="lightbox" href="http://rtur.net/blog/image.axd?picture=advsettings.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 0px 20px 10px 0px; display: inline; border-top: 0px; border-right: 0px" title="advsettings" src="http://rtur.net/blog/image.axd?picture=advsettings_thumb.png" border="0" alt="advsettings" width="690" height="443" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Ok, that&amp;rsquo;s new. To make sure I&amp;rsquo;m not delusional I put together a page that outputs ASP.NET process name and checked if this identity has write permission to folders that my application needed to function properly. Sure enough, it confirmed my suspensions &amp;ndash; App_Data directory I needed for write access was not accessible for ApplicationPoolIdentity. For App_Code IIS did assigned write permissions to this stranger.&lt;/p&gt;
&lt;p&gt;&lt;a rel="lightbox" href="http://rtur.net/blog/image.axd?picture=apppool.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 0px 20px 10px 0px; display: inline; border-top: 0px; border-right: 0px" title="apppool" src="http://rtur.net/blog/image.axd?picture=apppool_thumb.png" border="0" alt="apppool" width="690" height="264" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The fix is obvious once you know who runs the show under IIS&amp;rsquo;s mask. I could&amp;rsquo;ve give this new account all needed rights, but instead just changed identity for classic application pool to network service.&lt;/p&gt;
&lt;p&gt;&lt;a rel="lightbox" href="http://rtur.net/blog/image.axd?picture=networksettings.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 0px 20px 10px 0px; display: inline; border-top: 0px; border-right: 0px" title="networksettings" src="http://rtur.net/blog/image.axd?picture=networksettings_thumb.png" border="0" alt="networksettings" width="690" height="385" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Ran checker page again and this time got familiar account name and all the green bars. Sweet!&lt;/p&gt;
&lt;p&gt;&lt;a rel="lightbox" href="http://rtur.net/blog/image.axd?picture=success.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 0px 20px 10px 0px; display: inline; border-top: 0px; border-right: 0px" title="success" src="http://rtur.net/blog/image.axd?picture=success_thumb.png" border="0" alt="success" width="690" height="264" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;End of story, but it got me thinking about some kind of install/setup troubleshooter for ASP.NET application. Basically, it can be a form where you specify some common conditions, then it runs and checks those conditions and outputs result on the screen. It could be really helpful for beginners in identifying problems that otherwise can be frustrating fore novice would-be ASP.NET converts. I ran into questions on setup and install issues in BlogEngine&amp;rsquo;s forum all the time. If not generic, it can be easily extended to troubleshoot most common issues with installing &lt;a href="http://dotnetblogengine.net/" target="_blank"&gt;BlogEngine&lt;/a&gt; on different server configurations.&lt;/p&gt;
&lt;p&gt;If you having issues with weird behavior on you BE live server, download and&amp;nbsp; unzip &amp;ldquo;check&amp;rdquo; folder to your local machine and then move it to that server. Go to your site and navigate to &amp;ldquo;check&amp;rdquo; folder, it will show you file access permissions relevant to your BE installation. For another ASP.NET application you would have to modify code to check your writable directory(s), but it is very easy, you only need to replace directories in Page_Load with those your app uses.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;pre class="brush: c-sharp;"&gt;protected void Page_Load(object sender, EventArgs e)
{
    Msg(string.Format("ASP.NET account Identity is: {0}", 
        WindowsIdentity.GetCurrent().Name), true);

    Process("app_data");

    Process("app_data/datastore");

    Process("app_code/extensions");
}
&lt;/pre&gt;
&lt;p class="download"&gt;&lt;a href="http://rtur.net/blog/file.axd?file=2009%2f10%2fcheck.zip"&gt;check.zip (10.55 kb)&lt;/a&gt;&lt;/p&gt;</description>
      <link>http://feedproxy.google.com/~r/rtur/~3/W4xXgmUTU68/post.aspx</link>
      <author>rtur.net</author>
      <comments>http://rtur.net/blog/post/2009/10/30/IIS-7-e28093-Who-is-running-the-show.aspx#comment</comments>
      <guid isPermaLink="false">http://rtur.net/blog/post.aspx?id=793e5ec0-909f-49c5-9532-5bb861ac0773</guid>
      <pubDate>Fri, 30 Oct 2009 22:00:00 -0600</pubDate>
      <category>asp.net</category>
      <dc:publisher>rtur.net</dc:publisher>
      <pingback:server>http://rtur.net/blog/pingback.axd</pingback:server>
      <pingback:target>http://rtur.net/blog/post.aspx?id=793e5ec0-909f-49c5-9532-5bb861ac0773</pingback:target>
      <slash:comments>6</slash:comments>
      <trackback:ping>http://rtur.net/blog/trackback.axd?id=793e5ec0-909f-49c5-9532-5bb861ac0773</trackback:ping>
      <wfw:comment>http://rtur.net/blog/post/2009/10/30/IIS-7-e28093-Who-is-running-the-show.aspx#comment</wfw:comment>
      <wfw:commentRss>http://rtur.net/blog/syndication.axd?post=793e5ec0-909f-49c5-9532-5bb861ac0773</wfw:commentRss>
    <feedburner:origLink>http://rtur.net/blog/post.aspx?id=793e5ec0-909f-49c5-9532-5bb861ac0773</feedburner:origLink></item>
  </channel>
</rss>
