Remote Shutdown of a PC

November 19th, 2005

I got into a bit of a problem with a server that was being a bit of a pain and after googling for a while discovered that you can issue a command using the command line to the remote machine like this:

shutdown /r /m \\remoteComputer \f \c “The reason why”

/f forces the shutdown and may not be necessary

/r restarts the remote machine

/m means it is expecting a machine 

/c comment

note the name of the remote computer is preceded by \\ e.g. \\193.168.1.123

Useful site with Win 2003 tips

http://www.computerperformance.co.uk/index.htm

Image Manipulation

September 18th, 2005

Several months ago a requirement to use manipulate images came up and we did a hunt around for a suitable library to use with ColdFusion.  We ended up choosing the Alagad Image Component however since then I have become aware of 2 additional approaches which both seem to be very good.

1. http://efflare.com/products/cfx_imagecr/ CFX_ImageCR is a professional quality custom tag for processing images natively and very efficiently in ColdFusion.  Now I know this is a CFX but it seems to have some very good qualities and is particularly good for doing many of the common image manipulation tasks. CFX_ImageCR loads an image file and saves another after performing the operations it has been directed to. Operations include converting, resizing, cropping, resampling and much more.

2.  The second approach I have discovered is to work directly with the Java image library (which the Alagad Image component wraps into a CFC.  Obviously this will be more work. But less cost.

Whilst these other two approaches are not the opne we have chosen and we are happy with the Alagad solution, I wanted to post about them in case someone else is out there looking into this.

The Alagad Image Component is a 100% native ColdFusion Component (CFC) used to create and manipulate image files. Written entirely in ColdFusion CFML, the Image Component does not require installation of any additional software. The Image Component is not a CFX tag and is not Platform dependant.

Because the Image Component is written in pure ColdFusion and instantiates only native Java objects, it compiles with the rest of your CFML files to Java bytecode and performs much better than competing products.

I have recently been updating my knowledge of creating PDF’s from web pages using ColdFusion.  I have discovered 2 useful techniques for doing this.

1. Using a pre-defined ColdFusion tag called DynamicPDF from http://gilgamesh-solutions.com/products.cfm#p1.  We have done some scalability testing on this and it seems to do a very good job.  Under the hood it is using HTMLDoc http://www.easysw.com/htmldoc/ and seems to do a good job.

2. Using iText http://www.lowagie.com/iText/tutorial/.  This is the technology that Macromedia use in CFMX7.  Not looked into that yet, but the quality of PDF’s produced by CFMX7 is very good.

Note 31-May-08: Since the release of ColdFusion 8 PDF manipulation is embedded in CF.  Well I mean Adobe owns both so just as it should be.

MS-SQL Blinder

August 24th, 2005

As part of my nightly reading on all things interesting I stumbled across a mind-blowingly useful MS-SQL identity trick to get the value of the last inserted primary key.  How many times will you use this in your code?

Using Identity Keys in SQL Server

Most applications rely on primary keys in database tables. Many of those same applications use the auto-increment capabilities of some DBMSes like MSSQL Server. When inserting a record in a table that uses auto-increment primary keys, you do not have to insert the value of the primary key yourself - the DB does it for you. But what if you want to know the value of the row’s primary key that you just inserted? Commonly, developers will run two queries in a row, wrapped in <cftransaction>. The first one inserts the record and the second one selects the newest record. But using this syntax, SQL server can insert the record as well as return the value of the new primary key all in one query.

<cfquery name="insert" datasource="DSN">
   set nocount on
   insert into customer (firstName, lastName)
   values
   ('#attributes.firstName#', '#attributes.LastName#')
   select @@identity as newID
   set nocount off
</cfquery>

I am the new primary key value:
<cfoutput>#insert.newID#</cfoutput>
source: http://developer.fusium.com/code/

Clustering ColdFusion 6.1

August 23rd, 2005

As anyone will know who has tried clustering CFMX 6.1 is a painstaking process.  I have stumbled across this useful blog that Steve Erat has written.

http://www.talkingtree.com/blog/index.cfm?mode=entry&entry=25A98D33-45A6-2844-7E780B5AEBD8C085

JVM and IIS Monitoring

August 20th, 2005

VisualGC

http://java.sun.com/performance/jvmstat/visualgc.html#bugs

The visualgc tool attaches to an instrumented HotSpot JVM and collects and graphically displays garbage collection that is going on in the JavaVirtual Machine.

IISState

IISState is a free utility to help users with their IIS installations. The product is not supported by Microsoft and the only method of feedback regarding IISState should be done through the Microsoft IIS Newgroup at (news://microsoft.public.inetserver.iis).

Where to get it:

http://www.iisfaq.com/admin/Portal/LinkClick.aspx?mid=2817&Link=2513

Good articles:

IIS Debugging

IISFaq - firstclass article on IIS troubleshooting with IISState