Speed up your RDP connection

by Viktor 20. March 2010 08:56

For some time now I have had problems both at work and home with very slow RDP connections making it almost impossible to work with some servers (it was not affecting all servers just "some") and today I tried to find a solution for the problem and found it.

It turns out that all you have to do is run this command as administrator and your will see a very big speed difference,

netsh interface tcp set global autotuninglevel=disabled

I have basically no understanding of what the command dose but it seems to work for me and everything else still seems to work so I guess its not that dangerous.

I found this solution here, Remote Desktop slow problem solved

Tags:

General

WCF binding speeds

by Daniel.Sandberg 18. March 2010 11:17

I've built a console-client that sends 10 000 packages of four size levels. From 2 bytes up to 12 kilobytes. The packages are simply sent and return to the console-server. The client did measure the time elapsed for all the packages to travel to the server and back. Notice in the diagram that the test using pipe binding is runned localy on my machine. PeerToPeer binding, FederatedWS binding and DualWsBinding are not included in the test nor in the program.

Tags: ,

Development

Android demo

by Viktor 17. March 2010 21:24

During the last internal tech forum (tech meeting with all developers at Dropit) I had a short demo of how to make a Android application. I'm not a Android expert so forgive me for the none expert written code :)

The goal was to make a blog application where you could write a heading, main text, take a photo with you phones camera and then send this informtion together with the GPS/Network position of the phone to EPiServer and there publish a page to create a blog post. Unfortunately my harddrive crashed before I finished the project so I never had time to do the EPiServer implementation but here you can download the Android code that I put together for this demo.

AndroidBlog.zip (1.07 mb)

Tags: , ,

Development | General

Dumping files from the episerver filesystem, developer style

by erik.nilsson 11. March 2010 14:26

Since webdav is nasty and never work for me, and the boys and gals over at episerver need some lessons in usability (who thought of the idea to only be able to select files one at a time with the export tool?). I made a small code snippet to dump the contents of a entire directory, like so:

public sealed class DumpaRump
	{
		public static void DumpVirtualPath(string providerName, string outputRoot)
		{
			VirtualPathUnifiedProvider provider = (VirtualPathUnifiedProvider)VirtualPathHandler.GetProvider(providerName);
			var dir = provider.GetDirectory(provider.VirtualPathRoot);
			DumpVirtualDirectory(dir, outputRoot);
		}

		private static void DumpVirtualDirectory(VirtualDirectory directory, string outputDirectory)
		{
			foreach (var subDirectory in directory.Directories)
			{
				var virtualSubDirectory = (VirtualDirectory)subDirectory;
				DumpVirtualDirectory(virtualSubDirectory, string.Concat(outputDirectory, virtualSubDirectory.Name, "\\"));
			}

			if (!Directory.Exists(outputDirectory))
			{
				Directory.CreateDirectory(outputDirectory);
			}

			foreach (var file in directory.Files)
			{
				var virtualFile = (VirtualFile)file;

				try
				{
					using (var virtualStream = virtualFile.Open())
					{
						using (var fileStream = File.Create(string.Concat(outputDirectory, virtualFile.Name)))
						{
							byte[] buffer = new byte[8 * 1024];
							int len;
							while ((len = virtualStream.Read(buffer, 0, buffer.Length)) > 0)
							{
								fileStream.Write(buffer, 0, len);
							}
						}
					}
				}
				catch
				{
					// Something wrong with this file, some fancy errorhandling should probably be made here
				}
			}
		}
	}
And you can call it for eample like this:
	DumpaRump.DumpVirtualPath("SiteGlobalFiles", "C:\\Temp\\GlobalDump\\");

 

Enjoy.

Tags:

How to restore user when database is restored.

by mats.decker 24. February 2010 15:04

A thing that always annoys me, when backup-restoring a database between database servers, is the mismatch between the sql login and database login. In some way they have the same name but some id isn't equal so they don't match. Atleast in newer versions of SQL Server you could delete one and re-map it.

Stumbled across this script that matches the server login and database login.

USE [Database]
EXEC sp_change_users_login 'Update_One', 'Username', 'Username'

This only works when the usernames match.

Tags:

Developer lunch: Entity Framework in .NET 4

by mats.decker 13. February 2010 14:10

For "my" developer lunch i selected an awesome session from Microsoft PDC09, called Evolving ADO.NET Entity Framework in .NET 4 and Beyond, where Microsoft's Shyam Pather and Chris Anderson takes us through an hour of as many new features in the new Entity Framework as possible.

