Archive for the 'Programming' Category

Changed Ping.exe output in Windows Server 2008?

2009-06-04

Do I see this right that output of ping.exe has changed for a system that is unreachable between Windows 5.2 (Windows Server 2003) and 6.0 (Windows Server 2008)?

On the older Windows versions pinging a system that is offline would give output such as this:

Pinging 192.168.0.228 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Ping statistics for 192.168.0.228:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),

So anyone who is calling ping from a wrapper and parses the output — not saying it’s a great idea — would then probably look for “timed out” or “(100% loss)” to conclude there is a problem. Or finding “(0% loss)” would indicate all is well.

Doing a similar test several times on Windows 2008, the result will look like this after a minute or so:

Pinging 192.168.0.228 with 32 bytes of data:
Reply from 192.168.0.94: Destination host unreachable.
Reply from 192.168.0.94: Destination host unreachable.
Reply from 192.168.0.94: Destination host unreachable.
Reply from 192.168.0.94: Destination host unreachable.

Ping statistics for 192.168.0.228:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

See how it has changed? The host 192.168.0.94 is the source machine pinging, not the ping target. The “Request timed out” is gone, the “(100% loss)” is gone, and instead ping returns “(0% loss)” — which previously was only printed out when the target host was indeed reachable.

The ping statistics show full success, counting the “Destination host unreachable” replies as good replies. Interesting!

Any comments? (apart from parsing ping’s output is not a good idea anyway) How is it on Vista and Windows Seven?

Introducing rb-itunes, a cross-platform iTunes API for Ruby

2007-04-10

puts ‘Hello World’, it’s very early days … but this little baby of mine now has a name, a home page + project stuff on rubyforge, some documentation and alpha 0.1.2 residing in svn.

The rb-itunes wrapper provides a cross-platform solution to use iTunes in Ruby. If you are a developer currently working on iTunes Ruby scripts with either rb-appscript, rbosa or WIN32OLE, then moving to rb-itunes will give you cross-platform compatibility.

There’s a lot of work to be done before a beta release. So for now, let me know how you like the idea.

Ruby script for iTunes on both Windows and Mac OS X

2007-03-02

I see people automating complex tasks on their computers by using scripts. Same here, I love it. When it comes to iTunes, we Mac OS X owners are using AppleScript – and the best place to start looking for all sorts of solutions is Doug’s page. For Windows users their iTunes looks the same, but the AppleScript won’t work. Instead, they can use VBscript or JavaScript to accomplish pretty much similar things. However, I think the Mac people are leading in terms of iTunes scripting solutions that are available for download. And I know that Doug gets lots of requests to provide the same functionality for Windows, too.

Now I had a dream. Wouldn’t it be great to use a scripting language that is available both on Windows and Mac OS X, and create cross-platform iTunes scripts? My pick would be Ruby, as I already know that from Rails development. Mac users need rubygems and rbosa, Windows users just need ruby. Then run this here:

if RUBY_PLATFORM.match('darwin')
  require 'rubygems'
  require 'rbosa'
  itunes = OSA.app('iTunes')
elsif RUBY_PLATFORM.match('mswin')
  require 'win32ole'
  itunes = WIN32OLE.new('iTunes.Application')
else
  #any other platform that has iTunes? add here...
end
itunes.play

Works so far! Do you like that???

Think of ruby scripts that can be used by both Windows and Mac users… Think of script developers on both platforms helping each others… Think of Ruby on Rails applications where you can query and tidy your music collection from any browser window in the world…

Nice. I need to reserve some time to digg more into this topic.

Toggle those iTunes remote speakers

2007-03-01

Remote Speakers
I like the AirTunes / remote speakers feature for its easy setup and the perfect sync. Also, it’s quite a bit cheaper then a Sonos system for a few rooms. However, I don’t like that Apple forgot to expose the remote speakers functionality in their iTunes API, at least not in the versions 4.6 up to the current 7.0.2. So the only way to switch on or off a particular room is by using a mouse. That’s not what people want who have a Mac mini next to their TV and like to operate it with the remote only.

Martin of CASE Apps just published version 2.0b2 of his excellent Sofa Control application. This version contains some contribution by me in the CoverFlow and iTunes scripts. You can now all toggle those iTunes remote speakers with the remote. Yippee.

Thanks Martin! And I have seen you included me in the script’s credits … I’m honoured.