Latest Publications

BBC iPlayer launches Wii channel

iPlayer Wii Channel

iPlayer Wii Channel

Well it finally happened. It was hinted at long ago when the Beeb first made the iPlayer available for the Wii via its internet browser, but now it seems that there will be a dedicated channel on the Wii.

I’m glad that it finally came along. After the recent Internet Channel update, the iPlayer hasn’t been working. Seeing as there is a supposed Flash upgrade in the update, it seemed daft that it would be disabled.

Hopefully the new channel will stream the video more smoothly. It’s been over a year in the making…

Read more at BBC iPlayer launches Wii channel.

Remove Network Printers from Users Before they Log On

Dos Batch FileI had a little trouble with an HP Printer driver that was causing the Vista PCs to hang at logon.

Without going into the specifics of the problem (which comes down to poor HP drivers), I needed a way to ensure that the driver wouldn’t be active the next time that a user logged onto a computer.

A bit of quick thinking, and I quickly knocked up this command, that will enumerate all users in a folder and make the appropriate change while they are offline. Hurrah!

for /D %D in (\\domain.local\users\*.*) DO (
  reg load HKU\UserLoad %D\profile.V2\ntuser.dat
  reg delete "HKU\UserLoad\Printers\Connections\,,domainsrv1,Suite Mono Printer" /f
  reg delete "HKU\UserLoad\Printers\Connections\,,domainsrv1,Suite Colour Printer" /f
  reg unload HKU\UserLoad
)

This assumes that all of your users live in \\domain.local\users and that you are cleaning up vista profiles. Needless to say, you’d probably want to adjust this if you need to do something similar.

Install a Ranger Package Without Ranger

Following on from my remove ranger script, here is a VBScript that will automatically install Ranger packages without the need for the Ranger software on the network.

It’s a little rough around the edges but it gets the job done. At the moment, it doesn’t report any failures if a file cannot be copied etc.

Copy and paste the text into Notepad, and save the file as ranger_installer.vbs. Now just drag a package folder onto the script to install.

ranger_installer.vbs

'Ranger Package Installer
'Copyright (c) http://ccgi.maxpower.plus.com
'This will install a Ranger software package onto a machine.
'This script is not provided with any warranty implied or otherwise - use at your own risk!

On Error Resume Next
Dim strConn, conn, rs

Const ForReading = 1, ForWriting = 2, ForAppending = 8

Const rWindir = ""
Const rWinSysDir = ""
Const rRangerDir = ""
Const rProfileDir = ""
Const rAllUsersDir = ""
Const rTempDir = ""
Const rSysDrive = ""

