Install self cert SSL in Dev environments

13 January, 2011

Recently I needed to get SSL up and running on some internal development and test environments. We know as the cert hasn’t come from a trusted source the client will recieve certificate errors  – not a problem internally.

Reading round the web the tool to use is SSLDiag (which also has a 64 bit version).

Get it here:

http://www.microsoft.com/downloads/en/details.aspx?familyid=cabea1d0-5a10-41bc-83d4-06c814265282&displaylang=en

Here’s my notes on running the app to get the cert in the dev environment.

You’ll need to get the ID of the website from IIS, the default site has an ID of ’1′ but other sites usually have a 9 character ID.

Consider using a VBS script or similar to enumerate your websites and get the ID,  such as the VBS here: http://blogs.msdn.com/b/david.wang/archive/2006/06/08/howto-enumerate-iis-website-and-ftpsite-configuration-vbscript-using-adsi.aspx

Here’s the command line arguements:

C:\Program Files\IIS Resources\SSLDiag>ssldiag /selfssl /N:CN={SITEURL} /V:{DAYSTILLEXPIRE} /S:{IISSITEID}

I.E.

C:\Program Files\IIS Resources\SSLDiag>ssldiag /selfssl /N:CN=dev.mysite.co.uk /V:3650 /S:777555888

–After this is ran you need to add the IP and SSL port.
1. Open iis manager
2. Open properties for website
3. Click ‘Advanced’ at then of IP address dropdown
4. Add IP and 443 to the bottom half of the dialog

HTTP Module Events

13 January, 2011

There’s a fair number of events you can listen for in a .NET HTTP Module. I forget most of them and certainly their order – here’s a reminder.

These events are listed in sequential order:

  • BeginRequest: Request has been started. If you need to do something at the beginning of a request (for example, display advertisement banners at the top of each page), synchronize this event.
  • AuthenticateRequest: If you want to plug in your own custom authentication scheme (for example, look up a user against a database to validate the password), build a module that synchronizes this event and authenticates the user how you want to.
  • AuthorizeRequest: This event is used internally to implement authorization mechanisms (for example, to store your access control lists (ACLs) in a database rather than in the file system). Although you can override this event, there are not many good reasons to do so.
  • ResolveRequestCache: This event determines if a page can be served from the Output cache. If you want to write your own caching module (for example, build a file-based cache rather than a memory cache), synchronize this event to determine whether to serve the page from the cache.
  • AcquireRequestState: Session state is retrieved from the state store. If you want to build your own state management module, synchronize this event to grab the Session state from your state store.
  • PreRequestHandlerExecute: This event occurs before the HTTP handler is executed.
  • PostRequestHandlerExecute: This event occurs after the HTTP handler is executed.
  • ReleaseRequestState: Session state is stored back in the state store. If you are building a custom session state module, you must store your state back in your state store.
  • UpdateRequestCache: This event writes output back to the Output cache. If you are building a custom cache module, you write the output back to your cache.
  • EndRequest: Request has been completed. You may want to build a debugging module that gathers information throughout the request and then writes the information to the page.

Perform find replace in SQL update staement

4 January, 2011

I had an interesting problem today where I needed to update strings in a database table field based on a certain criteria.

A bad character had gotten into the URL field in the rhpRef table. The SQL updates and string that matches ‘warehouse-’ with ‘warehouse’. Ive added the where clause just to ensure only the correct rows are updated.

Here’s the code for future reference:

UPDATE rhpRef
SET    url = replace(url, 'warehouse-', 'warehouse')
WHERE  url LIKE '%warehouse-%';

Hope it might help someone else.

Setting RDP session timeout auto logoff

25 October, 2010

When sharing a dev server there is always someone who ‘disconnects’ rather than logging off or leaves their RDP session connected and idle.

You can set timeouts for these situations to auto logoff the user. I dont do it very often so thought I’d leave a reminder here….

1. Start at Administrative Tools in Control Panel

2. Select Terminal Services Configuration

3. Right click RDP-Tcp and select Properties

4.  Select the Sessions tab and set the disconnect and idle as required

HTH

Readonly textbox not adding values to viewsate

9 February, 2010

If TextBox’s ReadOnly property is “true”, postback data won’t be loaded e.g it essentially means TextBox being readonly from server-side standpoint (client-side changes will be ignored).

If you want TB to be readonly in the “old manner” use TextBox1.Attributes.Add(“readonly”,”readonly”) as that won’t affect server-side functionality.

Thanks to Joteke for the help

Exceptioneer – ASP.NET, Windows Forms and JavaScript Exception and Error Handling

15 May, 2009

Exceptioneer is a hosted system designed for .NET folks to help identify, manage and resolve unhandled exceptions. When an Exception occurs within an Application, that exception and a range of platform specific details are transmitted securely to the Exceptioneer web portal where the data is analysed and for you to handle in your own way.

We’ve implemented support for: -

If you’d like a free account, fill in this form and we’ll send you an invitation

Some of you will have heard of ELMAH, which is a cool open source project for collecting Exceptions, you can read how the two compare on the Exceptioneer and ELMAH page.

 

Check out our blog:

http://blog.exceptioneer.com

 

Check our our twitter account:

http://twitter.com/exceptioneer

 

Check out what other people are saying:

http://blog.sceniceye.co.uk/2009/05/exceptioneer-wow-much-nicer-than.html

http://search.twitter.com/search?q=exceptioneer

 

If you want Exception Handling for another platform such as Rails checkout this page: -

http://exceptioneer.com/Public/OtherPlatforms.aspx

Creative juices….

16 June, 2008

Good laugh…

 

What happened to the canoe trailer?

16 June, 2008

Well for all avid canoe trailer fans the trailer has been finished and has been on its first holiday :-) Here’s a couple of pics…

 

P1010161

 

P1010197

Frequency expansion for VX-2E

21 May, 2008

Cutting taken from web article:

This is how expand RX and TX range of Yaesu VX2E.

New range: TX: 120 to 220 MHz, and 300 to 500 MHz.
RX: 0,5-137, 137-174, 174-420, 420-470, 470-800, 805-999 MHz.

Remove the battery, and remove the adhesive under the battery.

Now you can see 8 jumpers.

Short only the JP2 and JP3. All other open. Replace the battery, then reset the radio by pressing simultaneously F, HM/RV and (88) (this strange button).. and power-on the radio.
If this procedure fail, shut down the radio, then try to reset again by pressing simultaneously BAND,H/L and V/M, then power-on again.

NOTE if you short also the JP4, with the same procedure as above, the new range you obtain is the following:

TX: 140-174 MHz, and 420-470 MHz;
RX: same as above.

I performed the first expansion, work well.

Enums dont implement IEnumerable

9 May, 2008

 

I know it’s obvious, but you must admit it’s still a little funny :-)

 

Enum


Follow

Get every new post delivered to your Inbox.