<?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>Idea Manglar</title>
	<atom:link href="http://blog.manglar.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.manglar.com</link>
	<description>{ideas}</description>
	<lastBuildDate>Sat, 10 Sep 2011 21:32:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.3</generator>
		<item>
		<title>How to remove a windows service</title>
		<link>http://blog.manglar.com/how-to-remove-a-windows-service/</link>
		<comments>http://blog.manglar.com/how-to-remove-a-windows-service/#comments</comments>
		<pubDate>Sat, 10 Sep 2011 21:32:11 +0000</pubDate>
		<dc:creator>Germán Medina</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.manglar.com/?p=266</guid>
		<description><![CDATA[sc delete &#8220;Service Name&#]]></description>
			<content:encoded><![CDATA[<p>sc delete &#8220;Service Name&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.manglar.com/how-to-remove-a-windows-service/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Populating date/time tables</title>
		<link>http://blog.manglar.com/populating-datetime-tables/</link>
		<comments>http://blog.manglar.com/populating-datetime-tables/#comments</comments>
		<pubDate>Wed, 03 Aug 2011 02:29:33 +0000</pubDate>
		<dc:creator>Germán Medina</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.manglar.com/?p=263</guid>
		<description><![CDATA[This code will populate a date/time table for a cube or any other purpose in SQL Server. declare @start datetime, @end datetime, @date datetime, @hour int select @start = '2011-08-01 00:00', @end = '2013-01-01 00:00' set @date = @start while @date &#60; @end begin set @hour = 0 while @hour &#60; 24 begin insert into ]]></description>
			<content:encoded><![CDATA[<p>This code will populate a date/time table for a cube or any other purpose in SQL Server.</p>
<pre class="brush: sql; title: ;">
declare
	@start datetime,
	@end datetime,
	@date datetime,
	@hour int
select
	@start = '2011-08-01 00:00',
	@end =   '2013-01-01 00:00'
set @date = @start
while @date &lt; @end
	begin
		set @hour = 0
		while @hour &lt; 24
			begin
				insert into [date]([id], yeardate, monthdate, daydate, hourdate,[year], [month], [day], [hour])
				values(
					ltrim(datepart(year, @date)) + '-' + ltrim(datepart(month, @date)) + '-' + ltrim(datepart(day, @date)) + ' ' + str(@hour) + ':00',
					ltrim(datepart(year, @date)) + '-01-01 00:00',
					ltrim(datepart(year, @date)) + '-' + ltrim(datepart(month, @date)) + '-01 00:00',
					ltrim(datepart(year, @date)) + '-' + ltrim(datepart(month, @date)) + '-' + ltrim(datepart(day, @date)) + ' 00:00',
					ltrim(datepart(year, @date)) + '-' + ltrim(datepart(month, @date)) + '-' + ltrim(datepart(day, @date)) + ' ' + str(@hour) + ':00',
					datepart(year, @date),
					datepart(month, @date),
					datepart(day, @date),
					@hour)
				set @hour = @hour + 1;
			end
		set @date = dateadd(day, 1, @date)
	 end
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.manglar.com/populating-datetime-tables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Calculating table sizes on SQL Azure</title>
		<link>http://blog.manglar.com/calculating-table-sizes-on-sql-azure/</link>
		<comments>http://blog.manglar.com/calculating-table-sizes-on-sql-azure/#comments</comments>
		<pubDate>Tue, 02 Aug 2011 16:34:52 +0000</pubDate>
		<dc:creator>Germán Medina</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.manglar.com/?p=254</guid>
		<description><![CDATA[This query will retrieve the rounded (2) size (MB) of all your tables on a SQL Azure database. select sys.objects.name, cast(round(sum(reserved_page_count) * 8.0 / 1024, 2) as float) as size from sys.dm_db_partition_stats, sys.objects where sys.dm_db_partition_stats.object_id = sys.objects.object_id group by sys.objects.name order by size desc]]></description>
			<content:encoded><![CDATA[<p>This query will retrieve the rounded (2) size (MB) of all your tables on a SQL Azure database.</p>
<pre class="brush: sql; title: ;">
select
      sys.objects.name,
      cast(round(sum(reserved_page_count) * 8.0 / 1024, 2) as float) as size
from
      sys.dm_db_partition_stats,
      sys.objects
where
      sys.dm_db_partition_stats.object_id = sys.objects.object_id
group by
	sys.objects.name
order by
	size desc
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.manglar.com/calculating-table-sizes-on-sql-azure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to connect a Debian machine to a Windows 2008 PPTP VPN</title>
		<link>http://blog.manglar.com/how-to-connect-a-debian-machine-to-a-windows-2008-pptp-vpn/</link>
		<comments>http://blog.manglar.com/how-to-connect-a-debian-machine-to-a-windows-2008-pptp-vpn/#comments</comments>
		<pubDate>Tue, 08 Jun 2010 08:02:00 +0000</pubDate>
		<dc:creator>Germán Medina</dc:creator>
				<category><![CDATA[Tech Recipes]]></category>

		<guid isPermaLink="false">http://blog.manglar.com/?p=253</guid>
		<description><![CDATA[#apt-get install pptp-linux #apt-get install ca-certificates Copy certificate to /usr/share/ca-certificates . If your certificate extension is .cer then change it to .crt #dpkg-reconfigure ca-certificates //Select your certificate from the list Follow the pppt client debian configuration instructions on http://pptpclient.sourceforge.net/howto-debian.phtml Create a /etc/ppp/ip-up.d/ppp0 with routing information: #!/bin/sh /sbin/route add -net 192.168.1.0 netmask 255.255.255.0 dev ppp0 #chmod ]]></description>
			<content:encoded><![CDATA[<ol>
<li>#apt-get install pptp-linux</li>
<li>#apt-get install ca-certificates</li>
<li>Copy certificate to /usr/share/ca-certificates . If your certificate extension is .cer then change it to .crt</li>
<li>#dpkg-reconfigure ca-certificates //Select your certificate from the list</li>
<li>Follow the pppt client debian configuration instructions on <a href="http://pptpclient.sourceforge.net/howto-debian.phtml">http://pptpclient.sourceforge.net/howto-debian.phtml</a></li>
<li>Create a /etc/ppp/ip-up.d/ppp0 with routing information:<br />
#!/bin/sh<br />
/sbin/route add -net 192.168.1.0 netmask 255.255.255.0 dev ppp0</li>
<li>#chmod +x /etc/ppp/ip-up.d/ppp0</li>
<li>Add the next lines to you /etc/ppp/peers/provider file if you want your connection to be reconnected if it fails and if you want to assign a static ip address to your connection<br />
persist<br />
192.168.1.10:</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://blog.manglar.com/how-to-connect-a-debian-machine-to-a-windows-2008-pptp-vpn/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to install Linux Integration Services Version 2.1 on a Hyper-V virtual machine running Debian</title>
		<link>http://blog.manglar.com/how-to-install-linux-integration-services-version-2-1-on-a-hyper-v-virtual-machine-running-debian/</link>
		<comments>http://blog.manglar.com/how-to-install-linux-integration-services-version-2-1-on-a-hyper-v-virtual-machine-running-debian/#comments</comments>
		<pubDate>Tue, 08 Jun 2010 06:38:42 +0000</pubDate>
		<dc:creator>Germán Medina</dc:creator>
				<category><![CDATA[Tech Recipes]]></category>

		<guid isPermaLink="false">http://blog.manglar.com/?p=250</guid>
		<description><![CDATA[Linux Integration Services Version 2.1 now has support for Timesync, Integrated Shutdown and Symmetric Multi-Processing (SMP) up to 4 virtual processors. Get the Linux Integration Services 2.1 Beta from https://connect.microsoft.com/site495 Extract the files and insert the .iso as a disk in your virtual machine Now the hard/long part, update your Kernel with version 2.6.27.47 (This ]]></description>
			<content:encoded><![CDATA[<p>Linux Integration Services Version 2.1 now has support for Timesync, Integrated Shutdown and Symmetric Multi-Processing (SMP) up to 4 virtual processors.</p>
<ol>
<li>Get the Linux Integration Services 2.1 Beta from <a href="https://connect.microsoft.com/site495">https://connect.microsoft.com/site495</a></li>
<li>Extract the files and insert the .iso as a disk in your virtual machine</li>
<li>Now the hard/long part, update your Kernel with version 2.6.27.47 (This is out of scope, so you will have to look for info on how to do this).</li>
<li>Reboot and choose your new Kernel</li>
<li>#mount /cdrom</li>
<li>#mkdir /opt/linux_ic_v21_rc</li>
<li>#cp /cdrom/* /opt/linux_ic_v21_rc -R</li>
<li>#mkdir /etc/sysconfig/network</li>
<li># cd /opt/linux_ic_v21_rc  -R</li>
<li>Modify the Mafile file replacing all the occurrences of <em>—reload-rules</em> with <em>—reload_rules</em></li>
<li>Modify the scripts/updateinitrd.pl file commenting lines 79 to 87 and adding this line after that <em>$initrdfile = &#8220;/boot/initrd.img-2.6.27.47&#8243;;</em>  </li>
<li>Modify scripts/updategrub.pl file replacing line 55 with <em>$grubfile = &#8220;/boot/grub/menu.lst&#8221;;</em></li>
<li>#apt-get install chkconfig</li>
<li>#make</li>
<li>#make install</li>
<li>Modify your /etc/init.d/vmbus file commenting lines 55 to 61 and 108 to 112. Also replace line 73 with <em>return 0</em> and 75 with <em>return 1</em></li>
<li>Modify your /etc/network/interfaces file replacing eth0 with seth0</li>
<li>Modify your /etc/initramfs-tools/modules file adding a <em>vmbus</em> line and a <em>netvsc</em> line</li>
<li>#update-initramfs –u –k 2.6.27.47</li>
<li>Shutdown your virtual machine #init 0</li>
<li>Replace your legacy network adapter with a normal Network adapter copying your old adapter’s MAC to your new adapter</li>
<li>Start your virtual machine</li>
<li>That’s it, now you have a Debian Hyper-V virtual machine with Integration Services.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://blog.manglar.com/how-to-install-linux-integration-services-version-2-1-on-a-hyper-v-virtual-machine-running-debian/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>How to shrink a database log file in SQL Server 2008</title>
		<link>http://blog.manglar.com/how-to-shrink-a-database-log-file-in-sql-server-2008/</link>
		<comments>http://blog.manglar.com/how-to-shrink-a-database-log-file-in-sql-server-2008/#comments</comments>
		<pubDate>Sat, 22 May 2010 18:46:15 +0000</pubDate>
		<dc:creator>Germán Medina</dc:creator>
				<category><![CDATA[Tech Recipes]]></category>

		<guid isPermaLink="false">http://blog.manglar.com/how-to-shrink-a-database-log-file-in-sql-server-2008/</guid>
		<description><![CDATA[ALTER DATABASE database SET RECOVERY SIMPLE; dbcc shrinkfile (database_log, 1); ALTER DATABASE database SET RECOVERY ]]></description>
			<content:encoded><![CDATA[<pre class="brush: sql; title: ;">
ALTER DATABASE database SET RECOVERY SIMPLE;
dbcc shrinkfile (database_log, 1);
ALTER DATABASE database SET RECOVERY FULL;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.manglar.com/how-to-shrink-a-database-log-file-in-sql-server-2008/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to use SSL in a WCF service</title>
		<link>http://blog.manglar.com/how-to-use-ssl-in-a-wcf-service/</link>
		<comments>http://blog.manglar.com/how-to-use-ssl-in-a-wcf-service/#comments</comments>
		<pubDate>Fri, 19 Feb 2010 20:46:09 +0000</pubDate>
		<dc:creator>Germán Medina</dc:creator>
				<category><![CDATA[Tech Recipes]]></category>
		<category><![CDATA[WCF]]></category>
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://blog.manglar.com/?p=199</guid>
		<description><![CDATA[1. Enable SSL configuration on your site 2. Set your binding security mode to Transport. 3. Set you service behavior serviceAuthorization PrincipalPermissionMode to None. public class ServiceHostFactory : WebServiceHostFactory     {         protected override ServiceHost CreateServiceHost(Type serviceType, Uri[] baseAddresses)         {             ServiceHost host = new ServiceHost(typeof(Services), baseAddresses);             host.Authorization.PrincipalPermissionMode = PrincipalPermissionMode.None;             ServiceEndpoint endpoint ]]></description>
			<content:encoded><![CDATA[<p>1. Enable SSL configuration on your site<br />
2. Set your binding security mode to Transport.<br />
3. Set you service behavior serviceAuthorization PrincipalPermissionMode to None.</p>
<pre class="brush: csharp; title: ; wrap-lines: false;">
public class ServiceHostFactory : WebServiceHostFactory
    {
        protected override ServiceHost CreateServiceHost(Type serviceType, Uri[] baseAddresses)
        {
            ServiceHost host = new ServiceHost(typeof(Services), baseAddresses);
            host.Authorization.PrincipalPermissionMode = PrincipalPermissionMode.None;
            ServiceEndpoint endpoint = host.AddServiceEndpoint(typeof(IServices), new WebHttpBinding(WebHttpSecurityMode.Transport), &quot;&quot;);
            endpoint.Behaviors.Add(new WebHttpBehaviorEx());
            return host;
        }
    }
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.manglar.com/how-to-use-ssl-in-a-wcf-service/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to publish WCF services using IIS6</title>
		<link>http://blog.manglar.com/how-to-publish-wcf-services-using-iis6/</link>
		<comments>http://blog.manglar.com/how-to-publish-wcf-services-using-iis6/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 01:44:55 +0000</pubDate>
		<dc:creator>Germán Medina</dc:creator>
				<category><![CDATA[Tech Recipes]]></category>
		<category><![CDATA[WCF]]></category>
		<category><![CDATA[Webservices]]></category>

		<guid isPermaLink="false">http://blog.manglar.com/?p=197</guid>
		<description><![CDATA[1. C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis –i 2. C:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe –i 3. Do all the things you normally do on IIS7, you are all set]]></description>
			<content:encoded><![CDATA[<p>1. C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis –i<br />
2. C:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe –i<br />
3. Do all the things you normally do on IIS7, you are all set.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.manglar.com/how-to-publish-wcf-services-using-iis6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to go beyond PUT and DELETE limitations on RESTful Scenarios</title>
		<link>http://blog.manglar.com/how-to-go-beyond-put-and-delete-limitations-on-restful-scenarios/</link>
		<comments>http://blog.manglar.com/how-to-go-beyond-put-and-delete-limitations-on-restful-scenarios/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 04:38:33 +0000</pubDate>
		<dc:creator>Germán Medina</dc:creator>
				<category><![CDATA[Tech Recipes]]></category>
		<category><![CDATA[WCF]]></category>
		<category><![CDATA[REST]]></category>
		<category><![CDATA[RESTful]]></category>

		<guid isPermaLink="false">http://blog.manglar.com/?p=186</guid>
		<description><![CDATA[One of the biggest problems you will have while implementing RESTful services is that most of today’s browsers and firewalls will not allow PUT and DELETE requests. An easy way to fix this is to add a custom HTTP header to your post requests and send the real method in there. Since Google is using ]]></description>
			<content:encoded><![CDATA[<p>One of the biggest problems you will have while implementing RESTful services is that most of today’s browsers and firewalls will not allow PUT and DELETE requests. An easy way to fix this is to add a custom HTTP header to your post requests and send the real method in there. Since Google is using “X-HTTP-Method-Override” it looks like a smart choice to follow that pattern and use it too.</p>
<p>This simple jquery code shows how to do it in the client side:</p>
<pre class="brush: jscript; title: ;">
$.ajax({
    type: &quot;POST&quot;,
    url: serviceURL,
    data: &quot;data&quot;,
    success: function(data, textStatus) { alert(&quot;success&quot;); },
    error: function(xhr, status, error) { alert(&quot;error&quot;); },
    beforeSend: function(xhr) { xhr.setRequestHeader(&quot;X-HTTP-Method-Override&quot;, &quot;DELETE&quot;); }
});
</pre>
<p>This C# code shows how to use the custom header in a WCF server:</p>
<pre class="brush: csharp; title: ;">
public String PostProxy(String data)
{
    switch (HttpContext.Current.Request.Headers[&quot;X-HTTP-Method-Override&quot;])
    {
        case &quot;PUT&quot;: return Add(data);
        case &quot;DELETE&quot;: return Delete(data);
        default: return Update(data);
    }
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.manglar.com/how-to-go-beyond-put-and-delete-limitations-on-restful-scenarios/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Big files transfer using WCF services</title>
		<link>http://blog.manglar.com/big-files-transfer-using-wcf-services/</link>
		<comments>http://blog.manglar.com/big-files-transfer-using-wcf-services/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 22:15:43 +0000</pubDate>
		<dc:creator>Germán Medina</dc:creator>
				<category><![CDATA[Tech Recipes]]></category>
		<category><![CDATA[WCF]]></category>
		<category><![CDATA[Webservices]]></category>

		<guid isPermaLink="false">http://blog.manglar.com/?p=178</guid>
		<description><![CDATA[If you need to receive files bigger than 4MB using WCF services you have to change the default configuration in your web.config file to allow the size required. &#60;system.web&#62;     &#60;httpRuntime maxRequestLength=&#34;131072&#34; /&#62; &#60;/system.web&#62; Note: this should work for any ASP application]]></description>
			<content:encoded><![CDATA[<p>If you need to receive files bigger than 4MB using WCF services you have to change the default configuration in your web.config file to allow the size required.</p>
<pre class="brush: xml; title: ;">
&lt;system.web&gt;
    &lt;httpRuntime maxRequestLength=&quot;131072&quot; /&gt;
&lt;/system.web&gt;
</pre>
<p>Note: this should work for any ASP application.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.manglar.com/big-files-transfer-using-wcf-services/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

