Backup from JM Wiki

Joe is opening Excel files in separate windows thanks to Thomas C Sherman

Haiku about mini smarties:

orangey tasting

tiny sugar coated sweets

questioning packet

Joe is asleep face down on the floor until lap 60 of the hungarian grand prix – carpet rash

Joe is watching the longest canadian Grand Prix ever – Go Jenson

Joe is meditating – Don’t beat the puppy

Joe is watching the World Snooker Chamionship Final – Higgins is close but will he be Trumped?

Joe is waiting for Debian packages to become available for – as soon as it happens, NoMachine (i.e. non-free) can be removed.

Joe is using NoMachine’s NX Free Edition as an RDP Infrastructure.

Joe is realising how good the Windows Remote Desktop infrastructure is – try replicating it on linux using tightvnc!

Joe is installing a Moin wiki on the intranet

Joe is distributing a LogMeInRescue image

Joe is Accessing data on xen lvm guest (domU) image

Joe is wearing in his Michelin Pilot Road 3s – gripping

The Ockham’s Razor Principle of Content Management Systems – Given two functionally equivalent content management systems, the simplest one should be selected.

Joe is reading about UX for D7

Joe is designing an iPhone applots to think about

Joe is counting down to

Joe is drooling over Fabian Cancellara’s Saxo Bank Specialized S-Works TTR prototype, May 9, 2009

Joe is baking Lemon Meringue Pie – sour

Joe is watching Severance – is that a tooth?

Joe is making Delia’s pancakes – flipping great!

Joe is watching The BBC’s best news programme – GMT with Zenab Badawi

Joe found a pleasing Article about IPv6 enabled home network with OpenBSD

Joe found a pleasing presentation on ipv6 with OpenBSD

Joe found a pleasing Vim cookbook

Joe is now connected to the IPv6 internet using a SixXS Tunnel – it only took ten years!

Joe is cooking fillet steak with a pepper sauce and homemade chips followed by a cheeky chocolate ganash

Joe is watching Seven Days To Noon – don’t you see that what you are suggesting would end in the certain destruction of all mankind?

Joe is reading Flatland: A Romance of Many Dimensions by Edwin A Abbot

Joe is reading A Journey to the Interior of the Earth by Jules Verne – saving this one for another day

Joe is reading Abandoned by Jules Verne

Joe is removing DOS line endings from a text filie in VIM using :1,$s/{Ctrl+V}{Ctrl+M}//{Enter} 

Joe is BSD IPCing Basic BSD IPC and BSD Introductory IPC Tutorial

Joe has conquered a fear of Cisco Hardware using IAPP and some mild spoofing….

Joe is Generating raw IP packets on OpenBSD

Joe is uninstalling scapy from OpenBSD

Joe is Installing scapy on OpenBSD

Joe is inventing an Arduino project – check these out

Joe is attempting to Triple Boot on a Macbook Pro – its like wading through sand using only your teeth for grip

Joe is Using tarfile to compress files with python

Joe is editing text with JEdit

Joe is outraged at HP 5590 Scanner Drivers for OSX consume 100% CPU

Joe is sniffing with Kismet

Joe is imbibing Bucktrouts online

Joe is inhaling Coppa Nocialata in Lake Garda

Joe is watching Ill Met by Moonlight – “bloody motorcyclists – they’re all alike”

Joe is investigating Python robotics at – machin vision

Joe is Image processing with c++ – very similar to signal processing sound…

Joe is analysing gearing with a Gearing Calculator

Joe found a Ghost House

Joe is making a Twix

Joe is watching Stage 20 of

Joe is making Bread

Joe is watching Dragnet – Just the facts

Joe is watching Le Tour De France on Eurosport

Joe is on a Vermicompost trip

Joe is Lighting


Random Links…

Joe is Applying bar tape

Joe is contemplating a Fixie

Joe is impressed by the Apache Software Foundation’s Security breach report and interpretation

Joe is complying with The Rules

Joe is amazed by the skillz of Chris Akrigg

Joe is calculating the benefits of a 29er – mmm gyroscopic

Joe is riding a Cannondale CAAD9 – in BBQ Black

Joe is Comparing road bikes – Lapierre Sensium 400 vs Specialised Tarmac Expert SL 2010

Joe is wondering why Fudges Cycle Store do not allow VAT free sales to the Channel Islands!

Joe is engrossed in Downloadable content for Sharepoint Server 2007

Joe is contemplating Moving a MOSS Farm

Joe is needing an IGT Brake Lever for FZ1

Joe is threatening to Contact the Queen

Joe is preparing for the future of the web

