Kevsters Blog

My little part of the Internet

Page 5 of 7

Sun Virtual Box – Cloning machines

I’m a big fan of Sun’s Virtual Box – its cross platform (I run it on Windows 7 X64,OS X and Ubuntu), FREE and works 🙂
Cloning machines is pretty the same as all OS’s, with one slight twist…..
1) Copy the VDI file you want to clone/backup.
2) This file won’t boot because it has the same UUID as the first file you copied, so need to use VBoxManage utility to give it a new random UUID.
3) Open command prompt, and change to your Vbox directory with VBoxMange.exe in it. Probably located at C:Program FilesSunxVM VirtualBox
4) Run this command in command prompt
VBoxManage internalcommands setvdiuuid “D:My Virtual MachinesVDIHardDiskName.vdi”
Obviously you would change the above path to point to your NEW VDI file that you created (not the original).

Cisco CUCM UCCX Queue Status Web Service

Heres a snip of somthing I wrote as an ‘add on’ the the free, Open Source SourceForge IPCC Wallboard package.
This uses code from the IPCC Wallboard package to access UCCX’s Historical database, and allows for queue information to be displayed on a Cisco IP Phone.
The formattings nasty as the IP Phone does not operate as a standard browser so theres lots of spaces and stuff to get things positioned right.
Ill post some information about how to get it working as a service in CUCM later…

<%On Error Resume Next
//**************************************************************************************//
//   Service:      Phone Wallboard Display                            //
//   AUTHOR:      Kevin Iddles, Yawns.com Limited                        //
//   PURPOSE:     Display UCCX Queue information on IP Phone - Exposed as a service    //
//   VERSION:     1.1                                    //
//**************************************************************************************//
//**************************************************************************************//
//   History:
//        1.1 - Updated to parse query strings from CUCM to allow for spaces
//        1.0 - Updated for use on customer sites including layout
//              0.1 - Based on original version from Cisco Netpro
//**************************************************************************************//
%>
<!--#include file="parameters.asp"-->
<%
Response.AddHeader "Refresh", RefreshTime
//********************************START SQL MODULE**************************************//
//**************************************************************************************//
//   Module:      SQL Database Connector                                                    //
//   AUTHOR:      Jeremy Fielder, Leo Mourits                                                //
//   PURPOSE:     Performs Database Connections and retrieves relavent recordSets.        //
//**************************************************************************************//
If IPCCversion = 3 Then
 WBConnect = "Provider=SQLOLEDB; Data Source = " & DBsource & "; Initial Catalog = " & DBdatabase & "; User Id = " & DBuserID & "; Password = " & DBpass
ElseIf IPCCversion = 4 Then
 WBConnect = "Provider=SQLOLEDB; Data Source = " & DBsource & "CRSSQL; Initial Catalog = db_cra; Integrated Security=SSPI;"
End If
Set cn = Server.CreateObject("ADODB.Connection")
 cn.open WBConnect
needor = "0"
If Request.QueryString("csqa") = "" Then
 sqlcsqa = ""
Else
 tmpcsqa = Request.QueryString("csqa")
 tmpcsqa = Replace(tmpcsqa, "%20", " ")
 sqlcsqa = " (CSQName Like '%" & tmpcsqa & "%')"
 needor = "1"
End if
If Request.QueryString("csqb") = "" Then
 sqlcsqb = ""
Else
 If needor = "0" Then
 tmpcsqb = Request.QueryString("csqb")
 tmpcsqb = Replace(tmpcsqb, "%20", " ")
 sqlcsqb = " (CSQName Like '%" & tmpcsqb & "%')"
 needor = "1"
 Else
 tmpcsqb = Request.QueryString("csqb")
 tmpcsqb = Replace(tmpcsqb, "%20", " ")
 sqlcsqb = " OR (CSQName Like '%" & tmpcsqb & "%')"
 End if
End if
If Request.QueryString("csqc") = "" Then
 sqlcsqc = ""
Else
 If needor = "0" Then
 tmpcsqc = Request.QueryString("csqc")
 tmpcsqc = Replace(tmpcsqc, "%20", " ")
 sqlcsqc = " (CSQName Like '%" & tmpcsqc & "%')"
 needor = "1"
 Else
 tmpcsqc = Request.QueryString("csqc")
 tmpcsqc = Replace(tmpcsqc, "%20", " ")
 sqlcsqc = " OR (CSQName Like '%" & tmpcsqc & "%')"
 End if
End if
If Request.QueryString("csqd") = "" Then
 sqlcsqd = ""
Else
 If needor = "0" Then
 tmpcsqd = Request.QueryString("csqd")
 tmpcsqd = Replace(tmpcsqd, "%20", " ")
 sqlcsqd = " (CSQName Like '%" & tmpcsqd & "%')"
 needor = "1"
 Else
 tmpcsqd = Request.QueryString("csqd")
 tmpcsqd = Replace(tmpcsqd, "%20", " ")
 sqlcsqd = " OR (CSQName Like '%" & tmpcsqd & "%')"
 End if
