More success converting from CommunityServer to vBulletin

Back in July, I wrote about my initial experiences converting from CommunityServer to vBulletin. At the time of that post, I was importing users, forums, and threads, but had issues importing posts. Well, I’m happy to say I’ve had more success since then.

Together with the help of Jerry (a member of the vBulletin team), we’ve improved the import scripts a number of ways. Prior to this effort, you were only able to import users, forums, threads, and posts. Now…

  • Performance has been improved by rewriting some SQL queries, and in some cases optimizing them for SQL 2005. (SQL 2000 compliant queries are available, but commented out in the code.)
  • Private messages are imported, however they are not threaded (by design; vBulletin doesn’t thread private messages).
  • Forum groups are imported as top-level forums, so your CommunityServer group/forum structure is preserved.
  • SQL scripts are available to clean up post formatting differences between CS and vB.
  • Not a fix, but an important note: If you have lots of posts, you definitely need to increase your timeout periods in your php.ini. I set mine to 600 seconds before things started working reliably importing posts.

Continue reading

Lutz Roeder’s .Net Reflector is now Red Gate’s .Net Reflector

I needed to download Lutz Roeder’s .Net Reflector on a new machine, so I did a Google search, and saw this as the first item listed:

.NET Reflector

A CLR class browser with XML documentation viewer, type search, disassembler and C#/VB view.

Clicking on the link, I was taken to http://www.red-gate.com/products/reflector/ and read this:

Red Gate has recently acquired .NET Reflector. We will continue to maintain a free version for the benefit of the community. For more information on the deal, please see the interview on Simple-Talk.

Well how about that.

Building with NAnt (and NUnit, and NCover, and NCoverExplorer)

A while back, I wrote a blog post, A quick introduction to Nant, which gave, well, a quick introduction to building C# libraries using NAnt.

Since then, I’ve been using NAnt to do a lot more — notably, to run unit tests and to report on test coverage (using NCover and NCoverExplorer). The usage is pretty straightforward, and I think you’ll see how each step builds on the previous step.

  • To run a default build (excluding unit tests): nant
  • To build all projects and unit tests (but don’t run : nant build-tests
  • To build all projects and unit tests, and run tests using NUnit: nant test
  • To build all projects and unit tests, and run tests using NCover to generate coverage reports: nant cover
  • To build all projects and unit tests, run tests using NCover to generate coverage reports, and open those reports in NCoverExplorer: nant coverex

The sample below is my NAnt build file. A few notes first.

  • There are only two projects referenced: Project1 and Project1.Tests. Repeat the appropriate sections to build against additional projects.
  • nunit-console.exe is expected to be in the system path.
  • nunit-console.exe, ncover.console.exe, and ncoverexplorer.exe are expected to be in the system path. I recommend you download and install TestDriven.Net to have all of these in a convenient place.

Now, on to the build file. It should be self-explanatory, but I added some XML comments for your convenience.

Continue reading

Verizon: Pricing based on who you talk to

I recently ordered Verizion FIOS TV. Since I already have home phone and Internet service from Verizon, and wireless service from Verzion, I wanted to make sure I am getting a bundled rate. (They offer a bunch of “bundle prices”.) I went into an online chat with a Verizon customer representative. Here’s what happened.

Continue reading

Identifying ASP pages vulnerable to SQL injection attacks using Microsoft’s Source Code Analyzer

Back in July 2008, Microsoft released the Source Code Analyzer for SQL Injection, a “static code analysis tool for finding SQL Injection vulnerabilities in ASP code.” With the large number of SQL injection attacks occurring recently, running this tool against your ASP-based web sites is important. (It’s not the only thing you should do, but it’s at least one thing you should do!)

The tool itself is composed of two command-line tools:

  • msscasi_asp.exe, which reviews an ASP file and outputs an XML file with vulnerability warnings.
  • msscasi_view.cmd, a script which opens the generated XML file for viewing in a web application window.

One limitation is that you can’t run these utilities on more than one file — but you can run each of the utilities on every ASP file on your computer by running a batch file.

Continue reading

Remove anonymous users from ASP.Net Membership tables

If you use the ASP.Net membership tools, have <anonymousIdentification enabled="true" /> specified in your Web.config, and get lots of anonymous visitors, it’s only a matter of time before your database grows. What’s filling it up is the countless user records for your anonymous users.

If you don’t need to track user and profile information for an anonymous user once they leave the site, you can delete the unneeded data by running a SQL script. The following script will delete from your membership tables all anonymous users whose last activity was more than 7 days ago.

delete from aspnet_profile
where userid in ( select userid from aspnet_users
where isanonymous = 1
and datediff(dd, lastactivitydate, getdate()) &gt; 7
)

delete from aspnet_usersinroles
where userid in ( select userid from aspnet_users
where isanonymous = 1
and datediff(dd, lastactivitydate, getdate()) &gt; 7
)

delete from aspnet_membership
where userid in ( select userid from aspnet_users
where isanonymous = 1
and datediff(dd, lastactivitydate, getdate()) &gt; 7
)

delete from aspnet_personalizationperuser
where userid in ( select userid from aspnet_users
where isanonymous = 1
and datediff(dd, lastactivitydate, getdate()) &gt; 7
)

delete from aspnet_users
where userid in ( select userid from aspnet_users
where isanonymous = 1
and datediff(dd, lastactivitydate, getdate()) &gt; 7
)

Doing this may be very important to those using a shared hosting plan that has limited SQL disk space, as those anonymous users can quickly eat up disk space. Since each row in aspnet_users takes up just over 1kb, having 1,000 anonymous users will eat up 1MB — something that adds up quick if you only have 250MB of SQL disk storage.

Deleting all tables and constraints in a database

We all need to do it from time to time — erase a bunch of tables in a SQL database. Sure, you can do this through Enterprise Manager, one table at a time, or write a bunch of DROP TABLE statements, but when doing it this way, you also need to ensure all foreign key constraints (i.e. table dependencies) are dropped first.

There’s an easier way — the following script, which was derived from a few posts scattered around the Internet. (Sorry, it’s been a while, and I don’t remember what they were!)

Continue reading

Downloading Age of Conan without the DVDs (good for buddy keys)

[I’m not sure if this is widely known, but I just figured it out and figured I’d share it here.]

Funcom recently activated the buddy program for their MMO, Age of Conan, allowing active subscribers to give a friend a game key which permits 7 days of play time. However, Funcom’s solution to giving your buddy the client software isn’t as smooth.

We recommend that you lend your install DVDs to your buddy to get him or her ready to play as fast as possible. Alternatively your buddy will be offered a $2,99/€2,99 client download with 3 additional days of playtime to cover the download time.

The install media Age of Conan (of which ComputerSims developed a fansite for, AOChub) is two 6GB DVDs. Sure, you can send your buddy your DVDs… or burn ISOs of them and let him download all 12+GB of them… Or you can do this:

  1. Send your buddy a copy of ConanPatcher.exe and LocalConfig.xml.
  2. Have your buddy create a folder on his hard drive, c:\Program Files\Funcom\Age of Conan, and put the two files you sent him in there.
  3. Tell him to run ConanPatcher.exe.

This will initiate the client download and, presumably, avoid the need to pass around DVDs.