Friday, August 25, 2006

FYI - Vista Build 5536 / Pre-RC1 for x86 has been released - updated

I was looking at connect.microsoft.com for a x64 version of 5472 for my Acer (Knowing that RC1 is just around the corner, but I had some time to play while upgrading an Exchange cluster), but I just noticed that 5536 (RC1) is available for download (So far only for x86, I guess I will wait for the x64 version before proceeding with my Acer). UPDATE - No x64 edition of 5536 will be released according to connect.microsoft.com.

I have been using 5472 as my primary OS since it was released and I guess with RC1 that I will make the shift from dualboot to "single-boot" on my primary laptop (Dell Latitude D820) - with an XP installed on a Virtual PC / Virtual Server image.

IE7 RC1

I just noticed that RC1 of Internet Explorer 7 was released to the web -

  1. Technology Overview: Internet Explorer 7 RC1
  2. Internet Explorer 7 RC1 (ia64)
  3. Internet Explorer 7 RC1 (x64)
  4. Internet Explorer 7 RC1 (Windows Server 2003 SP1)
  5. Internet Explorer 7 RC1 (Windows XP SP2)

I "of course" use Vista as my primary OS by now, so I will have to wait for the soon-to-be released RC1 of Windows Vista.

You can check Paul Thurrot's review of RC1 here

Thursday, August 24, 2006

Would you like to integrate Asterisk with LCS ?

Then voipen has created a tutorial on how to do this -

This is a tutorial on how to setup calling to/from MS LCS 2005 using SER and Asterisk. In this case LCS is acting as the IM/Presence/VoIP server, SER converts protocols TCP2UDP and Asterisk is a SIP to ISDN gateway. This setup allows for outbound calls from Microsoft Office Communicator – OC to a normal telephone and inbound calls from a normal telephone to Microsoft Office Communicator - OC. This also allows you to access services provided by Asterisk such as Meetme Conferencing. You can also use Windows Messenger 5.1 instead of OC client.

You can find the tutorial here.

Thursday, August 17, 2006

Look & feel of msgoodies

