Google Voice Call Widget POST commands

Google made their Google Voice call widget flash only. There are alot of instances where you want to be able initiate a call from non-flash.

I hope this helps with integration to other projects.

The POST URLs are:
https://clients4.google.com/voice/embed/webButtonConnect
https://clients4.google.com/voice/embed/cancelWebButtonCall

webButtonConnect expects the following parameters.
showCallerNumber (Google’s Widget send the number 1)
callerNumber (The 10 digit number with no spaces or dashes)
buttonId (the id value from your flash call widget)
name (The name of the caller)

cancelWebButtonCall expects the following parameters.
buttonId (the id value from your flash call widget)
callerNumber (the number of the call you want to cancel)

Post Returns:
ok=false (Error)
ok=true (Call Placed)

Here is a quick and dirty HTML form to make a call.

PHP hide download link

This is php code that I use to hide the download link to files.

$filename = strrev($downloads[$id]);
$filename = explode("/", $filename);

# Remote file size
$ary_header = get_headers($downloads[$id], 1);     
$filesize = $ary_header['Content-Length'];
$type = $ary_header['Content-Type'];

header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header('Content-type: '.$type);
header('Content-Disposition: attachment; filename="'.strrev($filename[0]).'"');
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".$filesize);
readfile($downloads[$id]);

Enabling DHCP Option 119 on 2003 Server

DHCP option 119 is the option to send out DHCP domain search list to clients, it is documented in RFC 3397.

It is only supported in Macintosh, Windows XP and older does not support it and as far as I know neither does Vista. You must use GPO for Windows.

In your Windows DHCP server do the following

  1. Go to “Set Predefined Options”
  2. Click Add
  3. Name: Domain Search List
  4. Data Type : Byte, Check Array
  5. Code: 119

To create your byte array go to http://www.string-functions.com/string-hex.aspx and type in your domain. We will use apple.com as our example.

We are returned get back this: 6170706c652e636f6d

To enter them in to DNS we have to add 0x in front of each pair. Which gives us 0x61 0x70 0x70 0x6c 0x65 0x2e 0x63 0x6f 0x6d (A)

Add up all the groups which is 9 in our example and convert that to hex which is 0x9 (B).

Now, in Windows DHCP you have to enter value one at a time into DNS. When you enter your first value MS adds a 0x0 which you have to remove first.

Then add all the values from (A) first the (B) and you are all set.

vbscript logon script

Our old logon script from 2002

'****************************************************************
'* Logon Script 2k      *
'* This should be the end to multiple logon scripts *
'* This will be the logon script for all labs.  *
'* ps. Nothing is a cure all.    *
'* Its written in vbscript http://msdn.microsoft.com *
'*        *
'* Stephen@2k2     *
'* Edited by:      *
'*  Robert *  
'*      and                                         *
'*  Mike *
'****************************************************************

'Date Modified Feb 6, 2002
On error resume next
Dim WshNetwork, WshSHell, Return, Desktop, HKCU
Set WshNetwork = WScript.CreateObject("WScript.Network")
Set WshShell = WScript.CreateObject("Wscript.Shell")
Desktop=WshShell.SpecialFolders("Desktop")
username=left(WshNetwork.Computername,3)
dim number

'Novell Drive Mappings.
call winmap("l:","\\Thurston_w\vol1","lab")

'return=WshShell.run ("subst p: /d", 0, true) 
'return=WshShell.run("subst p: c:\temp", 0, true)