if  Wscript.Arguments.Count > 0 Then

	'Fire up FileSystemObject
	Set objFSO = CreateObject("Scripting.FileSystemObject")

	'Fire up the scripting shell - we're running some progs
	Set objShell = CreateObject("WScript.Shell")

 'Enumerate the passed in file names
	For i = 0 to wscript.arguments.count - 1
		'Get file
		If objFSO.FileExists(strArgs) Then
			strArgs = WScript.Arguments(i)
			Set objFile = objFSO.GetFile(strArgs)
		ElseIf objFSO.FileExists(WScript.Arguments(i) & "\filediff.txt") Then
			strArgs = WScript.Arguments(i) & "\filediff.txt"
			Set objFile = objFSO.GetFile(strArgs)
		Else
			MsgBox ("This isn't a valid package file or folder. Can't carry on.")
			WScript.quit
		End If

		'wscript.echo objFile.path
		'Get parent folder and file names
		installFolder = objFSO.GetParentFolderName(objFile)
		installFile = objFSO.GetFileName(objFile)
		'wscript.echo installFolder
		'wscript.echo installFile
		objFile.Close

		'Now get the substitutions
		Set objConfigFile = objFSO.OpenTextFile(installFolder & "\Info.ini")
		'wscript.echo objConfigFile.path
		Do Until objConfigFile.AtEndOfStream
			strInfo = objConfigFile.ReadLine

			if Left(strInfo, Len("")) = "" Then strWindir = Mid(strInfo,InStr(strInfo,"=")+1)
			if Left(strInfo, Len("")) = "" Then strWinSysDir = Mid(strInfo,InStr(strInfo,"=")+1)
			if Left(strInfo, Len("")) = "" Then strRangerDir = Mid(strInfo,InStr(strInfo,"=")+1)
			if Left(strInfo, Len("")) = "" Then strProfileDir = Mid(strInfo,InStr(strInfo,"=")+1)
			if Left(strInfo, Len("")) = "" Then strAllUsersDir = Mid(strInfo,InStr(strInfo,"=")+1)
			if Left(strInfo, Len("")) = "" Then strTempDir = Mid(strInfo,InStr(strInfo,"=")+1)
			if Left(strInfo, Len("")) = "" Then strSysDrive = Mid(strInfo,InStr(strInfo,"=")+1) 

		Loop

		Set objFile = objFSO.OpenTextFile(strArgs)

		Do Until objFile.AtEndOfStream

			strCommand = objFile.ReadLine
			arrCommand = Split(strCommand,"|")

			'Now run the various functions

			'Replace the string with the actual path
			strTargetPath = strReplacer(arrCommand(1))
			strSourcePath = strSourceRep(arrCommand(1))

			if arrCommand(0) = "+f" or arrCommand(0) = "+fc" Then
				'Copy file
				'wscript.echo "Copy " & installFolder & "\CopyRoot" & "\" & strSourcePath & " to"
				'wscript.echo strTargetPath
				GenPath (strTargetPath)
				if objFSO.FileExists(installFolder & "\CopyRoot" & "\" & strSourcePath) Then
					objFSO.CopyFile installFolder & "\CopyRoot" & "\" & strSourcePath, strTargetPath, true
				End If

			ElseIf arrCommand(0) = "-f" Then
				'Delete File
				'wscript.echo "Delete " & strTargetPath
				if objFSO.FileExists(strTargetPath) Then
					objFSO.DeleteFile strTargetPath,true
				End If

			ElseIf arrCommand(0) = "+d" Then
				'Create Directory
				'wscript.echo "Create folder: " & strTargetPath
				If Not objFSO.FolderExists(strTargetPath) Then
					GenPath (strTargetPath)
				End If

			ElseIf arrCommand(0) = "-d" Then
				'Delete Directory

				If objFSO.FolderExists(strTargetPath) Then
					objFSO.DeleteFolder strTargetPath,true
				End If
				'wscript.echo "Delete folder: " & strTargetPath
			End If

		Loop

		'Now we can make the registry changes

		'Let's enumerate the install folder and get the registry files
		Set objFolder = objFSO.GetFolder(installFolder)
		Set colFiles = objFolder.Files

		'We'll fire up a new reg file for good measure... We're going to combine all of the registry tweaks in one
		strRegFile = installFolder & "\installreg.reg"
		'wscript.echo "Creating new .REG file... " & strRegFile
		Set objRegFile = objFSO.CreateTextFile(strRegFile, True, True)

		'Write RegEditor info
		objRegFile.WriteLine("Windows Registry Editor Version 5.00")

		'wscript.echo "Searching for .rrg files in " & installFolder
		For Each objFile in colFiles
			'Find .rrg files and put the content into our new reg file
			if lcase(objFSO.GetExtensionName(objFile)) = "rrg" Then
				Set newRegFile = objFSO.OpenTextFile(objFile.Path, ForReading)
				Do While newRegFile.AtEndOfStream <> True
					objRegFile.WriteLine(newRegFile.ReadLine)
				Loop
				newRegFile.close
			End If
		Next

		objRegFile.close

		'Now import the regstry file
		'wscript.echo "reg import " & chr(34) & installFolder & "\installreg.reg" & chr(34)
		objShell.Exec("reg import " & chr(34) & installFolder & "\installreg.reg" & chr(34))

		'Now delete the registry file
		objFSO.DeleteFile installFolder & "\installreg.reg",true

		msgbox("Package installation complete")
	Next

Else
	msgbox("You must select a file to install. Drag either a filediff.txt file or the package folder onto the script to install.")
End If

Function strReplacer (strLine)

	strLine = Replace(strLine,rWinDir,strWinDir)
	strLine = Replace(strLine,rWinSysDir,strWinSysDir)
	strLine = Replace(strLine,rRangerDir,strRangerDir)
	strLine = Replace(strLine,rProfileDir,strProfileDir)
	strLine = Replace(strLine,rAllUsersDir,strAllUsersDir)
	strLine = Replace(strLine,rTempDir,strTempDir)
	strLine = Replace(strLine,rSysDrive,strSysDrive)
	strReplacer = strLine 

End Function

Function strSourceRep (strLine)

	strLine = Replace(strLine,rWinDir,"C\WINDOWS")
	strLine = Replace(strLine,rWinSysDir,"C\WINDOWS\SYSTEM32")
	strLine = Replace(strLine,rRangerDir,strRangerDir)
	strLine = Replace(strLine,rProfileDir,strProfileDir)
	strLine = Replace(strLine,rAllUsersDir,strAllUsersDir)
	strLine = Replace(strLine,rTempDir,strTempDir)
	strLine = Replace(strLine,rSysDrive,strSysDrive)

	strSourceRep = Replace(strLine,":","")	

End Function

Function GenPath (rFolderPath)

	'Gets the parent folder of a non-existant path and calls Generate Path to create the tree.
	arrPath = Split(rFolderPath,"\")
	rFolderPath = ""
	for iindex = 0 to ubound(arrPath) - 1
		rFolderPath = rFolderPath & arrPath(iindex) & "\"
	Next

	GeneratePath(left(rFolderPath,len(rFolderPath)-1))

End Function

Function GeneratePath(pFolderPath)
	'Recursive function to create a folder path
	'wscript.echo "Creating " & pFolderPath
	GeneratePath = False
	If Not objFSO.FolderExists(pFolderPath) Then
		If GeneratePath(objFSO.GetParentFolderName(pFolderPath)) Then
			GeneratePath = True
			Call objFSO.CreateFolder(pFolderPath)
		End If
	Else
		GeneratePath = True
	End If
End Function

Uninstall Ranger from a Computer without the RangerRemove User

Dos Batch FileSometimes it might be necessary to remove Sentinel’s Ranger software from a computer with the minimum of fuss. Even though there is a removal user account. For instance, this may not work.

So here’s a handy script to automitcally disable Ranger on a workstation. This returns some Windows settings back to normal and backs up the Ranger computer info. Just save the code as DeRanger.cmd and run it on any machine that you want to uninstall Ranger.

If you’re having trouble logging into a workstation, either logon as a local administrator or use the Task Manager to stop rgrUIniut.exe in the Processes tab.

DeRanger.cmd


@echo off

::Stop ranger services
Net Stop ClntCMan
Net Stop SecMon
Net Stop RMNETMON
Net Stop RMNetworkMonitorService

::Remove ranger from winlogon and reset Windows Shell
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v UserInit /t REG_SZ /f /d C:\WINDOWS\system32\userinit.exe
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v Shell /t REG_SZ /f /d Explorer.exe

::Disable ranger services
reg add "HKLM\SYSTEM\CurrentControlSet\Services\ClntCMan" /v Start /t REG_DWORD /f /d 4
reg add "HKLM\SYSTEM\CurrentControlSet\Services\SecMon" /v Start /t REG_DWORD /f /d 4
reg add "HKLM\SYSTEM\CurrentControlSet\Services\RMNETMON" /v Start /t REG_DWORD /f /d 4
reg add "HKLM\SYSTEM\CurrentControlSet\Services\RMNetworkMonitorService" /v Start /t REG_DWORD /f /d 4

::Rename Ranger Registry
reg copy "HKLM\SOFTWARE\Hyperion Security Software" "HKLM\SOFTWARE\Hyperion Security Software_backup" /s /f
reg delete "HKLM\SOFTWARE\Hyperion Security Software" /f

::Rename Rnager Installation Folder
rename "%programfiles%\Ranger" Ranger_

::Now restart
shutdown -f -r -t 0

Mount a Webdav folder in Ubuntu Linux

Webdav is a very handy protocol for writing files back and forth across the internet.

I’ve never really had much call for it – but I’m all for it lately as I’m trying out Alfresco and would really love to see a better way to upload files than the basic web-bsaed uploader that is provided.

As Firefox doesn’t had webdav support, I’ve had a go at mounting webdav folders in Linux. The results have been good, with a couple of small caveats that are remedied fairly easily.

First of all, you need to install the davfs2 package. Once done, we can start connecting to a webdav folder on t’internet:

Open up the terminal and create the mount folder:

mkdir ~/webmount

Now run the mount.davfs command to connect as root

sudo mount.davfs http://yourwebsite.com/webdav ~/webmount -o rw,uid=john

Now, let me quickly explain the paramters.
yourwebsite.com/webdav is the server and path
~/webdav is your local directory where you want to webdav files to appear
-o rw,uid=john is the options to set the webdav as re-writable and allow me (john) to have user-level access to the files. Make sure that you put your own username here.

And that’s it.

When you copy files, you might get an error such as this:

cp myfile.pdf ~/webmount/

cp: cannot create regular file `~/myfile.pdf': Input/output error

This is caused by the server not supporting file locks. You will need to edit the /etc/davfs2/davfs2.conf file and add the following line:

use_locks       0

Remount your webdav directory, and you should be able to create files with no problems.

Caduceus

It’s driven me mad for a long time, but I finally stumbled across the name of the medical profession insignia today.

Cadeceus emblem

Cadeceus emblem

It’s something that I needed to know a while back, and you see it in hospitals and on ambulances. it seems to be an internationally recognised symbol.

It’s no really that important – but I’m making sure it’s here so I don’t forget! Based upon a Greek myth, it’s a short herald staff with two serpents intwined upon it. There’s an entry over at Wikipedia (naturally).

Caduceus.