We are playing a bit with the template used for msgoodies as we are preparing to move to a "Stretched" template and hopefully soon the updated version of Blogger (Check beta.blogger.com or msgoodiestest.blogger.com, that better will serve larger postings and postings including code samples. it shouldn't affect our RSS readers, but our web readers probably need some "patience" with the look & feel of msgoodies.

Sorry for the inconvenience !

Friday, August 04, 2006

APOD Viewer v1

I love APOD - Astronomy Picture of the Day - as I'm privately quite interested in the universe and all that stuff. But I do not visit APOD daily, so once in a while I browse the site.

But, wouldn't it be nice to have a slideshow with the pictures?

Surprise! PowerShell to the rescue.

This script really show the power of PowerShell. It has a web client, caculates dates and controls Internet Explorer. Give it a shot. If you make any clever changes, please post those as comments. I have a big wishlist myself, but this got me going.



function apod {
param([int] $days=1) # show latest picture by default
$baseurl="http://antwrp.gsfc.nasa.gov/apod/"

# create IE COM object
$ie = new-object -com internetexplorer.application

# create .net object
$webclient = new-object system.net.webclient

# date manipulation
$date=[datetime]::now
$date.AddDays(1) # start tomorrow as the loops starts by subtracting a day

$ie.fullscreen=$true
$ie.visible=$true
# You may have to press the window in the taskbar to make it appear


# An easy way to do a for loop - could have used for, but as said this is easier
1..$days | % {

# back one day
$date=$date.AddDays(-1)

# construct url
$url=$baseurl+"ap" + $date.tostring("yyMMdd") + ".html"
$url

# get HTML page
$html = $webclient.downloadstring($url)
$html.length

# Pick up the link the picture has - links to the high resolution version
# I want to display
# This is not idiot proff coding - but, hey, scripts are easy to change

$html -match '<a href="([^"]*)">\W*<img'
$matches.count
# get the value matching the pattern in parenthesis
$img=$matches[1]
$img

# show high resolution picture
$ie.navigate($baseurl+$img)

# wait for IE to load picture
while ($ie.busy) {sleep -s 1;"busy"}

# give me 10 seconds to enjoy the picture
sleep -s 10

}

# shutdown IE
$ie.quit()

$ie=$null

# wish list: load pictures overlapping (but keep presentation interval)
# wish list: include some kind of fancy transition
# wish list: pick out the explanation and present it in some way
# add our own...

}

An easier way to learn/use PowerShell

When I write PowerShell stuff, I end up typing a lot on the keyboard - and using command recall a lot. When you start doing complex things, that gets quite boring. An alternative is to have a work PS1 file, editing it with notepad (or another tool) and only recall the line, that executes the PS1 file. In this way you 'only' have to ctrl-s, alt-tab, up arrow, return to execute the changes and the alt-tab back to make the next change.As I hate repeating the same actions over and over again - that is the reason I love making computers do just that - why not use PowerShell to help me? This is also an opportunity to use PowerShell for a real thing.

To do just that, I made these two functions -

function workpad {
$global:workpad = "$env:temp\workpad.ps1"
"Start workpad - execute with '. $workpad'"
notepad $workpad
}

function execute-workpad {
param([boolean]$executeFirst=$false) if ($executeFirst) {
$oldLastWriteTime=[datetime]"2000-01-01"
}
else {
$oldLastWriteTime=$(get-childitem $workpad).lastwritetime
"Waiting for change.."
}

while ($true) {
$lastWriteTime=$(get-childitem $workpad).lastwritetime
if ($lastWriteTime -eq $oldLastWriteTime) {
start-sleep -s 1
}
else {
"File changed - executing"
""
. $workpad
""
"Waiting for change.."
$oldLastWriteTime=$lastWriteTime
}
}
}
So now it is just a matter of starting the editor with workpad (and it takes you off where you left) and use execute-workpad to have the changes to the file executed automatically whenever you press ctrl-s. To break execute-workpad use ctrl-c or ctrl-break. I would have liked a version where you could use the window interactively at the same time, but I have not found a similar function to cmd's start/b (yet, I hope). Start /b is like & in the korn shell. Any feedback on this would be welcome - but keep in mind that the execution of the interactive commands must be done in the same context as the workpad script executes in, so variables can be used directly.

PowerShell'ed

During the last couple of months I've spent quite some time on getting the grips on PowerShell (PS). As written earlier, PowerShell will be important, but expect it to take some time and effort to get it 'in the fingers'.

When you first look at it, you may ask yourself - hey - what's the big news in the examples you see? Most things can easily be done with other well-known tools. What so funny about - say - creating 10 folders -
PS> 1..10 % { md folder$_ }
when I could do it with
CMD> for /l %i in (1,1,10) do md folder%i

And what is the big advantage in starting a service with
PS> start-service bits
when I could do it with
CMD> net start bits

Of course, restart is nicer
PS> restart-service bits
But this does the job as well
CMD> net stop bits & net start bits

But as you start try to do REAL stuff you realize the potential. How about keeping the logs for the last 10 days, named with the date? That is not easy at all with CMD and I often created an self-contained script to do the job -
CMD> set script=%temp%\x.vbs
CMD> echo script line 1 > %script%
CMD> echo script line 2 >> %script%
CMD> cscript %script%
With PS you can do it right away with code like -
PS> $logbase="$env:temp\my.log"
PS> $fivedaysold=$logbase+[system.datetime]::now.adddays(-5).tostring("yyyyMMdd")
PS> $fivedaysold
D:\DOCUME~1\user\LOCALS~1\Temp\my.log20060730

So, if you want to learn PS, do not just use it once in a while. Expect that you will spent much time on learning it - but stop using CMD as much as possible and realize that you can combine all your tricks and (programming) skills by combining command line stuff with COM, WMI and .Net stuff - right from the command line. In this way, you will learn along the way.

Be powershelled yourself!