Joe is imagining A day at the office, Yamaha USA.

Joe is fully respecting Indie Man.

Joe is saving up for a Dyson AM01 Bladeless Fan.

Joe is using Apples list of “well known” TCP ports to debug the firewall.

Joe is finding ipconfig getpacket en0 very useful for debugging dhcp on OSX

Joe is Growing more yeast – mmm fermentee.

Joe is Listening to BBC 6 Music – kinda like the John Peel show, but all day every day.

Joe is Baking – Rise my pretty!

Joe is watching In the Loop – Malcolm Tucker is a legend.

Joe has snapped a bolt on his cannondale – new gear lever time.

Joe is configuring up a PcEngines Alix 2D13 – 500MHz of raw computing power.

Joe is configuring up a Netgear DM111Pv2 – highly recommended.

Joe is dicing with Death Wish 3 – it used to be Charlie’s.

Joe is amused that it seems impossible to fly The Guernsey Flag – upside down.

Joe is installing vSphere Client 4.0 – wtf it requires Microsoft Visual J# ?!

Joe is back on the Yeast Cultivation Trail – mmm frementee

Joe is battling with Drupal got error 28 from storage engine query – fixed thanks to Hosting Matters

Joe is playing with portaudio – to get his Polar CS200 working on OSX

Joe is tracking sports – using Sports Tracker

Joe is well into Extreme Bokashi – mmm fermentee

Joe is watching Olympic Ski Cross – best winter olympic sport IMHO

Joe is trying to understand curling – what are those people brushing?

Joe is finished compiling a Universal Image for PianoBooster on Mac OSX – it took a while!

Joe is trying to play some Lilypond rendered music from The Mutopia Project – ambitious?

Joe is compiling the latest version of Piano Booster and Simple Synth – for Mac OSX 10.6 – Success! pianobooster-0.6.4-mac-osx-10.6.dmg

Joe is Taking a piano sheet music break – with Garageband

Joe is dreaming of an Arata Ti Full System – but will probably get one of Dale’s instead.

Joe is wanting this Crazy Fazer – woo

Joe is needing to remove the Fazer’s air induction system – why is it there in the first place?

Joe is listening to an Akropovic Full system for Fazer – Power enhancing

Joe is timing intervals

Joe is eating a Fry’s Turkish Delight – Full of Eastern Promise

Joe is inoculating an interest in Mycelium and homegrown mushrooms – mmm tasty.

Joe is bathing in the awesomeness of 3:10 To Yuma

Joe is Working out with Zuzana – vigorously.

Joe is enjoying this video of a rocket mass heater in a greenhouse much more than the bowls.

Joe is watching the final of the World Indoor Bowls Championship – if you can’t enjoy this, you can’t enjoy anything

Joe is awaiting the start of ISO 8601 Week 4

Joe is considering saving for a Polar CS200CAD Wireless HRM with Cadence but will probably just buy one.

Joe is reminiscing about a crazy english summer with Zoe Johnston‘s vocals.

He is good at his job and he enjoys it – that is what makes him dangerous. The Triple Cross

Joe is tripping over Drupal – Nodes, CCK, Views, Panels.

Joe is installing FCKeditor Using WYSIWYG API on his drupal.

Joe is wondering if his HP 4710s will play nicely with debian.

Joe is reading a cycling physics blog before bed.

Joe is reading the rec.bicycles FAQ before posting to newsnet.

Joe is replacing the headset of his Cannondale.

Joe is but 12hrs away from paint stripping his Marin Nail Trail frame.

Joe is pleased that kiddofspeed rides to Chernobyl – so he does not have to.

Joe is thinking about just one bottle of Tokyo from BrewDog

Joe is contemplating RFC2324 The HTCPCP Protocol

Joe is making his list and checking it twice.

Joe is Cycling for Fitness with Chris Carmichel – Good Job!

Joe is licking and sticking Co-Op stamps.

Joe is watching War Games – The only winning move is not to play.

Joe is playing Monopoly City Streets – In Firefox under Wine on Debian.

Joe is awaiting Gran Turismo 5 – Pre order it from Amazon.

Microsoft SQL Server

Microsoft Sql Server

Database name with hyphens

Sharepoint likes to use hyphens in database names, much to the displeasure of Sql Server.

Instead of use mydb-abdc-1234-asdf-0987; do use [mydb-abdc-1234-asdf-0987];

Procedure expects parameter ‘@parameters’ of type ‘ntext/nchar/nvarchar’

The sp_executesql Stored Procedure takes nvarchars as its parameters so…

If you are doing this:

EXEC sp_executesql @SQL, '@MyParamOut INT OUTPUT', @MyParamOut=@Foo

