Kansas City Developer Conference 2013

Calvin WongDiscountASP.NET is proud to sponsor the Kansas City Developer Conference, happening May 2-4!

It’s over 100 sessions and over 500 developers at the Kansas City Convention Center. Go network, go learn, go get educated on the latest in .NET, Ruby, Java, Python, iOS, JavaScript and Agile.

In fact, go for free! We are giving away two tickets!

FREE WebMatrix 3 Hosting Sandbox

Takeshi Etowebmatrix 3 hostingSo Web Matrix 3 launched this afternoon and, as always, we are here to help out the Web Developer community.

I’m happy to announce the launch of a  FREE Web Matrix 3 Hosting Sandbox. Head on over to our DiscountASP.NET  Labs Site and you can sign up for a free hosting account to test out Web Matrix 3.

Web Matrix v3 integrated Git and remote site editing.

This is a limited program on a first come first serve basis. The program ends August 1st.

Microsoft SQL Server Tips Series: One Data and Log File

Ray HuangIn this series of articles I hope to cover some of the common problems our customers face when backing up and restoring a database, centralize the information scattered throughout our site and forums over the years, show you how the problem may have been created in the first place and provide you with a step-by-step guide on how you can identify the problem and resolve it.

That’s a tall order, but if you’re ready, here we go.

You might see this message once in a while when restoring a database:

DatabaseRestoreFailed

There are a few reasons why we do this:

1)    We trap the SQL Server Error thrown on the back end so that one of our support staff can research and review it, interpret it for you and guide you to a solution.  Because we have a diversity of customers who contact us with varying technical skills and knowledge, displaying an error might be meaningful to an experienced developer or tech geek but not so much to the average user or a beginning developer who has his application working locally but is finding difficulty getting it to work in our hosting environment.

2)    We have International customers and bridging the language barrier can be already difficult.  If we displayed the error message, it might lead to even more confusion trying to explain it.

3)    It wouldn’t look pretty.  🙂

In this walk-through, I will cover some of the more common errors that our customers run into, show you how it may have been created and provide you with a solution.  The errors are:

“More than 2 file list in mdf file” or “More than 1 data or log file in bak file”

To simplify things, our hosting platform only supports restore operations for databases containing only one data file and one log file.  And here are a couple of ways on how to create the problem.

Method 1: Adding a Full Text Catalog

To create this problem, I’m going to download the sample AdventureWorks database for SQL Server 2005 here.

(Note: You will need to double click AdventureWorksDB.msi to extract the files.)

AdventureWorks

Then I am going to upload the AdventureWorks_Data.mdf file only to my hosting account and use the Attach tool to restore it to my DiscountASP.NET database.  Now, I am going to log into my database here at DiscountASP.NET using SQL Server Management Studio and execute this T-SQL statement to create a Full Text Index/Catalog:

USE [DiscountASP.NET database name];
 GO

CREATE UNIQUE INDEX ui_ukJobCand ON HumanResources.JobCandidate(JobCandidateID);
 CREATE FULLTEXT CATALOG ft AS DEFAULT;
 CREATE FULLTEXT INDEX ON HumanResources.JobCandidate(Resume) KEY INDEX ui_ukJobCand;
 GO

After that, I am going to use the DiscountASP.NET Control Panel to create a backup of the database.  You shouldn’t run into a problem if you perform a restore to the same version of SQL Server 2005.  The problem occurs when you try to restore to a higher version of SQL Server such as 2008, 2008R2, or 2012.  This is the error that will occur:

“More than 2 file list in mdf file”

Now if I download that .bak file and try to restore it on my local machine where I have full rights to my SQL Server instance then I can see the problem.  The Full Text Catalog is part of the file list.

RestoreFullTextCatalog

You can also view this information by executing this T-SQL statement:

RESTORE FILELISTONLY
 FROM DISK = N'[Path to Backup File]'

To fix the problem, I will go ahead and restore the database on my local machine.  Once restored, open a new query window and execute this T-SQL statement to drop the index:

DROP FULLTEXT INDEX ON HumanResources.JobCandidate