End if
If sqlcsqa = "" and sqlcsqb = "" and sqlcsqc = "" and sqlcsqd = "" Then
 sqlcsqa = " callsWaiting > '0'"
End if
sqlGetCSQstats = "SELECT CSQName, availableAgents, callsWaiting, convOldestContact FROM RtCSQsSummary WHERE " & sqlcsqa & sqlcsqb & sqlcsqc & sqlcsqd & " ORDER BY CSQName"
Set rs = server.createobject("adodb.recordset")
Set cm = Server.CreateObject("ADODB.Command")
 cm.ActiveConnection = cn
 cm.commandtext = sqlGetCSQstats
Set rs = cm.execute
Response.Write deptName %>
|   Queue            |AA|CW| L Wait |
-------------------------------------------------
<% While not rs.eof %>|
<%= rs("CSQName") %> | <%= rs("availableAgents") %>  | <%= rs("callsWaiting") %>  |<%= rs("convOldestContact")%><%
 rs.moveNext
 wEnd
 rs.close
%>

Change of Platform

Having run this blog and others on Community Server for quite a while not,  I decided it was time for a change.
As this sites only used for blogs (no media, forums etc) there did not seem much point in continuing running the site on CS.  In addition, for some reason they have decided to remove support for running multiple ‘virtual’ CS sites within the same database.  Also I have issues with the stability, updates etc.  Hence moving this to WordPress.
Lets see how it goes……

Windows 7 – How to add ‘difficult’ applications to the tray

Windows 7 rocks as they say.  Been running it for a long while now and makes Vista seem as bad a shell as XP these days.
The Beta, then RC and now the RTM code is very, very solid.  Amazingly fast and a dream to use.   Owning a Mac as well, there are some compelling reasons why I still think its the premier desktop OS.
One annoyance though is being able to ‘pin’ applications to the tray.  Depite all your efforts, some will not do it.  Instead follow this procedure how to do it.  Its a frig, but one that works !
http://www.unawave.de/windows-7-tipps/folder-to-taskbar.html?lang=EN 

ASP.Net and SharePoint

Its taken me long enough but finally had a reason to write some true ASP.Net code.  One problem I hit was that trying to run code on a server that is running SharePoint Services …. so you need this exceprt….
 You may see this error:

An error occurred during the processing of /test.aspx. Code blocks are not allowed in this file.

Reason:  SharePoint does not allow server side code to execute in aspx pages contained in the SharePoint site.
Fix:  Edit the web.config (I.E. C:InetpubwwwrootwssVirtualDirectories80web.config) file:

<PageParserPaths>
        <!– To allow a single file: –>
        <PageParserPath VirtualPath=”/test.aspx” CompilationMode=”Always” AllowServerSideScript=”true” />
        <!– To allow global: –>
        <PageParserPath VirtualPath=”/*” CompilationMode=”Always” AllowServerSideScript=”true” />
        <!– To allow global within a subsite: –>
        <PageParserPath VirtualPath=”/websitefoobar/*” CompilationMode=”Always” AllowServerSideScript=”true” />
</PageParserPaths>

Gadget or Useful Mobile tool

Picked up on this from one of the MS UK teams blog http://blogs.technet.com/eileen_brown/archive/2007/10/09/communicator-mobile-2007.aspx
Essentially a 3D barcode and app software for mobile devices with cameras. 
Heres the barcode generator http://reader.kaywa.com/ and mobile device reader code http://www.quickmark.com.tw/En/basic/download.asp
Not sure of uses but like the idea of ‘tagging’ objects – posters, ad’s, screens etc

Quick and dirty Virtual Machine re-sid’ing

For a test environment its handy to have pre-build OS’s (especially on Windows) to run a new one up quickly.  For those who dont need support or havnt got the time to spend getting Sysprep to work properly try this script below in conjuction with the SysInternals NEWSID application.

  1. Copy NewSID.exe to c:
  2. Copy the script source below to c:NewSid.cmdstart /wait c:newsid.exe
    del “c:documents and settingsall usersstart menuprogramsstartupnewsid.lnk” /q
    del c:newsid.exe /q
    shutdown /r /t 10 /f /c “SID Change” /d 2:4 /m \HOSTSERVERNAME
    Note: Change the \HOSTSERVERNAME to reflect the servers current hostname
  3. Add a shortcut to c:documents and settingsall usersstart menuprogramsstartup called NewSID that links to c:newsid.cmd
  4. Clear the eventlogs etc and shutdown
  5. Clone the disks

When the machine first boots and you logon, NewSID will run and ask you if you want a new machine name etc.  Dont reboot at the end otherwise the util will keep running
I know its nasty but its quick. dorty and works 🙂

« Older posts Newer posts »

© 2024 Kevsters Blog

Theme by Anders NorénUp ↑