Do this instead:

EXEC sp_executesql @SQL, N'@MyParamOut INT OUTPUT', @MyParamOut=@Foo


For read only queries who favour speed over accuracy, try using these options to speed your query.



There is a good article at

What Version of SQL Server am I running?

When you need to know if you’re on workgroup / standard / enterprise edition? See KB321185.

SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition')

What user is SQL Server running as?

Swiped from

Listing 1: The sp_get_sqlserver_service_account Stored Procedure
USE master

IF (object_id(‘[dbo].[sp_get_sqlserver_service_account]’) IS NOT NULL AND
objectproperty(object_id(‘[dbo].[sp_get_sqlserver_service_account]’), N’IsProcedure’) =
DROP PROC [dbo].[sp_get_sqlserver_service_account]

CREATE PROC [dbo].[sp_get_sqlserver_service_account]

— =============================================
— Variables
— =============================================
DECLARE @rc int,
@machinename nvarchar(128),
@instancename nvarchar(128),
@profile nvarchar(128),
@regkey nvarchar(256),
@accnt nvarchar(128)

IF NOT ((charindex(N’7.00′, @@version, 0) > 0) OR (charindex(N’8.00′, @@version, 0) >
RAISERROR(N’sp_get_sqlserver_service_account only support SQL Server 7.0 and 2000′, 16, 1)
WITH log, nowait

IF (charindex(N’7.00′, @@version, 0) > 0)
SELECT @instancename = NULL

IF (charindex(N’8.00′, @@version, 0) > 0)
SELECT @machinename = CONVERT(nvarchar(128), serverproperty(‘MachineName’)),
@instancename = CONVERT(nvarchar(128),

— =============================================
— Check if not running SQL Server as LocalSystem
— @rc 0 = LocalSystem, 1 = running under account
— =============================================
EXEC @rc = master.dbo.xp_MSLocalSystem @machinename, @instancename
IF (@rc = 0)
PRINT ‘SQL Server is running under the LocalSystem account’

— =============================================
— Get account name running SQL Server
— =============================================
IF (@instancename IS NULL)
SELECT @regkey = N’SYSTEM\CurrentControlSet\Services\MSSQLServer’
SELECT @regkey = N’SYSTEM\CurrentControlSet\Services\MSSQL$’ + @instancename

EXEC master.dbo.xp_regread N’HKEY_LOCAL_MACHINE’,
@accnt OUTPUT,

PRINT ‘SQL Server is running under account ‘ + @accnt

EXEC sp_get_sqlserver_service_account

Backup and Restore topics

Backup database to a UNC Path


And be careful when using FORMAT !!

USE t_foo
TO DISK = '\\server\share$\backups\t_foo.bak'
NAME = 'Full Backup of t_foo'

Error 5 when backing up database to UNC Path

It doesn’t matter who *you* are logged in as, it is the service account for SQL Server service that matters.

Grant the SQL Server Service account write permission to your folder.

Restore Database (Simple)

Find out the logical names from your .bak file:

FROM DISK='c:\backups\mydb_backup_20090101.bak'

Restore the database:

-- Put it in single user mode --

— Restore (moving to different filenames if necessary —
— this allows you to restore a backup of database A —
— on top of database B) —
USE master;
FROM DISK = ‘c:\backups\mydb_backup_20090101.bak’
WITH MOVE ‘mydb_data_logicalname’ TO ‘c:\data\mydb.mdf’,
MOVE ‘mydb_log_logicalname’ TO ‘c:\data\mydb.ldf’

— Put it in multi user mode —

Single User Mode

— Put it in single user mode —

Multiple User Mode

— Put it in multiple user mode —

Transaction log usage

How big do my transaction logs need to be? Why not check how much space they are using?


Shrink the SQL Transaction Log for the Funk Database

N.B. Sets the recovery model to ‘simple’ to truncate the existing log before shrinking the file. You should set the recovery model back to your chosen model at the end of the script.

USE funk_db;


DBCC SHRINKFILE( funk_db_log, 1024 );


Overview of recovery models for your databases

What recovery model do all my databases use?

SELECT name, log_reuse_wait_desc FROM sys.databases;

Kill all connections to specified database

USE master

DECLARE @dbname sysname

SET @dbname = ‘name of database you want to drop connections from’

DECLARE @spid int
SELECT @spid = min(spid) from master.dbo.sysprocesses where dbid = db_id(@dbname)
EXECUTE (‘KILL ‘ + @spid)
SELECT @spid = min(spid) from master.dbo.sysprocesses where dbid = db_id(@dbname) AND spid > @spid