<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>SharpDeveloper</title>
	
	<link>http://www.sharpdeveloper.net/content</link>
	<description>C# articles and tutorials on SharpDeveloper.NET</description>
	<lastBuildDate>Mon, 01 Mar 2010 18:21:39 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<feedburner:info uri="sharpdeveloper" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><creativeCommons:license>http://creativecommons.org/licenses/by/3.0/</creativeCommons:license><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://www.sharpdeveloper.net/content/Rss.aspx" /><feedburner:emailServiceId>sharpdeveloper</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>Flesk Viewstate Optimizer Documentation</title>
		<link>http://feedproxy.google.com/~r/sharpdeveloper/~3/R6j05vJwHkY/flesk-viewstate-optimizer-documentation.aspx</link>
		<comments>http://www.sharpdeveloper.net/content/archive/2010/03/01/flesk-viewstate-optimizer-documentation.aspx#comments</comments>
		<pubDate>Mon, 01 Mar 2010 18:20:46 +0000</pubDate>
		<dc:creator>Sameer</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.sharpdeveloper.net/content/?p=513</guid>
		<description><![CDATA[I came across this excellent looking tool Flesk ViewState Optimizer but was not able to find any details or documentation on it.  Apparently the tool used to be commercial but now its free!  I was able to dig up some history on it
Flesk.ViewStateOptimizer is a unique technology that overrides sending ViewState object to your client&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>I came across this excellent looking tool <a href="http://www.flesk.net/components/vsoptimizer.aspx">Flesk ViewState Optimizer</a> but was not able to find any details or documentation on it.  Apparently the tool used to be commercial but now its free!  I was able to dig up some history on it</p>
<p><strong>Flesk.ViewStateOptimizer</strong> is a unique technology that overrides sending ViewState object to your client&#8217;s browser! This means that your client&#8217;s browser will no longer receive those large hidden field values, which thus reducing downloading time. Instead, Flesk.ViewStateOptimizer saves the page&#8217;s Viewstate hidden field to a file, on the server side, speeding  up processing time, downloading time and data.
											</p>
<p>Combining <strong>Flesk.ViewStateOptimizer</strong> and <strong>Flesk.Accelerator</strong>,<br />
												you can benefit from reducing downloading data and downloading time up to 30 times faster! No other components<br />
												do the same or give the same results!</p>
<p><strong>Flesk.Accelerator</strong> and <strong>Flesk.ViewStateOptimizer</strong> are now released with versions<br />
												targeted for the .NET Framework v2.0</p>
<p>&nbsp;</p>
<p><strong><font size="2">How it works?<a name="Works"></a></font></strong></p>
<p><strong>Flesk.ViewStateOptimizer</strong> has several viewstate optimization possibilities that can be set through the web.config file.<br /> From viewstate data compression to saving viewstate on server farms, anything can be possible. This means that Flesk.ViewStateOptimizer can persist values using server side Sessions or files saved on shared locaton accessible by a server farm, or by using common viewstate hidden field value on client side, with the ability to compress data.</p>
<p>There are 2 ways to setup Flesk.ViewStateOptimizer on your web application or .Net project:</p>
<ol>
<li>In all your codebehind, instead of inheriting your class with<br />
													System.Web.UI.Page, change the inheritance to Flesk.Accelerator.Page.<br />
													If you use script block codebehind, use the following lines: </p>
<pre class="syntax-highlight:c#">
 &amp;lt;%@ Page  Language=&amp;quot;C#&amp;quot; Inherits=&amp;quot;Flesk.Accelerator.Page&amp;quot; %&amp;gt;
</pre>
</li>
<li>
<p>Flesk.ViewStateOptimizer is designed to meet the requirements of customers that are unable to change<br />
														the base class of their pages.<br />
														As such, Flesk.ViewStateOptimizer provides static methods that allows calling the viewstate procedures<br />
														from within any page class.</p>
<p>														If you have access to the source of your base class, just add the following lines to the code:</p>
<pre class="syntax-highlight:c#">
protected override void  SavePageStateToPersistenceMedium(object viewStateBag)
{
   Flesk.Accelerator.Page.SavePageStateToPersistenceMedium(this, viewStateBag);
}

protected override object LoadPageStateFromPersistenceMedium()
{
    return Flesk.Accelerator.Page.LoadPageStateFromPersistenceMedium(this);
}
</pre>
<p> If you are using precompiled code you&#8217;ll have to edit your aspx files. If at all possible, add the following<br />
														</p>
<p>														snippet to your aspx file:</p>
<pre class="syntax-highlight:c#">
protected override PageStatePersister PageStatePersister
{
  get
  {
    return Flesk.Accelerator.Page.GetPageStatePersister(this);
  }
}
</pre>
</p></div>
</li>
</ol>
<div id="Features">
<p>&nbsp;</p>
<p>Flesk.ViewStateOptimizer can use different storage methods:</p>
</p></div>
<ul>
<li>
<div style=""> save to file (saves ViewState into a file, server side)</div>
</li>
<li>
<div style="">
<div style=""> Session (saves ViewState into a Session variable, server side) </div>
</p></div>
</li>
<li> Default (default ViewState saving method, sends hidden fields to client side)</li>
</ul>
<p>Other parameters are:</p>
<ul>
<li> depending on the storage method setting, Flesk.ViewStateOptimizer can be set to compress viewstate value,<br />
													so that it can be significantly smaller than the original value</li>
<li>the request behaviour of viewstate can be set to be generated on the first request to a page and then<br />
													reused in the following postbacks, or to be generated on each request to a page. <br />
													A common scenario where viewstate set to be generated on each request can be usefull is in Content Management<br />
													frameworks:<br />
													page loads up some controls on postback based on some state stored in hidden input values, handles events<br />
													and as a result of those actions purges the control collection and loads new controls.<br />
													Standard Flesk.ViewStateOptimizer configuration persists the Viewstate using the same GUID as the original<br />
													page. <br />
													If the user then hit&#8217;s refresh (F5) in the browser, the data is posted again, the framework loads up it&#8217;s<br />
													controls based on the original state but the viewstate value now matches the new controls. This also happens<br />
													with any change to the viewstate between postbacks, when users back up or use refresh in their browsers.<br />
													<br />
													The solution was to make Flesk.ViewStateOptimizer generate GUID&#8217;s each and every time the viewstate is persisted.<br />
													Only then is the viewstate truly unique for each page. </li>
</ul>
<div style="">
<p>&nbsp;</p>
<p><font size="2"><strong>Features<a name="Features"></a></strong></font></p>
<p> <strong>V1.0</strong></p>
<ul>
<li>Reduces downloading time of your website or web application, by not sending back the page&#8217;s Viewstate<br />
														hidden field.</li>
<li> This component is setup individually. It is not shared by all the webserver&#8217;s websites, but only by<br />
														your website or webapplication. This means that you can install it in your hosting account without changing<br />
														any webserver&#8217;s configuration. </li>
<li> Runs on .NET Framework v1.1 and v2.0. No configuration required. Only a few lines on your web.config<br />
														file is all you need to change. </li>
<li>Greatly reduces bandwidth traffic from your webserver, reduces Posted data from your client&#8217;s browser,<br />
														and speeds up your web application! <br />
														Supported by WebFarms 
													</li>
</ul>
<p> <strong>V1.2</strong></p>
<ul>
<li>Compresses the ViewState value. This means that ViewState is sent and returned to/from client&#8217;s browser<br />
														or saved into local file, on server, compressed, thus reducing ViewState&#8217;s value length and increasing<br />
														speed even more!</li>
<li> This release of the Viewstate Optimizer is designed to meet the requirements of<br />
														customers that are unable to change the base class of their pages. </li>
<li>The Flesk.Accelerator.Page class now provides two static methods that allow calling the viewstate
<p>														procedures from within any page class.</li>
<li>ViewState files can now be persisted on shared location accessible by all servers in a server farm.
</li>
<p>From <a href="http://web.archive.org/web/20080501220023/http://www.flesk.net/fleskviewstate.aspx">Archive.Org</a></p>
<p>Not sure what happened to the company but glad they decided to give their product for free now! (GPL license)<br />
<h3>Other Interesting Posts</h3>
<ul class="related_post">
<li><a href="http://www.sharpdeveloper.net/content/archive/2008/05/08/php-vs-aspnet.aspx" title="PHP VS. ASP.NET">PHP VS. ASP.NET</a></li>
<li><a href="http://www.sharpdeveloper.net/content/archive/2007/05/25/creating-sqlparameters-best-practices.aspx" title="Creating SqlParameters Best Practices">Creating SqlParameters Best Practices</a></li>
<li><a href="http://www.sharpdeveloper.net/content/archive/2007/07/02/fix-clipshare-the-easy-way.aspx" title="Sql Injections and Securing Clipshare Vulnerabilities">Sql Injections and Securing Clipshare Vulnerabilities</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.sharpdeveloper.net/content/archive/2010/03/01/flesk-viewstate-optimizer-documentation.aspx/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.sharpdeveloper.net/content/archive/2010/03/01/flesk-viewstate-optimizer-documentation.aspx</feedburner:origLink></item>
		<item>
		<title>Recursively extract files</title>
		<link>http://feedproxy.google.com/~r/sharpdeveloper/~3/oGgSNZb7fQE/recursively-extract-files.aspx</link>
		<comments>http://www.sharpdeveloper.net/content/archive/2010/02/11/recursively-extract-files.aspx#comments</comments>
		<pubDate>Thu, 11 Feb 2010 20:21:59 +0000</pubDate>
		<dc:creator>Sameer</dc:creator>
				<category><![CDATA[Hosting]]></category>

		<guid isPermaLink="false">http://www.sharpdeveloper.net/content/?p=507</guid>
		<description><![CDATA[i want to recursively unzip into proper folder
so i have
/home/abdullah/quran1/files.zip
/home/abdullah/quran2/files.zip
&#8230;
/home/abdullah/quranfolder/files.zip
i simply want to unzip all of them at once, here is the shell script to do it in linux:
find -maxdepth 1 -mindepth 1 -type d &#124; while read line; do unzip $line/*.zip -d $line ; done
This way is problematic if any of the folders have [...]]]></description>
			<content:encoded><![CDATA[<p>i want to recursively unzip into proper folder<br />
so i have<br />
/home/abdullah/quran1/files.zip</p>
<div id=":s4">/home/abdullah/quran2/files.zip<br />
&#8230;<br />
/home/abdullah/quranfolder/files.zip</p>
<p>i simply want to unzip all of them at once, here is the shell script to do it in linux:</p></div>
<pre class="syntax-highlight:php">find -maxdepth 1 -mindepth 1 -type d | while read line; do unzip $line/*.zip -d $line ; done</pre>
<p>This way is problematic if any of the folders have spaces in them</p>
<p>this way is better</p>
<pre class="syntax-highlight:php">

for dir in */
do
( cd &quot;$dir&quot; &amp;amp;amp;amp;&amp;amp;amp;amp; unzip *.zip )
done
</pre>
<p>Ref: http://unix.derkeiler.com/Newsgroups/comp.unix.misc/2005-03/0006.html</p>
<p>Here is an application of method 1 above, delete all files with 2008 in the name</p>
<pre class="syntax-highlight:php">find -name *2008* | while read line; do rm -f $line ; done</pre>
<h3>Other Interesting Posts</h3>
<ul class="related_post">
<li><a href="http://www.sharpdeveloper.net/content/archive/2008/05/08/php-vs-aspnet.aspx" title="PHP VS. ASP.NET">PHP VS. ASP.NET</a></li>
<li><a href="http://www.sharpdeveloper.net/content/archive/2007/05/25/creating-sqlparameters-best-practices.aspx" title="Creating SqlParameters Best Practices">Creating SqlParameters Best Practices</a></li>
<li><a href="http://www.sharpdeveloper.net/content/archive/2007/07/02/fix-clipshare-the-easy-way.aspx" title="Sql Injections and Securing Clipshare Vulnerabilities">Sql Injections and Securing Clipshare Vulnerabilities</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.sharpdeveloper.net/content/archive/2010/02/11/recursively-extract-files.aspx/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.sharpdeveloper.net/content/archive/2010/02/11/recursively-extract-files.aspx</feedburner:origLink></item>
		<item>
		<title>Improve SQL Server Plan Execution Speed With Foreign Keys and constraints</title>
		<link>http://feedproxy.google.com/~r/sharpdeveloper/~3/CbsDnY6wSck/improve-sql-server-plan-execution-speed-with-foreign-keys-and-constraints.aspx</link>
		<comments>http://www.sharpdeveloper.net/content/archive/2010/01/11/improve-sql-server-plan-execution-speed-with-foreign-keys-and-constraints.aspx#comments</comments>
		<pubDate>Mon, 11 Jan 2010 15:01:25 +0000</pubDate>
		<dc:creator>Sameer</dc:creator>
				<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.sharpdeveloper.net/content/?p=503</guid>
		<description><![CDATA[Its been a while since I have posted, and I thought this was too amazing to NOT share
Apparently, using Check Constraints and adding Foreign Keys not only improves the quality of your database through ensuring referential integrity and data integrity in general, apparently it also helps the Query Analyzer design better plans!
Take a look at [...]]]></description>
			<content:encoded><![CDATA[<p>Its been a while since I have posted, and I thought this was too amazing to NOT share</p>
<p>Apparently, using Check Constraints and adding Foreign Keys not only improves the quality of your database through ensuring referential integrity and data integrity in general, apparently it also helps the Query Analyzer design better plans!</p>
<p>Take a look at this post:</p>
<ul>
<li>13 Things you should know about <a href="http://www.simple-talk.com/sql/t-sql-programming/13-things-you-should-know-about-statistics-and-the-query-optimizer/?utm_source=simpletalk&amp;utm_medium=email&amp;utm_content=13Things20100111&amp;utm_campaign=SQL">statistics and the query optimizer</a>, jump to <strong>Point 9</strong>.</li>
<li>Also, incase you are wondering what he means by &#8220;trusted constraint&#8221; and &#8220;non trusted constraints&#8221;, it would be &#8216;non trusted&#8217; if you allowed existing non-complying data in the table to stay in there. <a href="http://sqlblog.com/blogs/tibor_karaszi/archive/2008/01/12/non-trusted-constraints.aspx">More here</a> on trusted constraints.</li>
</ul>
<h3>Other Interesting Posts</h3>
<ul class="related_post">
<li><a href="http://www.sharpdeveloper.net/content/archive/2008/05/08/php-vs-aspnet.aspx" title="PHP VS. ASP.NET">PHP VS. ASP.NET</a></li>
<li><a href="http://www.sharpdeveloper.net/content/archive/2007/05/25/creating-sqlparameters-best-practices.aspx" title="Creating SqlParameters Best Practices">Creating SqlParameters Best Practices</a></li>
<li><a href="http://www.sharpdeveloper.net/content/archive/2007/07/02/fix-clipshare-the-easy-way.aspx" title="Sql Injections and Securing Clipshare Vulnerabilities">Sql Injections and Securing Clipshare Vulnerabilities</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.sharpdeveloper.net/content/archive/2010/01/11/improve-sql-server-plan-execution-speed-with-foreign-keys-and-constraints.aspx/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.sharpdeveloper.net/content/archive/2010/01/11/improve-sql-server-plan-execution-speed-with-foreign-keys-and-constraints.aspx</feedburner:origLink></item>
		<item>
		<title>The Most Useful .NET Utility Classes Developers Tend To Reinvent Rather Than Reuse</title>
		<link>http://feedproxy.google.com/~r/sharpdeveloper/~3/qCKSFXav2iQ/the-most-useful-net-utility-classes-developers-tend-to-reinvent-rather-than-reuse.aspx</link>
		<comments>http://www.sharpdeveloper.net/content/archive/2009/08/07/the-most-useful-net-utility-classes-developers-tend-to-reinvent-rather-than-reuse.aspx#comments</comments>
		<pubDate>Fri, 07 Aug 2009 15:36:18 +0000</pubDate>
		<dc:creator>Sameer</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.sharpdeveloper.net/content/?p=496</guid>
		<description><![CDATA[I think this is a classic post that everyone should read: 
The Most Useful .NET Utility Classes Developers Tend To Reinvent Rather Than Reuse
Other Interesting Posts

PHP VS. ASP.NET
Creating SqlParameters Best Practices
Sql Injections and Securing Clipshare Vulnerabilities

]]></description>
			<content:encoded><![CDATA[<p>I think this is a classic post that everyone should read: </p>
<p><a href="http://haacked.com/archive/2007/06/13/the-most-useful-.net-utility-classes-developers-tend-to-reinvent.aspx">The Most Useful .NET Utility Classes Developers Tend To Reinvent Rather Than Reuse</a><br />
<h3>Other Interesting Posts</h3>
<ul class="related_post">
<li><a href="http://www.sharpdeveloper.net/content/archive/2008/05/08/php-vs-aspnet.aspx" title="PHP VS. ASP.NET">PHP VS. ASP.NET</a></li>
<li><a href="http://www.sharpdeveloper.net/content/archive/2007/05/25/creating-sqlparameters-best-practices.aspx" title="Creating SqlParameters Best Practices">Creating SqlParameters Best Practices</a></li>
<li><a href="http://www.sharpdeveloper.net/content/archive/2007/07/02/fix-clipshare-the-easy-way.aspx" title="Sql Injections and Securing Clipshare Vulnerabilities">Sql Injections and Securing Clipshare Vulnerabilities</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.sharpdeveloper.net/content/archive/2009/08/07/the-most-useful-net-utility-classes-developers-tend-to-reinvent-rather-than-reuse.aspx/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.sharpdeveloper.net/content/archive/2009/08/07/the-most-useful-net-utility-classes-developers-tend-to-reinvent-rather-than-reuse.aspx</feedburner:origLink></item>
		<item>
		<title>Annoying Nulls in SQLParameters</title>
		<link>http://feedproxy.google.com/~r/sharpdeveloper/~3/t7ovps2RAPw/annoying-nulls-in-sqlparameters.aspx</link>
		<comments>http://www.sharpdeveloper.net/content/archive/2009/08/07/annoying-nulls-in-sqlparameters.aspx#comments</comments>
		<pubDate>Fri, 07 Aug 2009 14:16:38 +0000</pubDate>
		<dc:creator>Sameer</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.sharpdeveloper.net/content/?p=485</guid>
		<description><![CDATA[If you read Creating SqlParameters Best Practices you will find the fun you have if you have null values:

SqlParameter[] sqlParams = new SqlParameter[] {
  new SqlParameter(&#34;@Required&#34;, required),
  questionCode == null ? new SqlParameter(&#34;@Code&#34;, DBNull.Value) : new SqlParameter(&#34;@Code&#34;, questionCode)
};

Here is a nice helper function to deal with nulls without having to manually check every [...]]]></description>
			<content:encoded><![CDATA[<p>If you read <a href="http://www.sharpdeveloper.net/content/archive/2007/05/25/creating-sqlparameters-best-practices.aspx">Creating SqlParameters Best Practices</a> you will find the fun you have if you have null values:</p>
<pre class="syntax-highlight:c#">
SqlParameter[] sqlParams = new SqlParameter[] {
  new SqlParameter(&quot;@Required&quot;, required),
  questionCode == null ? new SqlParameter(&quot;@Code&quot;, DBNull.Value) : new SqlParameter(&quot;@Code&quot;, questionCode)
};
</pre>
<p>Here is a nice helper function to deal with nulls without having to manually check every time.</p>
<pre class="syntax-highlight:c#">
        /// &lt;summary&gt;
        /// Return a SqlParameter with DBNull value or value
        /// &lt;/summary&gt;
        /// &lt;param name=&quot;key&quot;&gt;&lt;/param&gt;
        /// &lt;param name=&quot;value&quot;&gt;&lt;/param&gt;
        /// &lt;returns&gt;&lt;/returns&gt;
        public static SqlParameter NullWrapper(string key, object value)
        {
            if (value == null)
                return new SqlParameter(key, DBNull.Value);
            else
                return new SqlParameter(key, value);
        }
</pre>
<p>Then you can use it as follows</p>
<pre class="syntax-highlight:c#">
            SqlParameter[] sqlParams = new SqlParameter[] {
                new SqlParameter(&quot;@UserID&quot;, userId),
                new SqlParameter(&quot;@itemNo&quot;, itemNo),
                General.NullWrapper(&quot;@expiryDate&quot;, expiryDate) //no need to check if null any more
            };
</pre>
<h3>Other Interesting Posts</h3>
<ul class="related_post">
<li><a href="http://www.sharpdeveloper.net/content/archive/2008/05/08/php-vs-aspnet.aspx" title="PHP VS. ASP.NET">PHP VS. ASP.NET</a></li>
<li><a href="http://www.sharpdeveloper.net/content/archive/2007/05/25/creating-sqlparameters-best-practices.aspx" title="Creating SqlParameters Best Practices">Creating SqlParameters Best Practices</a></li>
<li><a href="http://www.sharpdeveloper.net/content/archive/2007/07/02/fix-clipshare-the-easy-way.aspx" title="Sql Injections and Securing Clipshare Vulnerabilities">Sql Injections and Securing Clipshare Vulnerabilities</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.sharpdeveloper.net/content/archive/2009/08/07/annoying-nulls-in-sqlparameters.aspx/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.sharpdeveloper.net/content/archive/2009/08/07/annoying-nulls-in-sqlparameters.aspx</feedburner:origLink></item>
		<item>
		<title>recursively search a certain file for certain text (linux)</title>
		<link>http://feedproxy.google.com/~r/sharpdeveloper/~3/n8EBQlwPlMk/recursively-search-a-certain-file-for-certain-text.aspx</link>
		<comments>http://www.sharpdeveloper.net/content/archive/2009/07/01/recursively-search-a-certain-file-for-certain-text.aspx#comments</comments>
		<pubDate>Wed, 01 Jul 2009 21:19:17 +0000</pubDate>
		<dc:creator>Sameer</dc:creator>
				<category><![CDATA[Hosting]]></category>
		<category><![CDATA[grep]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.sharpdeveloper.net/content/?p=481</guid>
		<description><![CDATA[Have you ever tried to do a recursive linux search for a text string inside a particular file?  For example
grep -r "mail" *.php 
and then it fails because the current folder doesn&#8217;t have any php files in it?
Here is how you can achieve a search inside all .htaccess files for the text php_flag
 find [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever tried to do a recursive linux search for a text string inside a particular file?  For example<br />
<code>grep -r "mail" *.php </code><br />
and then it fails because the current folder doesn&#8217;t have any php files in it?</p>
<p>Here is how you can achieve a search inside all <strong>.htaccess</strong> files for the text <strong>php_flag</strong></p>
<p><code> find -iname .htaccess | while read line; do grep --with-filename "php_flag.*" $line; done</code></p>
<p>This below line will search all .PHP files for a common hack script</p>
<p><code> find -iname *.php | while read line; do grep --with-filename "eval (base64_decode('aWYoIWlzc2V0KCR" $line; done</code></p>
<p>If that gives you too much output, here is a search that will only display the filenames</p>
<p><code> find . -name "*.php" | while read line; do grep --files-with-matches --with-filename "base64_decode('aWYoIWlzc2V0KCR" $line; done </code><br />
<h3>Related Posts</h3>
<ul class="related_post">
<li><a href="http://www.sharpdeveloper.net/content/archive/2009/06/13/advanced-file-deletion-in-linux.aspx" title="Advanced File Deletion in Linux">Advanced File Deletion in Linux</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.sharpdeveloper.net/content/archive/2009/07/01/recursively-search-a-certain-file-for-certain-text.aspx/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.sharpdeveloper.net/content/archive/2009/07/01/recursively-search-a-certain-file-for-certain-text.aspx</feedburner:origLink></item>
		<item>
		<title>Advanced File Deletion in Linux</title>
		<link>http://feedproxy.google.com/~r/sharpdeveloper/~3/fcgiub-oknU/advanced-file-deletion-in-linux.aspx</link>
		<comments>http://www.sharpdeveloper.net/content/archive/2009/06/13/advanced-file-deletion-in-linux.aspx#comments</comments>
		<pubDate>Sat, 13 Jun 2009 16:39:55 +0000</pubDate>
		<dc:creator>Sameer</dc:creator>
				<category><![CDATA[Hosting]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.sharpdeveloper.net/content/?p=474</guid>
		<description><![CDATA[Here is a cool way to delete files according to some complex rules without knowing complicated bash commands.
First, create a file as follows that contains your deletion rules.

+ public_html/
+ public_html/*
- access-logs
- etc/
- logs/
- mail/
- .cpanel/
- .cpaddons/
- .spamassassin/
- .ssh/
- public_ftp/
- cpmove.psql/
- tmp/
- cpeasyapache/
- MySQL-install/

Then, run rsync with the source and destination folder being the same
rsync -avz [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a cool way to delete files according to some complex rules without knowing complicated bash commands.</p>
<p>First, create a file as follows that contains your deletion rules.<br />
<code><br />
+ public_html/<br />
+ public_html/*<br />
- access-logs<br />
- etc/<br />
- logs/<br />
- mail/<br />
- .cpanel/<br />
- .cpaddons/<br />
- .spamassassin/<br />
- .ssh/<br />
- public_ftp/<br />
- cpmove.psql/<br />
- tmp/<br />
- cpeasyapache/<br />
- MySQL-install/<br />
</code></p>
<p>Then, run rsync with the source and destination folder being the same<br />
<code>rsync -avz --include-from:rulesFile.txt . . --delete-excluded</code></p>
<p>You can add <strong>&#8211;dry-run</strong> if you want to see what will be deleted:</p>
<p><code>rsync -avz --include-from:rulesFile.txt . . --delete-excluded --dry-run</code></p>
<h3>Related Posts</h3>
<ul class="related_post">
<li><a href="http://www.sharpdeveloper.net/content/archive/2009/07/01/recursively-search-a-certain-file-for-certain-text.aspx" title="recursively search a certain file for certain text (linux)">recursively search a certain file for certain text (linux)</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.sharpdeveloper.net/content/archive/2009/06/13/advanced-file-deletion-in-linux.aspx/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.sharpdeveloper.net/content/archive/2009/06/13/advanced-file-deletion-in-linux.aspx</feedburner:origLink></item>
		<item>
		<title>ASP.NET 4.0 Features</title>
		<link>http://feedproxy.google.com/~r/sharpdeveloper/~3/2IwuZhTpSTg/aspnet-40-features.aspx</link>
		<comments>http://www.sharpdeveloper.net/content/archive/2009/05/27/aspnet-40-features.aspx#comments</comments>
		<pubDate>Wed, 27 May 2009 14:37:00 +0000</pubDate>
		<dc:creator>Sameer</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.sharpdeveloper.net/content/?p=470</guid>
		<description><![CDATA[Here is a list of new features in ASP.NET 4.0.
Very interesting.  Auto start feature, new ways to choose where data is cached, built in option for compression session (via gzip), and more!
Other Interesting Posts

PHP VS. ASP.NET
Creating SqlParameters Best Practices
Sql Injections and Securing Clipshare Vulnerabilities

]]></description>
			<content:encoded><![CDATA[<p>Here is a list of <a href="http://www.asp.net/learn/whitepapers/aspnet40/">new features in ASP.NET 4.0</a>.</p>
<p>Very interesting.  Auto start feature, new ways to choose where data is cached, built in option for compression session (via gzip), and more!<br />
<h3>Other Interesting Posts</h3>
<ul class="related_post">
<li><a href="http://www.sharpdeveloper.net/content/archive/2008/05/08/php-vs-aspnet.aspx" title="PHP VS. ASP.NET">PHP VS. ASP.NET</a></li>
<li><a href="http://www.sharpdeveloper.net/content/archive/2007/05/25/creating-sqlparameters-best-practices.aspx" title="Creating SqlParameters Best Practices">Creating SqlParameters Best Practices</a></li>
<li><a href="http://www.sharpdeveloper.net/content/archive/2007/07/02/fix-clipshare-the-easy-way.aspx" title="Sql Injections and Securing Clipshare Vulnerabilities">Sql Injections and Securing Clipshare Vulnerabilities</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.sharpdeveloper.net/content/archive/2009/05/27/aspnet-40-features.aspx/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.sharpdeveloper.net/content/archive/2009/05/27/aspnet-40-features.aspx</feedburner:origLink></item>
		<item>
		<title>LINQ to Entities Create Function Import Scalar Value Missing</title>
		<link>http://feedproxy.google.com/~r/sharpdeveloper/~3/QXHRqDkiCvU/linq-to-entities-create-function-import-scalar-value-missing.aspx</link>
		<comments>http://www.sharpdeveloper.net/content/archive/2009/04/09/linq-to-entities-create-function-import-scalar-value-missing.aspx#comments</comments>
		<pubDate>Thu, 09 Apr 2009 14:27:55 +0000</pubDate>
		<dc:creator>Sameer</dc:creator>
				<category><![CDATA[.NET articles]]></category>

		<guid isPermaLink="false">http://www.sharpdeveloper.net/content/?p=467</guid>
		<description><![CDATA[LINQ to Entities seems really great.  It can save you a lot of time in writing unnecessary db connection code, improve the performance many fold, only connect to the db when required (lazy loading), and easy concurrency handling for you.
However there is a missing feature which I found out the hard way.  If [...]]]></description>
			<content:encoded><![CDATA[<p>LINQ to Entities seems really great.  It can save you a lot of time in writing unnecessary db connection code, improve the performance many fold, only connect to the db when required (lazy loading), and easy concurrency handling for you.</p>
<p>However there is a missing feature which I found out the hard way.  If you try to do a &#8216;Create Function Import&#8217; and it returns a scalar, the code will not be automatically generated, due to &#8216;lack of time&#8217; from the MS Team:</p>
<p><a href="http://social.msdn.microsoft.com/forums/en-US/adodotnetentityframework/thread/44a0a7c2-7c1b-43bc-98e0-4d072b94b2ab/">MSDN Forums</a> &#8211; See the post by Noam.</p>
<p>So basically, you are handicapped!  Either write the code yourself or just do it the old fashioned way</p>
<h3>Other Interesting Posts</h3>
<ul class="related_post">
<li><a href="http://www.sharpdeveloper.net/content/archive/2008/05/08/php-vs-aspnet.aspx" title="PHP VS. ASP.NET">PHP VS. ASP.NET</a></li>
<li><a href="http://www.sharpdeveloper.net/content/archive/2007/05/25/creating-sqlparameters-best-practices.aspx" title="Creating SqlParameters Best Practices">Creating SqlParameters Best Practices</a></li>
<li><a href="http://www.sharpdeveloper.net/content/archive/2007/07/02/fix-clipshare-the-easy-way.aspx" title="Sql Injections and Securing Clipshare Vulnerabilities">Sql Injections and Securing Clipshare Vulnerabilities</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.sharpdeveloper.net/content/archive/2009/04/09/linq-to-entities-create-function-import-scalar-value-missing.aspx/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.sharpdeveloper.net/content/archive/2009/04/09/linq-to-entities-create-function-import-scalar-value-missing.aspx</feedburner:origLink></item>
		<item>
		<title>Write .NET 3.5 in a .NET 2.0 World</title>
		<link>http://feedproxy.google.com/~r/sharpdeveloper/~3/vv96pcXbds8/write-net-35-in-a-net-20-world.aspx</link>
		<comments>http://www.sharpdeveloper.net/content/archive/2009/04/02/write-net-35-in-a-net-20-world.aspx#comments</comments>
		<pubDate>Thu, 02 Apr 2009 14:16:23 +0000</pubDate>
		<dc:creator>Sameer</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.sharpdeveloper.net/content/?p=464</guid>
		<description><![CDATA[Wow, sweet.  Use .NET 3.5 features in .NET 2.0.
A quick overview how to do it.
1.  Edit your .CSPROJ file and manually add another reference to System.Core
Add a True
This will make the compiler copy it to the BIN folder.  
Thats it.  You can now use .NET 3.5 features
Other Interesting Posts

PHP VS. ASP.NET
Creating [...]]]></description>
			<content:encoded><![CDATA[<p>Wow, sweet.  <a href="http://abdullin.com/how-to-use-net-35-syntax-and-compiler-features-for-net-20/">Use .NET 3.5 features in .NET 2.0</a>.</p>
<p>A quick overview how to do it.<br />
1.  Edit your .CSPROJ file and manually add another reference to System.Core<br />
Add a <Private>True</Private></p>
<p>This will make the compiler copy it to the BIN folder.  </p>
<p>Thats it.  You can now use .NET 3.5 features</p>
<h3>Other Interesting Posts</h3>
<ul class="related_post">
<li><a href="http://www.sharpdeveloper.net/content/archive/2008/05/08/php-vs-aspnet.aspx" title="PHP VS. ASP.NET">PHP VS. ASP.NET</a></li>
<li><a href="http://www.sharpdeveloper.net/content/archive/2007/05/25/creating-sqlparameters-best-practices.aspx" title="Creating SqlParameters Best Practices">Creating SqlParameters Best Practices</a></li>
<li><a href="http://www.sharpdeveloper.net/content/archive/2007/07/02/fix-clipshare-the-easy-way.aspx" title="Sql Injections and Securing Clipshare Vulnerabilities">Sql Injections and Securing Clipshare Vulnerabilities</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.sharpdeveloper.net/content/archive/2009/04/02/write-net-35-in-a-net-20-world.aspx/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.sharpdeveloper.net/content/archive/2009/04/02/write-net-35-in-a-net-20-world.aspx</feedburner:origLink></item>
	</channel>
</rss>