Especially interesting is the ability to use POCO-classes (Plain Old CLR Objects) and the "Model first" concept where you remove the dependency to any base classes and begin with the logic tier. Also, with the embedding of LinqToSql into Entity Framework, the rendering of SQL-clauses and implementation of Stored Procedures in the context really takes the data access layer to a new level and remove many pitfalls seen in the past with OR mappers.

Adding to this with the ability to test applications with fake repositories and such i think this is the way to build applications for quite a while.

Tags: , , , , , ,

Beta release - Calculate your publishing power

by Fredrik Karlsson 27. January 2010 10:49

This is a part in a release by Dropit's section for measurement and Continuous Improvement, Mark Red, and their latest project to calculate yor publishing power.

Publishing Power?

Do you have a creeping feeling that you spent a lot of time to update the site without giving anything back? What gives updates to the Web back in the form of visitors and revenue?
Calculate the "publishing power" of each section of the site by "Pageviews of Section / Work in the Section". Publishing power indicates how much the requests you receive in relation to the time the editors devote to managing content. A high publication power indicates that the section get many visits with little effort.

Of course it is even more interesting to see how much revenue the workload is resulting in. If you use Google Analytics, you can calculate the publishing poser by "$-index for Section / Work for the Section".
If you have a site that is configured to measure income from e-commerce you'll find $-index for the site's sections in the report "Content Drilldown".
Read the entire post at Mark Reds blog

 EPiServer CMS integration

This is a very early release, so all there is right now is a property and a report. The property calculates the time you spend editing a single page and the report displays the accumelated time for a section of the web site.

TimerProperty


The porperty is simply a hidden text field and a javascript function adds time.

Publishing power Report 

The report simply displays the amount of time spent editing a section (current page and all children) of the web site.

Future development

The first thing to add is the integration with Google Analytics. We need to display the page views so we can display the Publishing Power values. And as soon as EPiServer CMS 6 is released, we can use the Page objects to store the information. Lots and lots of a more elegant design!

After that, We're not quite sure. Any suggestions?

Source Code

This is a beta, the entire project is avalible here:
PublishingPower.rar (2.80 mb)

Tags: , , ,

Development

Developer lunch - "From good to great developer - why does it matters and how can we achieve it"

by Fredrik Karlsson 24. January 2010 22:44

For this weeks developer lunch I thought I would pick a seminar I saw at TechDays 2009 here in Sweden.

It was "From good to great developer - why does it matters and how can we achieve it" by Chris Hedgate. Unfortunately, the recording only displayed the screen and not him and since the presentation relied on the audience being able to see him, I had to find another recoring. Luckily, I found pretty much the same presentation from JFokus, and this time they included Chris as well, success. See the movie here.

Tags: , ,

Development

Developer Lunch: An Introduction to Microsoft F#

by magnus.wachenfeldt 14. January 2010 12:59

So, it was my turn to pick a video for our weekly developer lunch. I am not generally a fan of technical videos, but sometimes you find great ones.

This one however was really worth my time. An Introduction to Microsoft F# by Luca Bolognese, Microsoft's answer to Cristian Libardo. Competently and with a great sense of humor, he guides you through the basics of F# and proceeds to create a real world application for those still doubting the power and usefulness of F#.

A common misconception is that functional programming languages are strange, hard to learn and overly mathematical. This is very far from the truth. As Luca points out in the video, F# is much closer to how you actually think about a problem. I will not repeat what he is saying in the video - just make one hour free and watch it!

An Introduction to Microsoft F#
Microsoft F# Developer Center
Luca Bolognese's WebLog

Tags: , ,

Development | Languages

Checklist for deploying EPiServer sites

by Andreas Nylin 10. January 2010 20:20

There are many tasks that needs to be performed when a new EPiServer web site is deployed and it's easy to forget something. This is a checklist with some of the most common tasks that needs to be done on most new EPiServer web sites. You can download the list as PDF here.

Updated 2010-01-15. Added info on Google Page Speed, IIS Compression, Scheduled jobs and IIS SEO Toolkit.

Updated 2010-01-28. Apparently auto shrinking causes file system fragmentation which slows down performance so it should never be turned on.

Updated 2010-03-25. Added info on EPiServerLog.config. More detailed descriptions.

Licenses


Order license for EPiServer
Make sure that correct license types have been ordered.

Order licenses for EPiServer modules
Make sure that correct license types have been ordered.


Access rights in EPiServer


