Tuesday, December 1, 2015

How to Delete/Rebuild Umbraco cache?





How to Delete/Rebuild Umbraco cache?
 


Umbraco maintains the content in two places. One in database and the other in file system as cache in xml. The file system (cache version) can be cleared by hitting at the below link.

Delete/Rebuild umbraco based website cache from direct url:
http://&ltYoursitename>/Umbraco/dialogs/republish.aspx?xml=true

 
If you need further information, the same can be found here







Saturday, November 28, 2015

How does href attribute of anchor tags works?

I Just found the following site that I think does a really good job explaining the href attribute of anchor tags and how it interprets URL paths.  It shows a lots of examples to illustrate the differences between the path types:


http://www.mediacollege.com/internet/html/hyperlinks.html

Thursday, February 26, 2015

How to force a query to recompile every time in SQL server.

If you want to clear execution plan and cache, you could use the below commands

DBCC FreeProcCache
DBCC DropCleanbuffers


More details here
https://msdn.microsoft.com/en-us/library/ms174283.aspx

If you want to force query compilation each time, just add the below to the end of the query

OPTION (RECOMPILE)

Thursday, December 11, 2014

How to recursively remove a file type under a folder using PowerShell?


The below PowerShell code will help you to recursively find the files from a folder and remove it

The second line will recursively make the files in folder not rad only


$checkoutLocation = "D:\Develop\VSS\Vb"
# Removed the file recursively
Get-ChildItem -Path $checkoutLocation -Filter *.scc -Recurse | Remove-Item -Force

# Makes file not read-only recursively
Get-ChildItem -Path $checkoutLocation -Recurse | ForEach-Object { if ($_.IsReadOnly) { $_.IsReadOnly = $false } }

Monday, November 24, 2014

Why SQL server some times silently truncate the values you passed to a column and some time errors

Scenario

There are scenarios when SQL server silently truncate the values you passed to a column and sometime error as below. Actually what is happening behind the seen here?

Msg 8152, Level 16, State 14, Line 2
String or binary data would be truncated.
The statement has been terminated.

Let’s explore…….

The magic here is because of ANSI_WARNINGS begin set to OFF

In normal circumstances SQL server will truncate the data passed with respect to the underlying column if ANSI_WARNINGS is set to OFF. In case of ANSI_WARNINGS set to ON will result in the above error.

But this is overridden in case you are passing data through a variable. For example assume you have an underlying column of varchar(50) and you declare a variable varchar(50). If you try to assign the variable with a string having length greater than 50 then SQL server will automatically truncate the same to 50 with without popping any error irrespective of ANSI_WARNINGS OFF or ON.

But the above can result in an error if you are declaring the variable as varchar (40) for underling varchar (50) column.

Note: This truncation can also happen in .net before hitting to SQL server if you have explicitly declared the size of SQL parameter

For example:
comm.Parameters.Add("@Name", System.Data.SqlDbType.NVarChar, 50);
comm.Parameters["@Name"].Value = Name;

Sunday, November 9, 2014

Tech Ed 2014 Day 1 /2 Update on Best Practice on Azure Migration

Last week I got a chance to attend Microsoft Tech Ed 2014  @ Ashok Lalith. Bangalore

Thought of putting up the Best Practices which Microsoft suggests when moving existing Apps to Azure
 
Best Practice on Azure

Migration.

•Lift and shift- will not work and testing is required
•I am here today and will on cloud tomorrow, will not be happened
•Go for a Workload based approach

Steps for moving.

Don’t move your existing app suddenly, as a first step choose a least critical app and follow the below order
1. ISAAS – start as VM
2. Make it PAAS enabled -
3. Make it Service enabled

Best Practice

•Keep separate subscription for different type of VM..E.g. one for DEV test and other Live.

•The maximum IOPS we can get is 500 hence Create separate disks. For example in SQL create log files, data files etc. in separate disks.

•Don’t store anything on temp disk.

•Use azcopy for copying data to between.

•Enable Geo Replication…
http://azure.microsoft.com/blog/2014/09/03/azure-sql-database-standard-geo-replication/

•Locate a nearest storage location for you app... If your app is in India choose a storage location from India (Microsoft will be opening a datacentre for Azure in India soon).

•Never keep one VM in an availability set .

•Configure VM to start all service on reboot .

•Cloud Service in a subscription is limited to 200 .

•Use Wcat - to create test load on websites.
 

Tech Ed India 2014 Day 1 /2 Update Redis Cache

Last week I got a chance to attend Microsoft Tech Ed 2014  @ Ashok Lalith. Bangalore
Thought of putting up the new feature Microsoft has for Azure/.net on Redis Cache.

Redis Cache in .Net and Azure

  • Redis is an open source, BSD licensed, advanced key-value cache and store. It is often referred to as a data struc­ture server since keys can con­tain strings, hashes, lists, sets, sorted sets, bitmaps and hyperloglogs



  • It’s a Low latency, high through­put key value store