I know this is a tech blog, but there really is a bit of crossover of recipes and analytical thinking with cooking. Also, I don’t have a separate personal blog right now, so I figured this is the best place to stuff a few recipes for now.

When I was growing up, Mom’s Lemon Meringue Pie was a special treat we had once or twice a year. As I got older, I helped Mom with the cooking and learned all the secrets. Thanks Mom!

After I moved to Arizona and had access to fresh off the tree lemons, I figured I’d try my hand at it myself. I made a pie, and it was good. But a pie needs good crust, and good pie crust takes a couple of hours to make (roll, ball, freeze, repeat ad infinitum).

Bars are easier. But most bars end up being this gooey lemon sludge, nothing like a rich pie made with lemon curd and topped with fluffy meringue. I did a bit of research and put on my thinking cap.

First, the crust. Needs to be crumbly and light, and buttery enough so the filling doesn’t seep in. What better than a shortbread crust?

Secondly, the filling. None of these “mix some lemon juice, flour, sugar, condensed milk” pretenders – it needs to be a legit lemon curd, made with butter and eggs, slowly thickened on the stove.

And finally, we need some fluffy meringue to top it all off.

I ended up finding three different recipes that had the components I needed:

Just ran into an issue where some old Windows server 2008 installs were starting to pop up with could not reach key management server (KMS), and thus bouncing to not genuine. Spent some time searching around for fixes, including running slmgr, swapping out dns, etc. None of it worked.

Turned out the solution was actually easier:

The network driver upgrade will force a reboot. Once that’s done, the instance will be able to activate.

There are a lot of different answers to this question, most which work for older versions of Windows but perhaps not Windows 10.

Once you’ve got the method down, though, it really is straightforward:

  1. Open an admin Powershell window
  2. Create a self-signed cert for your domain. Here, I’m making a wildcard cert for *.test.com:
    New-SelfSignedCertificate -certstorelocation cert:\localmachine\my -dnsname *.test.com
  3. Create a password using ConvertTo-SecureString and export the cert. Replace the thumbprint and path with values for your environment:
    $CertPwd = ConvertTo-SecureString -String "foobarpassword" -Force –AsPlainText
    Export-PfxCertificate -cert cert:\localMachine\my\<thumbprint from new cert command above> -FilePath c:\dev\cert.pfx -Password $CertPwd
  4. Open Certificate Manager and import the certificate under Trusted Root Certification Authorities.
  5. Open IIS manager and create an HTTPS binding for the site using your new cert.
  6. Reboot (to clear Chrome cache etc.)

I do a lot of work with SQL Server, and I’m often bouncing in and out of domains, using VPN to remote sites, etc. I always thought that you couldn’t connect using Windows Authentication to a SQL server in a different domain, so I’d remote desktop in and use SSMS on that machine.

But it turns out there’s a way!

  1. Open Administrative Tools > Credential Manager (Control Panel > Stored Usernames and Passwords in older versions).
  2. Add a Windows credential
    • Use the fully qualified domain name for the server, followed by the SQL Server port, for example: server.domain.com:1433
    • Enter your fully qualified domain user, for example: domain\user
    • Your domain password

Now you can connect to that server in SSMS! Use the fully qualified domain name there too (no port this time): server.domain.com. It'll show your local user in the disabled user segment there, but actually pick up the credentials you entered before.

Of course, the proper ports will have to be open, etc. but if you’re connecting through VPN that should be handled.

Yesterday, I wrote about how to grab Git commit statistics for author by date. I also work on some projects that use Subversion. It’s a bit tougher to grab insertion/deletion data with SVN but I came up with a way: grab the diffs for a day and parse them.

Of course, because SVN has to go and be different, the date filter also doesn’t work how you expect – it includes the first rev before that day. There’s even a note on it in the docs: http://svnbook.red-bean.com/en/1.7/svn.tour.revs.specifiers.html (the “Is Subversion a Day Early” box at the bottom).

So we’ve got to skip the first revision. Unfortunately, PowerShell processes output line by line, so we’ve got to join all the lines together, split to revs by regex, and then split out the lines again.

This works, even if it isn’t elegant. As Blaise Pascal said, “I have only made this ... longer because I have not had the time to make it shorter.” If the PowerShell pros know a better way to do this, hit me up.

Just like the git version, swap out my name for yours and the dates with todays date:

((((svn log --search chris -r '{2016-01-25T00:00:00}:{2016-01-25T23:59:59}' --diff) -join "`n" -split "-+\nr\d+", 0, "multiline") | ? { $_ }) | select -skip 1) -split "\n" | Select-String '^([+-]) ' -AllMatches | ForEach-Object { $_.Matches } | ForEach-Object { New-Object psobject -Property @{ Adds = if ($_.Groups[1].Value -eq "+") { 1 } else { 0 }; Deletes = if ($_.Groups[1].Value -eq "-") { 1 } else { 0 } } } | Measure-Object -Property @("Adds","Deletes") -Sum

And the output:

Count    : 504
Average  :
Sum      : 402
Maximum  :
Minimum  :
Property : Adds

Count    : 504
Average  :
Sum      : 102
Maximum  :
Minimum  :
Property : Deletes