In a recent post, I blogged some data based on an uptime monitor I put together when I started having problems with my (then) web hosting platform. Here’s how it works. The first step is a script, Test-Uri. This essentially runs the Invoke-WebRequest cmdlet and captures the important details: Time, Uri, Status Code, Status Description, Response Length (so you can detect drastic content changes or incomplete responses), and Time Taken.
In 2010, I posted about my woes with WebHost4Life (which I’m shocked is still around.) I looked around for another host, and ended up going with Arvixe. I’ve been happy with them ever since. In the comments, Sebastian wrote: Sebastián Cañizares writes: Arvixe is the same problem … they say “We are currently facing network issues across at least one of our facilities The packet loss is disrupting service” and after 3 months my site still has the problem … the site going up and going down …
If you’ve ever tried to pull hard on thin rope (maybe to tighten slack in a line), you’ve probably wrapped the rope around your hand and felt it dig in as it constricted around your fingers. Here’s a knot that solves the problem – I call it the Handle Hitch. I couldn’t find it anywhere else – if you’ve heard of it and it has a name, I’d love to know.
If you’ve got an interest in languages, writing, and computers – you may have stumbled into the crazy world of Shorthand and stenography. If you want to use shorthand from a regular keyboard, now’s your chance!
If you don’t use a Password Manager to store your login information for websites, first go read this: http://www.troyhunt.com/2011/03/only-secure-password-is-one-you-cant.html. I’ve been using KeePass for my password manager for years, but noticed that their Professional Edition had a pretty brutal startup delay. As in – launch KeePass and wait 80 seconds for the window to open. While password security is important, that kind of delay will make even the most security-conscious person start thinking about using ‘123456’ for their password instead.
You’ve probably been in the situation of wanting to alert yourself when any update happens to a sports game, UPS package tracking status, or something else. By combining Invoke-WebRequest’s beautiful support for HTML parsing with Send-MailMessage’s ability to send email messages - this becomes incredibly easy and useful. (Note: this script also uses Watch-Command, a script from the PowerShell Cookbook.) $content = "" while($true) { Watch-Command -ScriptBlock { ## Fetch the current box score for the game $r = Invoke-WebRequest http://www.
If you’ve tried to diff files in PowerShell before, you might have seen the Compare-Object cmdlet. The Compare-Object cmdlet lets you compare two sets of items, giving you a report on the differences between those two sets: PS G:\lee\tools> cd c:\temp PS C:\temp> $set1 = "A","B","C" PS C:\temp> $set2 = "C","D","E" PS C:\temp> Compare-Object $set1 $set2 InputObject SideIndicator ----------- ------------- D => E => A <= B <= From this output, we can see that “A” and “B” only show up in $set1, while “D” and “E” only show up in $set2.
If you’re interested in learning guitar, you might be running into an enormous feeling of dread. How do you get started? What kind of guitar should you get? Here’s a short guide that can hopefully help get you started. Buying a Guitar Guitars can get really expensive. But higher-end guitars end up being a matter of taste (both musically and aesthetically). For your first guitar, you don’t have an opinion, so there’s no need to splurge.
Have you ever wondered who’s in your “Email Social Network”? I was wondering the other day how to find out who I mail the most. With a bit of PowerShell scripting, the answer is a breeze to find out: ## Connect with Outlook, and open the 'Sent Items' $olApp = New-Object -com Outlook.Application $namespace = $olApp.GetNamespace("MAPI") $sentItems = $namespace.GetDefaultFolder(5) ## Go through each item, split out names when there were multiple ## recipients, and clean them up a bit $sentEverTo = $sentItems.
In the last post, I talked about how I used PowerShell to “STUN Roll” the open WiFi at DefCon. How much code was that? Was it hard? It turns out that it was pretty reasonable - less than 60 lines of PowerShell. ## Convert a string in the form of hexadecimal characters into the ## equivalent bytes. function ConvertFrom-HexString { param($HexString) $HexString -split "(..)" | ? { $_ } | % { [Convert]::ToByte($_, 16) } } ## Get the broadcast address for a subnet.