Checking a host is up

15 12 2009

This is just a test of the new sourcecode formatting on WordPress.com.

Here’s a function to test if a host is pingable. I usually do this check before attempting anything else on a remote system. It’s a useful function to use in other scripts, or have available in your profile.

function test-ping ( [string]$server )
{
 # if $server doesn't resolve, we'd bomb without the 'trap' with a
 # System.Net.NetworkInformation.PingException or System.Net.Sockets.SocketException
 trap { return $false; }

 $ping = New-Object System.Net.NetworkInformation.Ping
 if ($ping)
 {
  $rslt = $ping.Send($server)
  if ($rslt -and ($rslt.Status.ToString() –eq “Success”))
  {
   $ping = $null
   return $true
  }
  $ping = $null
 }
 return $false
}




How-to generate a Sitemap using PowerShell

22 01 2009

I’ve been looking at some SEO stuff recently and this led me to the Google Webmaster Tools site. This gives website owners an insight into how effectively Google is indexing their site and provides pointers for getting more pages in the Google index.

One of the things that can be helpful for medium to large websites is providing a Sitemap – a list of valid URLs – to the search engines so they can intelligently crawl your site quickly. Google offers an open source Sitemap generator, written in Python, but I am kinda keen on Windows PowerShell at the moment and decided it would probably be just as fast to code up my own Sitemap generator.

Within a couple of hours I had a working version which met my specific needs – it generated a nicely-formatted XML file which was grabbed by the Googlebot and indexed with no errors or warnings.

I have removed any site-specific code, made it more general and uploaded it to Powershell.com – download my PowerShell Sitemap Generator Script





Google Chrome is polished

13 12 2008

Google’s products are renowned for being in beta for ages – in fact it’s become a bit of a standing joke in the tech community. (Sometimes I wonder if GMail is ever going to make it out of beta – four years? Seriously!) So, imagine everyone’s surprise when it was announced yesterday that Google’s new browser, Chrome is coming out of beta.

“In just 100 days, we have reached more than 10 million active users around the world (on all seven continents, no less) and released 14 updates to the product. We’re excited to announce that with today’s fifteenth release we are taking off the “beta” label!”

Ten million users in one hundred days – that’s pretty incredible! New features in this release are better bookmark features and bugfixes in audio and video playback. Chrome performance is now even faster than the first beta “and there is more performance to come”.

Apparently Google are working on adding extensions to Chrome, as well as support for Mac and Linux.

It will be interesting to watch developments in this space – and how long those developments take to appear.





The best FREE apps for your BlackBerry

10 12 2008

So you’ve landed on your feet and scored yourself a new BlackBerry (perhaps a jaunty new Bold?) and you’re keen to see what it’s capable of. There is so much software available for the BlackBerry it can be a daunting task to go through it all (especially if you don’t want to spend any money!)

Until the new BlackBerry Application Center takes off, it’s up to you to scour the net searching for decent downloads – but I’ve had a look round and gathered the absolute best in one place, so you don’t have to.

So here’s a list of my favourite FREE BlackBerry applications. You won’t find any games here, just solid apps that will make you more productive – guaranteed*.

If you know of any more useful BlackBerry downloads, please leave a comment.

*Guarantee not actually guaranteed :)

Read the rest of this entry »





First post

30 11 2008

So, I have a new blog (it looks cool, huh?)

There’s not much in the way of content to see at the moment, but hopefully that will change soon enough…

Anyway, that’s enough for a ‘hello world’ post, check back soon for more.