<?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>the jackol's den &#187; Tips</title>
	<atom:link href="http://www.thejackol.com/tag/tips/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thejackol.com</link>
	<description>01100010 01101100 01100101 01101000</description>
	<lastBuildDate>Wed, 28 Dec 2011 03:40:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Prevent One Click Attacks by setting ViewStateUserKey in ASP.NET applications</title>
		<link>http://www.thejackol.com/2009/09/14/prevent-one-click-attacks-by-setting-viewstateuserkey-in-asp-net-applications/</link>
		<comments>http://www.thejackol.com/2009/09/14/prevent-one-click-attacks-by-setting-viewstateuserkey-in-asp-net-applications/#comments</comments>
		<pubDate>Sun, 13 Sep 2009 20:11:08 +0000</pubDate>
		<dc:creator>Mikhail Esteves</dc:creator>
				<category><![CDATA[C#/.NET]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[c#]]></category>

		<guid isPermaLink="false">http://www.thejackol.com/?p=633</guid>
		<description><![CDATA[Here&#8217;s an easy way to avoid One Click Attacks in ASP.NET applications. If you have a Base class that all your ASP.NET pages derive from, override the OnInit function. For example: protected override void OnInit(EventArgs e) { base.OnInit(e); if (User.Identity.IsAuthenticated) ViewStateUserKey = User.Identity.Name; } If you don&#8217;t have a base class defined, you would have [...]]]></description>
			<content:encoded><![CDATA[	<p>Here&#8217;s an easy way to avoid <a href="http://en.wikipedia.org/wiki/Cross-site_request_forgery">One Click Attacks</a> in <span class="caps">ASP</span>.<span class="caps">NET</span> applications. If you have a Base class that all your <span class="caps">ASP</span>.<span class="caps">NET</span> pages derive from, override the <code>OnInit</code> function. For example:</p>

<pre><code>protected override void OnInit(EventArgs e)
{
    base.OnInit(e);
</code>
<code>    if (User.Identity.IsAuthenticated)
        ViewStateUserKey = User.Identity.Name;
}
</code></pre>

	<p>If you don&#8217;t have a base class defined, you would have to put the above code in every <span class="caps">ASP</span>.<span class="caps">NET</span> page.</p>]]></content:encoded>
			<wfw:commentRss>http://www.thejackol.com/2009/09/14/prevent-one-click-attacks-by-setting-viewstateuserkey-in-asp-net-applications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing BugZilla 3.4.1 on Dreamhost</title>
		<link>http://www.thejackol.com/2009/08/24/installing-bugzilla-3-4-1-on-dreamhost/</link>
		<comments>http://www.thejackol.com/2009/08/24/installing-bugzilla-3-4-1-on-dreamhost/#comments</comments>
		<pubDate>Mon, 24 Aug 2009 14:17:18 +0000</pubDate>
		<dc:creator>Mikhail Esteves</dc:creator>
				<category><![CDATA[LAMP]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[bugzilla]]></category>
		<category><![CDATA[dreamhost]]></category>
		<category><![CDATA[perl]]></category>

		<guid isPermaLink="false">http://www.thejackol.com/?p=630</guid>
		<description><![CDATA[Here&#8217;s a quick guide on installing Bugzilla 3.4.1 on Dreamhost. Fire up a shell and follow these steps (these command are from http://wiki.dreamhost.com/Bugzilla) in the directory of the domain you want to install Bugzilla in. mkdir bugs cd bugs wget http://ftp.mozilla.org/pub/mozilla.org/webtools/bugzilla-STABLE.tar.gz tar zxf bugzilla-STABLE.tar.gz rm bugzilla-STABLE.tar.gz mv bugzilla*/* . Next, follow setups 6, 7, 8 [...]]]></description>
			<content:encoded><![CDATA[	<p>Here&#8217;s a quick guide on installing Bugzilla 3.4.1 on Dreamhost.</p>

	<p>Fire up a shell and follow these steps (these command are from <a href="http://wiki.dreamhost.com/Bugzilla">http://wiki.dreamhost.com/Bugzilla</a>) in the directory of the domain you want to install Bugzilla in.</p>

<pre><code>mkdir bugs
cd bugs
wget http://ftp.mozilla.org/pub/mozilla.org/webtools/bugzilla-STABLE.tar.gz
tar zxf bugzilla-STABLE.tar.gz
rm bugzilla-STABLE.tar.gz
mv bugzilla*/* .
</code></pre>

	<p>Next, follow setups 6, 7, 8 and 9 from the <a href="http://wiki.dreamhost.com/Bugzilla">Bugzilla Dreamhost wiki</a>.</p>

	<p>Now you will need to manually install <code>Module::Build</code> and <code>DateTime::Locale</code> for Bugzilla to work. To do this, first get the latest <span class="caps">CPAN</span> download links for the modules.</p>

	<p>For Module::Build, you&#8217;ll find the download link here: <a href="http://search.cpan.org/~kwilliams/Module-Build/">http://search.cpan.org/~kwilliams/Module-Build/</a><br />
For DateTime::Locale, you&#8217;ll find the download at: <a href="http://search.cpan.org/~drolsky/DateTime-Locale-0.43/">http://search.cpan.org/~drolsky/DateTime-Locale-0.43/</a></p>

	<p>I&#8217;ve used the latest available builds at the time of this writing for the example below. Next, follow these steps in the Bugzilla installation directory:</p>

<pre><code>mkdir tmp
cd tmp
PERL5LIB=/full-path-to-bugzilla-install-dir/lib
export PERL5LIB
wget http://search.cpan.org/CPAN/authors/id/K/KW/KWILLIAMS/Module-Build-0.31.tar.gz
tar xzf Module-Build-0.31.tar.gz
cd Module-Build-0.31
perl Makefile.pl
make
make test
make install
cd ..
rm -rf Module-Build*
</code>
<code># To install DateTime::Locale
wget http://search.cpan.org/CPAN/authors/id/D/DR/DROLSKY/DateTime-Locale-0.43.tar.gz
tar zxf DateTime-Locale-0.43.tar.gz
cd DateTime-Locale-0.43
perl Makefile.pl
make
make test
make install
cd ../..
rm -rf tmp
</code></pre>

	<p>Re-run ./checksetup.pl and then fix permissions as in the Dreamhost Bugzilla wiki page:</p>

<pre><code>for i in docs graphs images js skins; do find $i -type d -exec chmod o+rx {} \; ; done
for i in jpg gif css js png html rdf xul; do find . -name \*.$i -exec chmod o+r {} \; ; done
find . -name .htaccess -exec chmod o+r {} \;
chmod o+x . data data/webdot
</code></pre>

	<p>You should now have a working Bugzilla installation at yourdomain.com/bugs.</p>]]></content:encoded>
			<wfw:commentRss>http://www.thejackol.com/2009/08/24/installing-bugzilla-3-4-1-on-dreamhost/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Get LINQ to SQL results into a DataTable</title>
		<link>http://www.thejackol.com/2009/06/02/get-linq-to-sql-results-into-a-datatable/</link>
		<comments>http://www.thejackol.com/2009/06/02/get-linq-to-sql-results-into-a-datatable/#comments</comments>
		<pubDate>Tue, 02 Jun 2009 08:33:09 +0000</pubDate>
		<dc:creator>Mikhail Esteves</dc:creator>
				<category><![CDATA[C#/.NET]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[linq]]></category>
		<category><![CDATA[linq to sql]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://www.thejackol.com/?p=594</guid>
		<description><![CDATA[There are two ways to get LINQ to SQL results into a DataTable, as explained here. I use Sample II: public DataTable ToDataTable(System.Data.Linq.DataContext ctx, object query) { if (query == null) { throw new ArgumentNullException(&#34;query&#34;); } IDbCommand cmd = ctx.GetCommand(query as IQueryable); SqlDataAdapter adapter = new SqlDataAdapter(); adapter.SelectCommand = (SqlCommand)cmd; DataTable dt = new DataTable(&#34;sd&#34;); [...]]]></description>
			<content:encoded><![CDATA[	<p>There are two ways to get <span class="caps">LINQ</span> to <span class="caps">SQL</span> results into a DataTable, <a href="http://www.c-sharpcorner.com/UploadFile/VIMAL.LAKHERA/LINQResultsetToDatatable06242008042629AM/LINQResultsetToDatatable.aspx" ref="external nofollow">as explained here</a>.</p>

	<p>I use Sample II:</p>

<pre><code>public DataTable ToDataTable(System.Data.Linq.DataContext ctx, object query)
{
     if (query == null)
     {
          throw new ArgumentNullException(&#34;query&#34;);
     }
</code>
<code>     IDbCommand cmd = ctx.GetCommand(query as IQueryable);
     SqlDataAdapter adapter = new SqlDataAdapter();
     adapter.SelectCommand = (SqlCommand)cmd;
     DataTable dt = new DataTable(&#34;sd&#34;);
</code>
<code>     try
     {
          cmd.Connection.Open();
          adapter.FillSchema(dt, SchemaType.Source); 
          adapter.Fill(dt);
     }
     finally
     {
          cmd.Connection.Close();
     }
     return dt;
}
</code></pre>

	<p>//</p>]]></content:encoded>
			<wfw:commentRss>http://www.thejackol.com/2009/06/02/get-linq-to-sql-results-into-a-datatable/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>MKCOL &#8230; 405 Method Not Allowed Subversion error</title>
		<link>http://www.thejackol.com/2009/03/24/mkcol-405-method-not-allowed-subversion-error/</link>
		<comments>http://www.thejackol.com/2009/03/24/mkcol-405-method-not-allowed-subversion-error/#comments</comments>
		<pubDate>Tue, 24 Mar 2009 16:20:35 +0000</pubDate>
		<dc:creator>Mikhail Esteves</dc:creator>
				<category><![CDATA[LAMP]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[source control]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[tortoisesvn]]></category>

		<guid isPermaLink="false">http://www.thejackol.com/?p=579</guid>
		<description><![CDATA[I use DreamHost to store and manage all my Subversion repositories. When trying to commit a while back, I got this strange error: svn: Commit failed (details follow): svn: MKCOL of &#39;.../images&#39;: 405 Method Not Allowed Searching around, I managed to find a couple of reasons this could occur &#8212; wrong charset or a connectivity [...]]]></description>
			<content:encoded><![CDATA[	<p>I use <a href="http://www.dreamhost.com/r.cgi?143924">DreamHost</a> to store and manage all my Subversion repositories. When trying to commit a while back, I got this strange error:</p>

<pre><code>svn: Commit failed (details follow):
svn: MKCOL of &#39;.../images&#39;: 405 Method Not Allowed
</code></pre>

	<p>Searching around, I managed to find a couple of reasons this could occur &#8212; wrong charset or a connectivity problem (proxy discarding the <code>MKCOL</code> command). I&#8217;m not behind a proxy so I tried passing a <code>charset</code> parameter but that didn&#8217;t really help.</p>

	<p>What finally helped was deleting the problematic &#8220;images&#8221; directory in the repository and re-commiting the directory. I use TortoiseSVN so it was as simple as using the Repo-Browser, right-clicking on the problematic directory and deleting it. The commit went through just fine after this.</p>]]></content:encoded>
			<wfw:commentRss>http://www.thejackol.com/2009/03/24/mkcol-405-method-not-allowed-subversion-error/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Exclude Spotlight from indexing External Drives and folders</title>
		<link>http://www.thejackol.com/2009/03/19/exclude-spotlight-osx-external-drives-folders/</link>
		<comments>http://www.thejackol.com/2009/03/19/exclude-spotlight-osx-external-drives-folders/#comments</comments>
		<pubDate>Thu, 19 Mar 2009 12:17:07 +0000</pubDate>
		<dc:creator>Mikhail Esteves</dc:creator>
				<category><![CDATA[OS X]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[10.5.6]]></category>
		<category><![CDATA[indexing]]></category>
		<category><![CDATA[leopard]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[spotlight]]></category>

		<guid isPermaLink="false">http://www.thejackol.com/?p=573</guid>
		<description><![CDATA[Getting Spotlight to skip indexing particular folders in a fixed drive is as simple as dragging the folders into Spotlight&#8217;s Privacy Settings tab. However, in order to get Spotlight to stop indexing external drives (USB drives, external hard disks, etc), the Privacy Settings tab only disables it temporarily &#8211; when you remount the volume, indexing [...]]]></description>
			<content:encoded><![CDATA[	<p>Getting Spotlight to skip indexing particular folders in a fixed drive is as simple as dragging the folders into Spotlight&#8217;s Privacy Settings tab. However, in order to get Spotlight to stop indexing external drives (<span class="caps">USB</span> drives, external hard disks, etc), the Privacy Settings tab only disables it temporarily &#8211; when you remount the volume, indexing begins again.</p>

	<p>To avoid Spotlight from indexing an entire volume, create an empty file named <code>.metadata_never_index</code> in the root folder of the volume. If your volume is called <code>MYDATA</code>, for example, open up Terminal and type:</p>

<pre><code>$ touch /Volumes/MYDATA/.metadata_never_index
</code></pre>

	<p>Spotlight should now skip indexing this volume &#8211; as long as this file exists.</p>]]></content:encoded>
			<wfw:commentRss>http://www.thejackol.com/2009/03/19/exclude-spotlight-osx-external-drives-folders/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