'Citrix Applications
call shortcut("CITRIX APPS","%userprofile%\application data\icaclient\CITRIX APPS.lnk","C:\Program Files\Internet Explorer\")

'Just put your commands for what lab ur in.
Select Case username
Case "PUB"
 Wshnetwork.addwindowsprinterconnection("\\ginger\pub4000")
 Wshnetwork.setdefaultprinter("\\ginger\pub4000")
 If right(WSHNetwork.Computername,2) <> 30 Then
  Wshnetwork.addwindowsprinterconnection("\\ginger\puboki8")
 End if
 call winmap("n:","\\ginger\shared","lab")
 Call shortcut("Paint Shop Pro","L:\XPAPPS\Paint Shop Pro\Psp.exe","L:\XPAPPS\Paint Shop Pro")
Case "MHK"
 Wshnetwork.addwindowsprinterconnection("\\ginger\mhk5m")
 wshnetwork.setdefaultprinter("\\ginger\mhk5m")
 call winmap("n:","\\ginger\shared","lab")
Case "NUR"
 Wshnetwork.addwindowsprinterconnection("\\ginger\nur4000")
 wshnetwork.setdefaultprinter("\\ginger\nur4000")
 call winmap("n:","\\ginger\shared","lab")
 call shortcut("Inventor","C:\Program Files\Autodesk\Inventor 5.3\Bin\Inventor.exe","C:\Program Files\Autodesk\Inventor 5.3\Bin")
Case "BPM"
 Wshnetwork.addwindowsprinterconnection("\\ginger\bpm4000")
 wshnetwork.setdefaultprinter("\\ginger\bpm4000")
 If right(WSHNetwork.Computername,2) < number =" right(WshNetwork.Computername,2)" number = "03"> 32 Then
  Wshnetwork.addwindowsprinterconnection("\\ginger\don4000")
 End if
Case "LRN"
 Wshnetwork.addwindowsprinterconnection("\\ginger\lrn4000")
 Wshnetwork.setdefaultprinter("\\ginger\lrn4000")
 call winmap("n:","\\ginger\shared","lab") 
 call shortcut("EVE 2","C:\Program Files\EVE2\eve2.exe","C:\Program Files\EVE2")
 call shortcut("SPSS11","C:\Program Files\SPSS\spsswin.exe","C:\Program Files\SPSS")
Case "DON"
 Wshnetwork.addwindowsprinterconnection("\\ginger\don4000")
 Wshnetwork.setdefaultprinter("\\ginger\don4000")
 If right(WSHNetwork.Computername,2) <> 25 Then
  Wshnetwork.addwindowsprinterconnection("\\ginger\dtp4M")
  Wshsetdefaultprinter("\\ginger\dtp4M")
 End if 
 call winmap("n:","\\ginger\shared",username)
 call shortcut("Quark Xpress","L:\XPAPPS\QuarkXPress\QuarkXPress Passport.exe","L:\XPAPPS\QuarkXPress\QuarkXPress Passport.exe")
 call shortcut("SHARED","N:\SHARE2147\","N:\SHARE2147\")
 call shortcut("PAGEMAKER","C:\Program Files\Adobe\PageMaker 7.0\Pm70.exe","C:\Program Files\Adobe\PageMaker 7.0")
 call shortcut("PHOTOSHOP","C:\Program Files\Adobe\Photoshop 7.0\Photoshop.exe","C:\Program Files\Adobe\Photoshop 7.0")
 call shortcut("SPSS11","C:\Program Files\SPSS\spsswin.exe","C:\Program Files\SPSS") 
 Call shortcut("Paint Shop Pro","L:\XPAPPS\Paint Shop Pro\Psp.exe","L:\XPAPPS\Paint Shop Pro")
 call shortcut("EVE","%userprofile%\application data\icaclient\EVE2.lnk","c:\program files\citrix\ica client\")
Case "CAD"
 Wshnetwork.addwindowsprinterconnection("\\ginger\cad4000")
 wshnetwork.setdefaultprinter("\\ginger\cad4000")
 Wshnetwork.addwindowsprinterconnection("\\ginger\cad700")
 
 If right(WSHNetwork.Computername,2) > 6 Then
  Call shortcut("DB UNLOCK","C:\Program Files\Manufacturers Technologies\Costimator\DbUnlock.exe","C:\Program Files\Manufacturers Technologies\Costimator\")
  Call shortcut("COSTIMATOR","C:\Program Files\Manufacturers Technologies\Costimator\MTIMain.exe","C:\Program Files\Manufacturers Technologies\Costimator\")
 End if
 call winmap("n:","\\ginger\shared","lab")
 Call shortcut("POM","C:\program files\POMwin32\pom32start.exe","C:\program files\POMwin32\pom32start.exe")
 Call shortcut("Solidworks","C:\program files\solidworks\sldworks.exe","C:\program files\solidworks\")
Case "PHY"
 Wshnetwork.addwindowsprinterconnection("\\ginger\phy4000")
 wshnetwork.setdefaultprinter("\\ginger\phy4000")
 'G: Drive for the Genetics program
 call winmap("g:","\\island\dfs\vol1\xpapps\genetics","lab")
 'genetics software needs diff to run diff is called karyo.exe
 call shortcut("Karyotypes","L:\XPAPPS\GENETICSa\karyopw.exe","L:\XPAPPS\GENETICSa")
 call shortcut("Sky","C:\Program Files\Software Bisque\TheSky\SKY.exe","C:\Program Files\Software Bisque\TheSky")
 call shortcut("Genetics","L:\XPAPPS\GENETICS\Genetics\Start Genetics.exe","L:\XPAPPS\GENETICS\genetics")
 call winmap("n:","\\ginger\shared","lab")
 call shortcut("SHARED","N:\SHARE2107\","N:\SHARE2107\")
Case Else
End Select
'************************************************************************************************************
'*                                             FUNCTIONS          *
'************************************************************************************************************
Function unmap(drv)
  Dim fso
  Set fso = CreateObject("Scripting.FileSystemObject")
  If fso.DriveExists(drv) Then WshNetwork.removeNetworkDrive drv & ":"
End Function

Function winmap(drive,dest,user)
unmap(drive)
Wshnetwork.mapnetworkdrive drive, dest, false, user, ""
End Function

Function shortcut(name,dest,working)
Set shelllink = wshshell.createshortcut(desktop & "\" & name &".lnk")
shelllink.targetpath= dest
shelllink.workingdirectory= working
shelllink.windowstyle = 1
shelllink.save
End Function

F-Prot Antivirus Update

This is a old script i wrote back in 2002 to automatically update F-Prot antivirus in a lab environment.

'OBSOLETE they finally have a update program.
'Here for example



'****************************************************************
'* Command Com Autoupdate 2k2 Script   *
'*        *
'*        *
'* Its written in vbscript http://msdn.microsoft.com *
'*        *
'* Stephen Cattaneo @2k2     *
'* Edited by:      *
'*        *
'****************************************************************
On error resume next
'Over all notes
'Remeber to give full register rights to the bellow registry keys,
'In the policy allow to run Windows installer patches w/ elevated permissions
Dim WshShell, date, currdate, latestdate
Set WshShell = WScript.CreateObject("WScript.Shell")


'Set to name of current deff file.
update="\latest.msp"

'Location of update directory
location="\\island\dfs\antivirus"

'Get version info
deffversion()

'Set update location
WshShell.RegWrite "HKCR\Installer\Products\C02C1A9B2ADAA1C47BD127BE4F886559\SourceList\LastUsedSource", "n;1;" & location, "REG_EXPAND_SZ"
WshShell.RegWrite "HKCR\Installer\Products\C02C1A9B2ADAA1C47BD127BE4F886559\SourceList\Net\1", location, "REG_EXPAND_SZ"

if currdate < latestdate then wshshell.run(location & update & " /q")

Function deffversion()
   Dim fso, c, n
   Set fso = CreateObject("Scripting.FileSystemObject")
   Set c = fso.GetFile("C:\Program Files\Common Files\Command Software Shared\Scanner\sign.def")
   Set n = fso.GetFile(location & update)   
   currdate = c.DateLastModified   
   latestdate = n.DateLastModified   
End Function

Imail orphan cleaner in Perl

This perl script will compare your active directory and your imail directory. Any accounts that do not exist in AD will be moved to your orphan directory and their registry settings will be exported and deleted.

Active Directory Computer Accounts

I found this utility oldcmp on the internet that makes it easier to find old computer accounts in active directory.

You have to be careful with this utility so you do not accidentally delete computer accounts that are being used.

Another note, in my testing Macintosh computers do not update their computer password as frequently as PCs do.

Microsoft Product Key Recovery.

We lost our product key for ISA 2006, so after some internet browsing i found the script below. Just point it to the DigitalProductID value in your registry for the Microsoft product that you need the installation key for.

Original Link

Rem lookup digital product id from registry
Set WshShell = WScript.CreateObject("WScript.Shell")
HexBuf = WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DigitalProductId")
For l = lBound(HexBuf) to uBound(HexBuf)
tmp=tmp & " "& Hex (HexBuf(l))
next

WshShell.Popup  "Found Digital Product Id in registry:-" &  _
"                                                                                                                    " &  _
"                                                                                                                    " &  _
"                                                                                                                    " & tmp
StartOffset = 52
EndOffset =67
Dim Digits (24)

Digits (0) = "B" : Digits (1) = "C": Digits (2) = "D": Digits (3) = "F":
Digits (4) = "G": Digits (5) = "H": Digits (6) = "J": Digits (7) = "K":
Digits (8) = "M": Digits (9) = "P": Digits (10) = "Q": Digits (11) = "R":
Digits (12) = "T": Digits (13) = "V": Digits (14) = "W": Digits (15) = "X":
Digits (16) = "Y": Digits (17) = "2": Digits (18) = "3": Digits (19) = "4":
Digits (20) = "6" : Digits (21) = "7" : Digits (22) = "8": Digits (23) = "9"

dLen = 29
sLen = 15
Dim HexDigitalPID (15)
Dim Des (30)
For i = StartOffset to EndOffset
HexDigitalPID (i-StartOffset) = HexBuf(i)
tmp2=tmp2 & " "& Hex (HexDigitalPID(i-StartOffset))
next
WshShell.Popup  "Found Digital Product Id in registry:-" &  _
"                                                                                                                    " &  _
"                                                                                                                    " &  _
"                                                                                                                    " & tmp & _
"                                                                                                                  " & _
"                                                                                                                  " & _
"                                                                                                                  " & _
"                                        " & _
"Located the sequence in the digital product ID. Can you see it in the one above (Tip:- 2nd line, 8 in from the left) :- " & _
"                                                                                                                  " &  _
"                                                                                                                  " & tmp2
KEYSTRING =""
for i=dLen-1 to 0 step -1
if ((i + 1) mod 6) = 0 then
Des (i) = "-"
KEYSTRING =KEYSTRING & "-"
else
HN = 0
   For N = (sLen -1) to 0 step -1
     Value = ( (HN *2^8 ) Or HexDigitalPID (N))
      HexDigitalPID (N) = Value \ 24
      HN    = (Value mod 24)

   next

Des(i) = Digits(HN)
KEYSTRING =KEYSTRING & Digits(HN)
end if
next
KEYSTRING2 = StrReverse (KEYSTRING)
WScript.Echo "Having finished messing about performing mathmatical stuff" & _
" on your Product ID i have come to the conclusion your XP Key is:- " & _
"                                         " & KEYSTRING2