comment

Windows: Run a scheduled task hourly

2009 April 14
tags: Windows

Like Cron on Unix, Windows has a Task Scheduler but by default the wizard only lets you select the following intervals:

Daily
Weekly
Monthly
One time only
When my computer starts
When I log on

read more...

How to change the JVM for ColdFusion on JRun

2009 March 09
tags: Windows

I found myself needing to change the JVM on a Windows/JRun4/ColdFusion setup the other day. I knew how to do this in theory but hadn't given it a go before, here are the steps I took:

  1. Downloaded new JVM from sun (http://java.sun.com/products/archive/)
  2. Loaded new JVM on to server (D:\Java\latest\jre)
  3. Edited JRun jvm.config (D:\JRun4\bin\jvm.config)
  4. Change java.home from:
  5. java.home=D:/JRun4/jre to: java.home=D:\Java\latest\jre
  6. Restarted JRun

Now normally I would have expected that to be it but I found ColdFusion refused to launch and it was throwing an error saying it couldn't find msvcr71.dll. A quick search of the file system told me that msvcr71.dll lives under the orinal JVM so I just copied it from D:\JRun4\jre\bin to D:\Java\latest\jre\bin. Restarted JRun and ColdFusion started to work again.

Switch IIS from 64-bit to 32-bit mode

2009 February 27

To run JRun4 & ColdFusion (32-bit version) on a 64-bit Windows machine with IIS you will have to switch IIS to run in 32-bit mode because of the JRun connectors. Here is how you switch from 64-bit to mode to 32-bit mode and back again:

To switch IIS from running in 64-bit mode to 32-bit mode, execute the following command from C:\Inetpub\AdminScripts directory:

cscript.exe adsutil.vbs set W3SVC/AppPools/Enable32BitAppOnWin64 true

To switch IIS from running in 32-bit mode to 64-bit mode, execute the following command from C:\Inetpub\AdminScripts directory:

cscript.exe adsutil.vbs set W3SVC/AppPools/Enable32BitAppOnWin64 false

read more...

ec2: Linux Instance Setup

2009 February 26
tags: ec2 · Linux

Here's a quick guide to setting up a Linux instance on Amazon's ec2 compute colud (example instance ID's and IP's used). This is probably more for my own reference than anything but feel free to ask questions if you want more detail.

1. Find an image:

ec2-describe-images -o amazon

2. Start an instance:

ec2-run-instances ami-2b5fba42 -k keypair

3. Check the instance is running:

ec2-describe-instances

read more...

ec2: Windows Instance Setup

2009 February 26
No Comments
tags: ec2 · Windows

Here's a quick guide to setting up a Windows instance on Amazon's ec2 compute colud (example instance ID's and IP's used). This is probably more for my own reference than anything but feel free to ask questions if you want more detail.

1. Find an image:

ec2-describe-images -o amazon

2. Start an instance:

ec2-run-instances ami-40bf5829 -k keypair

3. Check the instance is running:

ec2-describe-instances

read more...

SQL: Changing table owner

2009 February 26
No Comments
tags: Databases

I needed to change a table owner in SQL so a quick google lead me to the sp_changeobjectowner stored procedure.

Taking a look at the the syntax and example I was still a little confused on how to use it.

sp_changeobjectowner [ @objname = ] 'object' , [ @newowner = ] 'owner'

sp_changeobjectowner 'authors', 'Corporate\GeorgeW'

After having a go I found the following syntax worked for me.

sp_changeobjectowner '[blogger].[blog_entries]' , 'dbo'

This will change the database owner of the blog_entries table from blogger to dbo.

read more...

MySQL: Transporting Databases

2008 October 09
No Comments
tags: Databases

Further to my post the other day about transporting Oracle tablespaces I meantioned that I use the mysql & mysqldump commands via the command line to transport mysql databases around. So here is how I do it:

  • Connect to your database server, open a command line and run the following commands.

Move a single database:

  1. Export:mysqldump -h localhost dbname -u username --password="password" -C >C:\dbname_date.sql
  2. Recreate blank database.
  3. Import:mysql -h localhost dbname -u username --password="password"

Move all databases:

  1. Export:mysqldump -h localhost --all-databases -u username --password="password" -C >C:\alldbs_date.sql
  2. Import:mysql -h localhost -u username --password="password"

Net8 protocol error

2008 October 08
No Comments

When working with ColdFusion I use Macromedia's JRun4 for managing my instances because it easily allows me to run multiple versions of ColdFusion. Anyhow I was setting up a site the other day on ColdFusion 7.0.2 (I mainly work with 8 now) and came across this error after removing a try catch.

Error Executing Database Query.
[Macromedia][Oracle JDBC Driver]Internal error: Net8 protocol error.

Not having seen this error before I had to do a bit of googling and was lead to this knowledge base article about upgrading the database drivers that ship with ColdFusion and sure enough after a quick upgrade I was away again. But I suppose the moral of this post is to double check which database versions work with which ColdFusion versions before starting as evidently ColdFusion 7.0.2 doesn't play nicely with Oracle 10g R2 out of the box.

Oracle: Transporting Tablespaces

2008 October 06
tags: Databases

I often have to move databases (or tablespaces in Oracles case) around between servers. There are lots of different ways to do this and in some cases I have to ask other people to do the initial export for me so with so many different tools out there I often find compatibility problems with exports as a particular tool has been used. In mysql I get around this by using the mysql & mysqldump commands via the command line and in Oracles case I use the imp (import) & exp (export) commands also via the command line. Here is the steps I would take to move an Oracle tablespace:

 

read more...

Enable SSH Password Authentication

2008 October 01
No Comments
tags: Linux · Networking

I have a test instance on Amazon's elastic compute cloud (ec2) and I usually connect to this using a SSH keypair but I added a few more users in and tried to connect without using the keypair and I expected it to just ask me for a password but instead I got.

Permission denied (publickey,gssapi-with-mic).

Now I know password authentication isn't as secure but didn't really feel like setting up more keypair's and its only a test instance. So after a bit of digging these are the steps you need to enable password authenication via SSH (keypair's still work).

read more...