Saturday, 21 November 2009

Friday, 20 November 2009

AJAX Wait Image Generator

I had been searching for an AJAX wait graphic. This site offers a simple tool for generator wait graphics in a number of different styles and any colour: http://www.ajaxload.info/

Friday, 13 November 2009

T-SQL month name from month index

How to display a month name from an input of a month index (i.e. 1-12).

The script below will return the month name for a given month index.

DECLARE @MonthID int

SET @MonthID = 5

SELECT DateName(month, convert(datetime, '2009-' + cast(@MonthID as varchar) + '-01', 120))

@MonthID could be any integer I have only declared a new variable here for completeness.

Wednesday, 11 November 2009

SQL Server Set Identity Seed

DBCC CHECKIDENT (table_name, RESEED, new_reseed_value)

E.g.
DBCC CHECKIDENT (Customers, RESEED, 2000)

From Microsoft: Checks the current identity value for the specified table and, if it is needed, changes the identity value. You can also use DBCC CHECKIDENT to manually set a new current identity value for the identity column.

Full article: http://technet.microsoft.com/en-us/library/ms176057.aspx

IIS Change the key length for an SSL renewal

*** IIS 6 ***

When applying for an SSL certificate renewal and the old certificate uses a 512 bit key length you may receive the following error: "The CSR you submitted has a 512 bit key size. We do not allow SSL Web Server certificate issued with a CSR less than 1024 bits."

There is no way within IIS to change the key length but the workaround is as follows:

1. Create a new website under IIS. Make sure the website is stopped.
2. Edit the new site.
3. Select the "Directory Security" tab.
4. Click "Server Certificate"
5. Click "Next"
6. Select "Create a new certificate"
7. Click "Next"
8. Select "Prepare the request now, but send it later".
9. Click "Next"
10. Enter a name for the new request and select a bit length of 1024.
11. Click "Next".
12. Enter the organisation name and organisational unit for the website you are attempting to renew.
13. Click "Next".
14. Enter the exact domain name for the website you are attempting to renew.
15. Click "Next".
16. Enter the business country, state and city.
17. Click "Next".
18. Select a save location for the CSR.
19. Complete the wizard.
20. Submit the new CSR with your renewal request - this should be accepted.
21. When you receive the new certificate complete the renewal on the temporary site created in step 1.
22. Edit the main site that requires the renewed certificate.
23. Select the "Directory Security" tab.
24. Click "Server Certificate"
25. Click "Next".
26. Select "Replace the current certificate".
27. Click "Next".
28. Select the new certificate completed in step 21.
29. Click "Next" and complete the wizard.
30. Click "OK".
31. Delete the temporary site created in step 1.

Tuesday, 10 November 2009

Serving FLV video files from an MS server

When serving .flv files off of a Windows Server 2003 (or any other Windows server I would imagine) requires setting up the MIME type on the server first (it isn't one of the native MIME types on MS servers).

1) Select the site to configure in IIS, right click and select "Properties"
2) Under the "HTTP Headers" Tab, click "MIME Types" under the MIME types section
3) Click "New."
4) Type ".flv" as the associated extension and "video/x-flv" as the content type.
5) Click "OK"
6) Click "OK"

Thursday, 5 November 2009

CF tag to force page charset character set

If you need to force a ColdFusion page to return a specific character set use the following tag:

<cfcontent type="text/html; charset=iso-8859-1">

and substitute the type attribute accordingly.