Then right click on the database and select Properties.  In the Database Properties window, select Files and then the Full Text Catalog.  Use the Remove button to remove it.  Click on the OK button.

DatabaseProperties

Prior to removing the catalog, you should scroll all the way to the right.  You’ll notice that the Full Text Catalog is stored as a secondary database file or .ndf file.  Secondary database files are used for a lot of reasons including organizing data and spreading it across different disk partitions to improve performance.  It’s more useful in a dedicated server environment and very large databases where you may need the performance increase.

If we backup the current database (without the Full Text catalog) locally and upload it, then we will be able to perform the restore using the tools in the DiscountASP.NET Control Panel.  Make sure the version of SQL Server running on your local machine matches the version on the DiscountASP.NET server, or you will run into a different error.

This is something you may want to keep in mind when upgrading your database, and it fails.  You can re-create the Full Text Catalog after the database has been restored.

Method 2: Adding an .ndf file

The second way to create this problem is to create a secondary database (.ndf) file.  To do this, I will go ahead right click on my local database and select Properties.  Then I will click on Files and the Add button.  Notice a new row has been appended under the Database files section.  I’ll give the new row a logical name of SecondaryFile.

SecondaryFile

Now, scroll to the right and under Filename, type Secondary.ndf and click on the OK button.

SecondaryFilePart2

If you were to backup this database, upload it, and try the DiscountASP.NET Restore tool, you would get this error message on the back end:

“More than 1 data or log file in bak file”

And the solution is similar to the one above.  If you have data stored on the secondary file, you will need to move it by executing this command:

DBCC SHRINKFILE (Logical Name, EMPTYFILE)

So for example:

DBCC SHRINKFILE (SecondaryFile, EMPTYFILE);

Highlight your database, right click on it and select Properties.  Go back to the Files section and use the Remove button to remove the secondary file.  You will now be able to restore the backup using the DiscountASP.NET tools.

Mobile web traffic among DiscountASP.NET customers

Stefanus HadiThe mobile web is increasingly becoming an important part of the overall strategy of acquiring Internet traffic for a web site. Recent studies by pingdom.com found that the mobile share of global Internet traffic is now over 13%.

In addition, a highly cited study by Walker Sands showed that over 23% of the total website visits in the US and Canada in December 2012 were coming from mobile devices. During the WebFest Conference in early February 2013, Oversee.net announced that an average of 18% of all traffic to its network properties in 2012 were from mobile devices. Tech watchers have predicted that mobile traffic could reach over 30% by the end of 2013.

To get some insight into how our customers perceive these new trends, DiscountASP.NET conducted a worldwide survey and asked questions regarding their mobile web traffic. We received 1,308 responses from around the world. Here we’ll limit the range of samples by looking at data from our U.S.-based and U.K.-based customers. We had 840 responses from the U.S and 102 responses from the U.K.

Mobile-web-traffic-USA-2012-2013We asked customers how much traffic to their web site came from mobile devices in 2012 and how much they project their mobile traffic will be in 2013. The U.S.-based customer survey results show that 37% of our customers believed that less than 10% of their web site traffic came from mobile devices in 2012.

But this sentiment drops significantly when we asked them to project their mobile traffic for 2013, as only 6% of our customers in the US believe that less than 10% of their web site traffic will come from mobile devices in 2013. Of all the US respondents, only 4% stated that over 30% of their web site traffic came from mobile devices in 2012, but their projection quadrupled to 16% in 2013.
Mobile-web-traffic-USA-UK-2012-2013When comparing the results of the same mobile traffic questions between the US and UK customers, 27% of the UK of customers believed that less than 10% of their web site traffic came from mobile devices in 2012. In terms of percentage, more UK-based customers project that over 30% of their web site traffic will come from mobile devices in 2013 than the US-based customers, 19% versus 16%, respectively.

It’s interesting to see these differences between regions as they are partly due to regional differences in the adoption of mobile technology. But for all web site owners, it is time to think about putting in place a mobile strategy. As usage of mobile devices grow year after year, more and more users will visit your site from mobile devices.