Check access rights in the EPiServer page tree
Make sure that Administrators and Editors have the correct access levels. Remove everyone from pages that shouldn’t be accessed by normal users.

Remove test users and groups in EPiServer
Go through the list of users and groups and remove those that shouldn’t have access to the site.

Create users and groups in EPiServer (WebAdmins and WebEditors)
Create required users and groups and set their access rights. Create WebAdmins and WebEditors groups for administrators and editors.


Web.config


Set compilation debug to false
Set the debug attribute of the compilation section to false.

Set attributes for mailsettings section
· host = the mail server that should be used to send mails
· from = set to an address or remove
· port, userName, passWord (for mail server if needed)

Search for ":\" and “\\” and check that all paths are correct
Verify that all file system paths are correct.

Check access rights in web.config
Check the authorization section under each location section and verify that the specified groups are correct.


Episerver.config


Set siteUrl = http://www.acme.com

Set uiUrl = http://www.acme.com/UI/

Set utilUrl = http://www.acme.com/Util/

Set SiteDisplayName = Site name used in title, etc

Verify paths for virtualPath/providers
Verify that all paths are correct in the virtualPath section.

Set predefined image formats for the image editor
This is done in the imageEditor > sizePresets section.

Set uiEditorCssPaths (~/EditorStyles.css)
Verify that the path is correct.

Set attributes for outputcache
· httpCacheExpiration = 01:00:00 (one hour)
· httpCacheVaryByParams = * or parameters (id,epslanguage)
· httpCacheVaryByCustom = remove if not needed

Set stringDelayedLoadThreshold = 50
Lazy load is used if a property that inherits from long string is longer than 50 characters.


ConnectionStrings.config


Verify that the correct databases and users are specified


EPiServerLog.config


Set level value="Off"
Logging should be disabled until it’s needed.


ApplicationInitializing.txt


Create an ApplicationInitializing.txt file in the web root.
The text in the file will be displayed for users if the application is busy during initialization. Example content of the file: "The application is loading. Please wait."


Database


Set Recovery mode = Simple

Set Auto shrink = false
Auto shrink causes file-system level fragmentation, which slows down performance.

Remove testusers
Make sure any testusers are removed.


Robots.txt


Create a robots.txt file in the web root
Specify any paths you want to exclude from search engines, such as: /Util/


Google Analytics


Verify that Google Analytics scripts are included in the page and that the correct key is specified.


Validate Pages


Verify that the pages HTML code validates
http://validator.w3.org

Validate the site with IIS SEO Toolkit http://weblogs.asp.net/scottgu/archive/2009/06/03/iis-search-engine-optimization-toolkit.aspx


Browser Compability


Verify that the page looks ok in these browsers:

Internet explorer 9

Internet explorer 8

Internet explorer 7

Internet explorer 6

Firefox

Google chrome

Safari

Opera


Optimization


Analyze the page with Yslow and Google Page Speed
Analyze all JavaScript and CSS files and make sure they are only loaded when needed.

Make sure that any ScriptManagers has ScriptMode set to Release
Script files will be minified when ScriptMode is set to Release.


Favicon


Verify that a favicon is displayed


Title


Verify that the page title is displayed correct


Images

 

Verify that images can be uploaded

Verify that images are displayed

Verify that automatically resized images are displayed (thumbnails, etc)


Mail



Verify that mails sent from forms are sent and received
Test Xforms and any custom built forms.


Search


Perform test searches and verify that relevant results are shown


Error pages


Add custom error pages in IIS

Verify that error pages are displayed for 404, 500, etc


IIS


Create a separate Application Pool for the site
Every site should run in its own Application pool

Disable IIS logging
Logging should be disabled until it’s needed.

Enable Gzip compression in IIS for static and dynamic content
Blog post about HTTP compression in ASP.NET: http://www.stardeveloper.com/articles/display.html?article=2007110401&page=1
This is good resource on how to setup compression in IIS7: http://technet.microsoft.com/en-us/library/cc771003(WS.10).aspx


EPiServer Admin



Verify that scheduled jobs are active
Setup scheduled jobs to run in an appropriate interval.

Tags:

Development

Creative Commons License
This work is licensed under a Creative Commons Attribution-Share Alike 2.5 Sweden License.


Welcome to the Dropit blog!

Here we, the people that work at Dropit, will write about stuff that interests us. For example web development, especially with .NET and EPiServer - but we'll also talk about other techniques that interest us, marketing on the web, social phenomenons, pop culture, games and software development in general.