Saving yourself from Sender's Remorse with Outlook

tl;dr summary: Create an Outlook rule to “delay outgoing mail by <5> minutes”, “unless body contains: е”, where the character used for the body exclusion comes from typing ALT+1077.

“When it comes to email, it seems that I always do my best proof reading immediately after I press the Send button.”

Perhaps you’ve been in the situation before, where you immediately regret sending an email in anger. Or realize after a few more moments of reflection that the email you just sent was well and truly wrong. Or you accidentally hit the “Send” button, and now have an incomplete thought floating around in everybody’s mailbox.

Repairing a NatureBright SunTouch Plus

I recently had the misfortune of having my relatively unused NatureBright SunTouch Plus break down:

image

It’s a “Light Therapy” box that is very popular on Amazon, but a recurring problem among the disappointed reviews seems to be that it turns on, but then just immediately clicks and then turns off again. My lamp was out of warranty, so I decided to look into whether it was possible to fix it myself. One thing I noticed was that holding the “On” button would make it repeatedly turn on and turn off – but after a while, you could see that at least all of the bulbs were working. So it wasn’t the bulbs.

Absolute Positioning in Autodesk 123D Design

If you’re looking for a way to position an object in an exact spot in Autodesk 123D Design, you might have stumbled on forum topics like:

image

The last meaningful response was:

image

It doesn’t appear to have been added yet. Or it has been newly added, and the usability leaves something to be desired. In any case, it’s not as easy as you might think, but here’s a technique that works in version 1.6.41:

Playing with Classes in PowerShell v5 Preview

One of the features we’re working on in the latest version of PowerShell is the ability to define custom classes.

If you’ve ever used a PSCustomObject or a Hashtable in a script for storing related data, you’ll probably find classes to be a useful addition to your scripting toolkit.

$point = @{ X = 0; Y = 0 }
$point.X = 10
$point.Y = 20

While PSCustomObjects and Hashtables let you group related data, what if you want to perform actions on that data? For example:

Creating an Easy PowerShell Uptime Monitor

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.

##############################################################################
##
## Test-Uri
##
## From Windows PowerShell Cookbook (O'Reilly)
## by Lee Holmes (http://www.leeholmes.com/guide)
##
##############################################################################
<#
 
.SYNOPSIS
 
Connects to a given URI and returns status about it: URI, response code,
and time taken.
 
.EXAMPLE
 
PS > Test-Uri bing.com
 
Uri : bing.com
StatusCode : 200
StatusDescription : OK
ResponseLength : 34001
TimeTaken : 459.0009
 
#>

param(
    ## The URI to test
    $Uri
)

$request = $null
$time = try
{
    ## Request the URI, and measure how long the response took.
$result = Measure-Command { $request = Invoke-WebRequest -Uri $uri }
    $result.TotalMilliseconds
}
catch
{
    ## If the request generated an exception (i.e.: 500 server
    ## error or 404 not found), we can pull the status code from the
    ## Exception.Response property
    $request = $_.Exception.Response
    $time = -1
}

$result = [PSCustomObject] @{
    Time = Get-Date;
    Uri = $uri;
    StatusCode = [int] $request.StatusCode;
    StatusDescription = $request.StatusDescription;
    ResponseLength = $request.RawContentLength;
    TimeTaken = $time;
}

$result

The second step automates the invocation of the Test-Uri command, sending its output into a CSV. To do this, you use the Register-ScheduleJob cmdlet. Here’s an example to test your blog every hour:

Arvixe Status Report

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 …

Handle Hitch Knot for Pulling Thin Rope

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.

Gregg Shorthand from a regular QWERTY Computer Keyboard

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!

Fixing KeePass' Slow Startup Performance

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.

Texting Yourself Sports Alerts with PowerShell

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.tsn.ca/MENS_WORLD/scores/boxscore/?id=2388586

        ## The score is in a DIV with the class 'boxScoreBg', almost certainly different
        ## for your scenario
        $result = $r.ParsedHtml.Body.getElementsByClassName("boxScoreBg")

        ## Extract out what text you care about
        $SCRIPT:content = (@($result)[0].innerText -split "`r`n" |
            ? { $_ })[5..6] -join "`r`n"

        ## And use that to monitor
        $SCRIPT:content

    } -UntilChanged -DelaySeconds 30

    ## Every cell provider has an email address that you can send to
    ## so that it will be delivered as a text message.
    $params = @{
        To = "[email protected]"
        From = "[email protected]"
        Subject = "Hockey Score Update"
        Body = $SCRIPT:content
        SmtpServer = "mysmtpserver"
    }

    Send-MailMessage @params
}