Code PaLOUsa, April 25th-27th

Calvin Wong

The software development madness known as Code PaLOUsa happens next week, April 25th-27th, in Louisville, KY! We are proud to be an esteemed sponsor for the event again this year.

This year’s event is headlined by Richard Campbell and Carl Franklin from .NET Rocks!, and backed by 83 sessions. Topics range from in-depth explorations of Microsoft, Java, Ruby, and other platforms, to high-altitude development sessions, to role-specific sessions for analysts, testers, managers, and more.

If you still haven’t gotten your ticket, we have one left to give away here! Get in free, save the $250 for the ponies!

WordPress under attack

Ray Penalosa

We have seen an influx of attacks against WordPress sites. The attack is an old method called brute force attack. The main targets are WordPress sites that still use the default administrative login “Admin.” With half of the credentials pretty much solved, the attacker repeatedly inputs a password until it finally finds the right one.

This lapse in security has been well known in the WordPress community. It has been asked by Tony Perez why WordPress themselves have not offered a stronger password restriction and require that the Admin login be changed; the response he and the WordPress community received was “it’s just not a relevant issue.”

The fix for this is fairly simple. First make sure you update the administrative credential from the default “Admin” user name to something more personal. Second step is to update the password to be more sophisticated. It is recommended that you have a minimum length of 8 characters, including letters, numbers, and special characters such as “#”, “$”, or “%”. Incorporating lower case and upper case characters in your password will also help strengthen it.

The exploit has had a substantial impact on web hosting companies like DiscountASP.NET. When a personal computer gets compromised, there is a limit in the bandwidth that computer may have, but with a web hosting company the bandwidth is almost unlimited. When a WordPress site is compromised, the hacker then uses that site to send out attacks on other servers and hosting companies.

With the nearly unlimited bandwidth at their disposal, the effects can be devastating. The owner of the account is affected as well. With high bandwidth consumption, they may be charged to pay extra for the bandwidth usage their WordPress site utilizes.

Another security measure that can be employed to mitigate this attack is to incorporating WordPress 2 step authentication.  This is an optional new feature you can enable for your WordPress site. It uses the Google Authentication App.

It is a second verification input on top of the password that obtains a random generated code from Google Authentication App. This verification code is updated every 30 seconds making it impossible to guess. You may want to read more on this new security feature on this WordPress link.

Make no mistake that WordPress themselves are taking this attack seriously, and the effects have been wide spread among many hosting companies.

If you want to find out more about this wide spread attack against WordPress sites, here are a couple of links that you might find helpful:

http://ma.tt/2013/04/passwords-and-brute-force/

http://www.bbc.co.uk/news/technology-22152296

Coincidentally this attack not only targets WordPress but Joomla web applications as well. I did not research any Joomla attacks, but if you have a Joomla site and you are using it’s default administrative login “Admin”, you may want to update the login name, and provide it a more complex password just in case.

Ottawa IT Camp 2013

Calvin WongWe are avid supporters of the development community and actively sponsor Code Camps, GiveCamps and developer conferences all across the country.

Sometimes even outside the country.

This May 4th brings the Ottawa IT Camp 2013. Speakers are coming from all parts of eastern Canada to the Algonquin College. If you want to attend, registration is open right up to the day of the event.

This year, the enthusiastic organizers have even made a Windows Phone app!

Can you keep a secret?

Michael PhillipsI know, it’s been quiet around these parts for a few weeks. It isn’t because we’ve suddenly lost interest in writing or ran out of things to talk about. That will never happen because we’re full of it. I mean, full of ideas!

It’s been a little slow on the blog front because a lot of us have been involved in preparing for a significant beta launch. “Oh yeah?” I hear you wondering, “Like what?

woman telling secretLike…like I can’t tell you yet.

How’s that for anticlimax?

What I can tell you is this new project has been more than a year in the making, and it’s going to make a lot of you very, very happy, because it will make your life easier. Your development life anyway. We can’t help with the messy real-world bits. Yet, anyway.

So stay tuned. The coming weeks and months are going to be interesting.