Automated Windows Server Backups on AWS EC2

by noahlh on July 2, 2014

I recently replaced an aging (and brittle…and risky) physical Windows box in our office with an AWS-hosted EC2 instance of Windows Server 2012 R2 and needed a good way to make sure the instance got backed-up nightly.

The original box was a simple Ubuntu server running VirtualBox-hosted Windows 7.  We had QuickBooks Enterprise running there, and the 3 folks who worked on accounting stuffs for us would login via Remote Desktop, do their thing, and sign off each night.  That box was running Dropbox and, in theory, should have automatically backed-up our QuickBooks file as soon as the file closed each night.

The problem, however, is that A) Dropbox isn’t daemon/service-based, so if the main user account got logged off for some reason, Dropbox would stop running, and B) Dropbox would only sync when the QuickBooks file was “closed”, which means all users had to remember to both close the file and log off each night.  In practice, this didn’t happen.

I felt like that box was a ticking time bomb of non-backed-up financial misery and was dreading getting that call:  ”So the hard drives are making a weird sound and I can’t login to QuickBooks – what do I do?”

The solution:  Move everything to the cloud.  I spun up an Amazon EC2 Windows Server instance, attached some storage, setup RDS (a bit of a process which is the scope of another post), and got QuickBooks running on that server.

The next problem:  Amazon EC2 is truly “infrastructure”, which means there isn’t just a simple “automated backup” button (like there is with Microsoft Azure and most linux-based VPS hosts).  So I had to roll my own.

The best solution I came up with was to run a set of PowerShell scripts to automate the EBS snapshot process nightly.  Based on this excellent post:

http://messor.com/aws-disaster-recovery-automation-w-powershell/

The issue with those scripts is that they were written for an old version of the AWS SDK (v1.0).  So I dug into the Windows PowerShell ISE, fired up the debugger, and got everything working with the latest version.

Lo and behold, an updated set of scripts.  Enjoy!

https://github.com/noahlh/aws-automated-backup-powershell

How to Hard Reset an Aastra 6757i/57i

by admin on March 20, 2012

 

I purchased a used Aastra 57i SIP phone from a seller on Amazon and, unfortunately, it was one of the very few whose admin password was NOT the default ’22222′.  The seller had purchased it in a bulk liquidation and didn’t have any of the details, so I was left to scour the web to figure out how to get the 57i back to a factory-fresh state.

Google came up with a rare zilch (most of the posts I found said to hit ’4′ & ’6′ or ‘*’ & ‘#’ during startup, but that didn’t work).  A call to a very helpful rep at Aastra solved the problem:

To hard reset an Aastra 57i or 6757i when you do not have access to the admin password, you’ll have to put the phone into its emergency ‘web recovery’ mode and reload the firmware from a TFTP, FTP or HTTP server.  Do the following:

  1. Disconnect the phone from any outside network and run an Ethernet cable from the ‘PC’ port on the phone directly to your machine.
  2. Boot up the phone in Web Recovery mode by holding down the ’1′ and ‘#’ keys during phone boot (hold the keys down and then plug in the power on the phone).
  3. Check the IP address on the screen of the phone, and set your computer’s IP address to something in the same subnet (for example, my Aastra gave itself an IP address of 169.254.168.234 so I setup my machine to have 169.254.168.233).
  4. Get a TFTP or FTP server running locally on your machine.  If you’ve got a Mac, Tfttserver is a good one.
  5. Put the latest 57i.st firmware file on your local TFTP/FTP server.
  6. Point your browser at the IP address displayed on the phone and you should be greeted with the Web Recovery screen.
  7. Enter the location of the 57i.st file and your TFTP/FTP server — *IMPORTANT – AND THIS DROVE ME NUTS:  Every time I tried to start the download in Chrome or Safari by clicking on the button at the bottom of the form, I got an “Invalid Parameters” error message.  I had to use Firefox and be sure to hit enter after typing the details instead of clicking on the submit button — that got the file to download.
  8. Voila — fresh new firmware in a full factory default state.

Hope this is helpful!

Temporarily Prevent a Worksheet’s Formulas from Updating in Excel

by noahlh on April 30, 2010

This is the first in a series of extremely specific, nerdy posts I’ll make – not necessarily because I think a lot of people will be interested – but rather because I’m sure there will be a few specific people who will be interested and will find this via the Googles. Basically when I run into a weird problem and have to spend more than 10 seconds researching it, I think it’s only fair that I write up the solution in the hopes of saving some other folks out there a few minutes of time.

So for this case, I created a big multi-page spreadsheet and need to (temporarily) prevent one of the pages from allowing the formulas to update (while allowing other pages to update). In this case there are a ton of formulas on the page, so changing the formulas themselves isn’t an option

The solution I found is in a very simple two-part macro.  Thanks to user ‘shg’ from excelforum.com for posting this back in November 2008 (Original link):

Sub CommentFormulas()

    ' comments out all but array formulas
    Dim cell As Excel.Range

    With Application
        .ScreenUpdating = False
        .Calculation = xlManual
        For Each cell In ActiveSheet.UsedRange
            With cell
                If .HasFormula And Not .HasArray Then
                    .Formula = "'" & .Formula
                End If
            End With
        Next
        .Calculation = xlAutomatic
        .ScreenUpdating = True
    End With
End Sub

Sub UncommentFormulas()
    ' restores commented formulas
    Dim cell As Excel.Range

    With Application
        .ScreenUpdating = False
        .Calculation = xlManual
        For Each cell In ActiveSheet.UsedRange
            With cell
                ' the left(cstr(cell)) below accommodates cells having errors
                If Left(CStr(.Value), 1) = "=" And Not .HasArray Then
                    .Formula = Trim(.Text)
                End If
            End With
        Next
        .Calculation = xlAutomatic
        .ScreenUpdating = True
    End With
End Sub

I made one small change in the second macro by allowing Excel to ‘trim’ the converted text.  For some reason in my version (Excel 2003) running the UncommentFormulas macro.

What this does is convert all the formulas on a page to raw text with one macro (so you can change around other stuff without any of the formulas being affected — it essentially ‘freezes’ the page), and then when you’re ready to turn the page “live” again, you use the second macro to turn everything back to normal.

Took a few minutes to get working, but it does work perfectly.  Enjoy.

How Not To Propose a Partnership

by noahlh on March 4, 2010

This morning I received a phone call from a guy from Florida who wanted a job.  It started off fairly innocuously, as may of these calls do – he was looking for something (anything) to do with with our company — he could provide photographic services, he could provide marketing services, he could help wash cars.  Unfortunately we’re not hiring out of our Florida office and I politely let him know this, said goodbye, and hung up.  Total time of the call was under 5 minutes.

30 seconds later he calls back.  “Instead of working for you,” he says, “how about I work with you? I’ll start a franchised branch of Gotham Dream Cars out of the Tampa area, etc.”  I explained why we wouldn’t be interested.  He asked if he could email me some of his ideas.  No problem.

Here are some excepts from the email that arrived a few minutes later:

Noah,

This is <name> … talked to you a bit ago.  Some at Legendary levels call me a mechanical and creative genius.  I am thankful for such labels.

I’d like to make you a deal.

1) $1,000 down for my consulting for a day.
2) Fly me into NY to meet with you, pay the ticket, and expenses to put me up and get me around while I’m there, and I will blow your mind with innovative thoughts, creative abilities, marketing direction and profit center concepts.

This is my initial thought:

A $70k per year 3 year guaranteed bank to bank letter of credit supplied to a new division of your company that you and I own …

…From the $70k guarantee for three years to the new venture (that you control with your left hand supporting your right hand), I can develop this franchise ready micro version of your theme (for a modest weekly inside the budget) …

In a personal meeting, you will be blown away to see what I have done, and who says what about me.

Respectfully,
<name> Multi-Patented US Inventor / Pro Motor Sports Marketer

Needless to say, I’ve decided to pass on the superb opportunity.  But I did write back and explain why I’m running for the hills (I decided not to just delete the email or send a 1-line blow-off email).

Perhaps it’s patronizing of me, but at least some sort of feedback to this flavor of craziness is necessary.  It’s wholly inappropriate to send an email demanding a laundry list of payments and bank-letter-of-credit guarantees to someone who you’ve spoken with for <5 minutes and for whom you’re ostensibly trying to build a relationship with.  It comes off as, well, crazy.  Never met the guy, never heard of the guy, don’t know a thing about him, but he thinks it’s OK to demand payment terms on the intro email. 

Thanks but no thanks.