All posts

2021

Fix Terraform Provider Path in State

Fixing Terraform provider paths in state might be required after upgrading to 0.13-0.14 if your prior state has the following paths.

First, get the terraform providers from state using: terraform providers

The output should look similar to this:

  read more

Azure Pipelines Template Iteration

Templates

This isn’t meant to be an exhaustive template overview. I’m just going to give an example of what I found useful as I’ve been meaning to leverage templates for a while and finally got around to having a great use for it.

My Use Case

I am a heavy user of InvokeBuild . It’s a very robust task runner tool that I’ve used to coordinate many project oriented actions, similar to Make, but also DevOps oriented work like AWS SSM tasks and more.

In this scenario, I …

  read more

Git Workflow With Git Town

Resources

Git-Town

Painful But Powerful

Let’s get this out of the way.

Git isn’t intuitive.

It has quite a bit of a learning curve.

However, with this flexibility comes great flexibility. This tool has powered so much of modern open-source development.

Optimize for the Pain

To improve the development experience some tools can help provide structure.

This won’t be an attempt to compare every git GUI, or push any specific tooling. It’s more sharing my experience and what …

  read more

Go R1 Day 28

progress

  • Solved [Hamming Distance] on exercism.io
  • Simple problem, but reminded me of how to use string split.
1
2
3
4
5
6
7
8
9
diffCount := 0
aString := strings.Split(a, "")
bString := strings.Split(b, "")

for i, x := range aString {
  if x != bString[i] {
    diffCount++
  }
}
  • Reviewed other solutions, and found my first attempt to split the string wasn’t necessary. Looks like I can just iterate on the string directly. I skipped this as it failed the first …
  read more

Incremental and Consistent

It’s really hard to prioritize when life gets busy, but it’s important that continued improvement is a priority. Great at Work: How Top Performers Do Less, Work Better, and Achieve More was a really interesting book. The fact that small incremental improvement done daily can make such a difference is pretty …

  read more

Working With Powershell Objects to Create Yaml

Who This Might Be For

  • PowerShellers wanting to know how to create json and yaml dynamically via pscustomobject.
  • Anyone wanting to create configs like Datadog or other tools dynamically without the benefit of a configuration management tool.
  • Anyone else wanting to fall asleep more quickly. (I can think of better material such as the Go spec docs, but hey, I can’t argue with your good taste 😄)

YAML

It’s readable.

It’s probably cost all of us hours when debugging yaml …

  read more

Nativefier

Update 2021-09-20
Updated with improved handling using public docker image.
Update 2021-05-10
Added additional context for setting internal-urls via command line.

  read more

Github Pages Now Supports Private Pages

I’m a huge static site fan (lookup jamstack).

What I’ve historically had a problem with was hosting. For public pages, it’s great.

For private internal docs, it’s been problematic. It’s more servers and access control to manage if you want something for a specific group inside a company to access.

This new update is a big deal for those that want to provide an internal hugo, jekyll, mkdocs, or other static generate based documentation site for their team.

Access …

  read more

Ensuring Profile Environment Variables Available to Intellij

Open IntelliJ via terminal: open "/Users/$(whoami)/Applications/JetBrains Toolbox/IntelliJ IDEA Ultimate.app"

This will ensure your .profile, .bashrc, and other profile settings that might be loading some default environment variables are available to your IDE. For macOS, you’d have to set in the environment.plist otherwise to ensure they are available to a normal application.

ref: OSX shell environment variables – IDEs Support (IntelliJ Platform) | JetBrains

  read more

Create an S3 Lifecycle Policy with PowerShell

First, I’m a big believer in doing infrastructure as code.

Using the AWS SDK with any library is great, but for things like S3 I’d highly recommend you use a Terraform module such as Cloudposse terraform-aws-s3-bucket module . Everything Cloudposse produces has great quality, flexibility with naming conventions, and more.

Now that this disclaimer is out of the way, I’ve run into scenarios where you can have a bucket with a large amount of data such as databases which would be …

  read more

Leverage Renovate for Easy Dependency Updates

Update 2021-06-30

Added example from renovate documentation with some notes on the Azure DevOps Pipeline to leverage their free renovate service. GitHub users benefit from the Renovate app, but Azure Pipelines should use an Azure Pipeline definition.

Follow the instructions from the Renovate Me task linked in resources, and ensure the …

  read more

Go R1 Day 26

Progress

  • Evaluated gorm usage best practices with Slack Gopher community.
  • Obtained a great example to get me started on go routine and channels usage with multi-database queries.

Go R1 Day 25

Day 25 of 100

progress

  • Worked with Gorm, my first experience with ORM based querying.
  • Used gofakeit with gorm to connect to MSSQL Server in Docker and randomize name entries.
  • Learned a bit about Context package and how it helps with propagation of cancellation.
  • As a new user to this, the examples were very confusing as it mixed up go-mssqldb along with examples using just gorm. As I get better with it, I’ll try to log better introductory examples.
  read more

Go R1 Day 24

Day 24 of 100

progress

  • Used glamour to render some nice console output.
  • Formatted text testing some text tooling.
  • Progressbar ui tested.
  • Connected successfully to MSSQL Docker instance and returned results of query, rendering to to console .
  read more

Go R1 Day 23

Day 23 of 100

progress

  • Used Viper to load configuration for a CLI tool.
  • Ran into problems with trying to print out map[string]interface{} type. Lots of magic performed by .NET to do this type of action. This is a lot more hands-on 😁.
  • Had stability issues with VSCode today, so I finally switched over to Intellij with the Go plugin and it worked well. The keyboard mappings are different so that was painful, but still overall a good experience that got me unblocked.
  read more

2020

Contents

Experiments With Go Arrays and Slices

Simplicity Over Syntactic Sugar

As I’ve been learning Go, I’ve grown to learn that many decisions to simplify the language have removed many features that provide more succinct expressions in languages such as Python, PowerShell, C#, and others. The non-orthogonal features in the languages result in many expressive ways something can be done, but at a cost, according to Go’s paradigm.

My background is also heavily focused in relational databases and set based work, so I’m …

  read more

Go R1 Day 22

Day 22 of 100

progress

Using Dash, I read through much of the language specification. Dry reading for sure, but helped a bit in understanding a little more on stuff like arrays, slices, loops, etc.

Nothing profound to add, except to say I don’t think I want to write a language specification.

Go R1 Day 21

Day 21 of 100

progress

  • Signed up for exercism.io, which is a pretty great website to work through progressively harder exercises.
  • Did Hello world to start with as requires progressive steps through the exercises.
  • Did a string concatenation exercise as well (Two Fer).

I like the mentor feedback system concept and submission of work. After I finish this, would be good to add myself as a mentor and contribute back to this community. This is a fantastic concept to help get acclimated to a new …

  read more

SQL Server Meets AWS Systems Manager

Excited. Have a new solution in the works to deploy Ola Hallengren via SSM Automation runbook across all SQL Server instances with full scheduling and synchronization to S3. Hoping to get the ok to publish this soon, as I haven’t seen anything like this built.

Includes:

  • Building SSM Automation YAML doc from a PS1 file using AST & metadata
  • Download dependencies from s3 automatically
  • Credentials pulled automatically via AWS Parameter Store (could be adapted to Secrets Manager as well) …
  read more

Using AWS SDK With Go for EC2 AMI Metrics

Source

The source code for this repo is located here:

What This Is

This is a quick overview of some AWS SDK Go work, but not a detailed tutorial. I’d love feedback from more experienced Go devs as well.

Feel free to submit a PR with tweaks or suggestions, or just comment at the bottom (which is a GitHub issue powered comment system anyway).

Image Age

Good metrics can help drive change. If you identify metrics that help you quantify areas of progress in your DevOps process, you’ll …

  read more

Five

I asked my daughter (3) how much she loved me. She held up her hands and said: “Five”.

I’ll take that as a win considering that’s all the fingers on that hand. 😂

Leave Me Alone

Free Means You Are the Product

Over time, I’ve begun to look at products that are free with more judgment. The saying is: “If it’s free, you are the product”. This often means your data and privacy are compromised as the product.

This has resulted in me looking more favorably at apps I would have dismissed in the past, such as Leave Me Alone .

Leave Me Alone

The notion of buying credits for something I could script, click, or do myself made me use sporadically last year. …

  read more

Go R1 Day 17

Day 17 of 100

progress

  • reviewed adding excel conversion to cli
  • shelved this after reviewing implementation requirements
  • this is one of those cases where PowerShell makes much more sense for adhoc work as converts pscustomobject (similar to struct) via pipeline automatically to excel sheet.

Go R1 Day 16

Day 16 of 100

progress

  • refactored AWS SDK call to export a named file using flags.
  • Iterated through regions so cli call aggregated all results from all regions into single JSON.
  • Working with v1 makes me want v2 so much more. The level of pointers required is ridiculous. At one point I had something like &*ec2 due to the SDK requirements. Having to write a filter with: Filters: { Name: aws.String("foo")} is so clunky. I believe in v2 this is greatly simplified, and the code is much …
  read more

Filtering Results in Go

Where Filtering

I explored a bit on filtering objects with Go for the AWS SDK v1.

Coming from PowerShell, I’m used to a lot of one-liners that do a lot of magic behind the scenes, so Go is both refreshing in it’s clarity, and a bit verbose at times since the language features are more sparse.

In PowerShell, you can filter results with a variety of methods, including examples like below (but not limited to)

  • $collection.Where{$_.Value -eq 'foo'}
  • $collection | Where-Object {$_.Value …
  read more

Go R1 Day 15

Day 15 of 100

progress

  • figured out scope issues with pointer and struct
  • Used omitempty in struct
  • exported final report in json format after searching for matching image id from ec2 instance image id
  • Find it interesting how much more wordy the go search method was, but appreciate it in a way as the “syntactic” sugar that’s missing also is the reason there is more complication at times in languages like PowerShell/C#.
  read more

Go R1 Day 14

Day 14 of 100

progress

  • built golang function with aws-sdk that returned ec2 instances, images
  • Joined the data together together to search for matching image from the ec2 metadata
  • generated json report from results and final struct

Go R1 Day 14

Day 14 of 100

progress

  • Migrated my new aws lambda logger from zap to zerolog. Zap gave me some problems initially so zerolog is my favorite structured logger right now, much simpler.
  • Constructed go-task runner file for launching go test and go build/run.
  • Structured logging required a little bit of refactor but worked.

Here’s an example of providing back a logged string (don’t log secrets normally, but I’m in testing phase) with structure.

1
2
3
4
	log.Debug().
		Str( …
  read more

Consider the Benefits of Powershell for Developer Workflows

Who Am I Talking To

  • You use bash or python.
  • PowerShell seems wordy, extra verbose, and annoying.
  • It’s a windows thing, you say… why would I even look at it.
  • Pry bash out of my fingers if yuo dare (probably not for you 😁)

What PowerShell Is

  • The best language for automating Windows… period.
  • A great language for development tooling and productivity scripts.
  • One of the best languages for automation with interactivity. Python is fantastic. The REPL isn’t meant for the …
  read more

Improving Local Development Workflow With Go Task

Workflow Tooling

Development workflow, especially outside of a full-fledged IDE, is often a disjointed affair. DevOps oriented workflows that often combine cli tools such as terraform, PowerShell, bash, and more all provide more complexity to getting up to speed and productive.

Currently, there is a variety of frameworks to solve this problem. The “gold standard” most are familiar with in the open-source community would be Make .

Considering Cross-Platform Tooling

This is not an …

  read more

Quick Start to Using Influxdb on Macos

Intro

OSS 2.0 is a release candidate at this time, so this may change once it’s released.

It wasn’t quite clear to me how to get up and running quickly with a docker based setup for OSS 2.0 version, so this may save you some time if you are interested. It also should be very similar to the Windows workflow excepting the basic brew commands and service install commands you’ll just want to flip over to choco install telegraf .

Docker Compose

Grabbed this from a comment and …

  read more

Set Theory Basics in the Eyes of 10 Year Old

My morning. Explaining set and intersect theory basics to my 10 year old with Minecraft gamer tags. Trying to justify the need to know this, the best I could come up with was his future need to build a shark attack report accurately.

Kids are the best. Tech is fun. What job would have me spin up with docker-compose up -d my MSSQL container, write a quick SQL example with INTERSECT, UNION and all to demonstrate this magic.

Followed it up with a half-hearted lie that my day is comprised of cmatrix …

  read more

Ways to Improve Codespaces Local Docker Experience

I’ve been enjoying Codespaces local development workflow with Docker containers.

I’m using macOS and on Docker experimental release. Here are some ideas to get started on improving the development experience.

  • Clone the repository in the virtual volume (supported by the extension) to eliminate the binding between host and container. This would entail working exclusively inside the container.
  • Increased Docker allowed ram to 8GB from the default of 2GB.

Any other ideas? Add a comment …

  read more

Keep the Snippet Simple

I took a quick step back when too many parentheses started showing up. If you question the complexity of your quick snippet, you are probably right that there is a much simpler way to do things.

I wanted to get a trimmed message of the results of git status -s. As I worked on this snippet, I realized it was becoming way overcomplicated. 😆

1
$(((git status -s) -join ',') -split '')[0..20] -join ''

I knew my experimentation was going down the wrong road, so I took a …

  read more

Go R1 Day 12

Day 12 of 100

progress

  • Worked on Algolia index project to do atomic updates on search index on my blog.
  • Worked with json, structs, ranges, and more.
  • Saw success with the first value in my output now correctly parsing out the title from the front matter.
  • Implemented zerolog.
  • Used front library to parse yaml front matter into map.
  • Accessed map to get title into json.

Hoping that eventually I can build out a Go app for sharing that’s the equivalent of “atomic alogia” allowing …

  read more

Deadcells

Beat Deadcells with 3 cells active. Uninstalled. There is no way I’d find any pleasure in life trying to do more. This game is an endless pit of “git gud”.

Now to go do something productive 😄

Improve Your Cloudwatch Debugging Experience With Cw

A quick fix to improve your debugging of remote commands in AWS is to install cw .

With a quick install, you can run a command like: cw tail -f --profile=qa --region=eu-west-1 ssm/custom-automation-docs/my-custom-doc. This will give you a real-time stream of what’s running.

You can also use the AWS Visual Studio Code extension, but I prefer having a terminal open streaming this as I don’t have to go in and refresh any further tools to see what’s happening. I tend to always …

  read more

Delta Improves the Git Diff Experience

Checkout delta for a much-improved git diff experience. I typically use VSCode or a GUI based editor because I find the diff view pretty messy by default.

This new diff view is a perfect example of a simple CLI tool that improves a development workflow by just fixing something I didn’t know could easily be fixed. 😀

  read more

Go R1 Day 10

Day 10 of 100

progress

  • Experimented with CLI tool using go-prompt
  • Customized initial options
  • OS independent call to get user home directory.
  • Iterated through a directory listing
  • Used path join to initialize path for directory search.
  • One challenge in working with structs being returned was figuring out how to print the values of the struct. Initially, I only had pointers to the values coming back. This made sense, though, as I watched a tutorial this weekend on slices, and better understand …
  read more

Go R1 Day 8

Day 8 of 100

progress

  • Worked through Algorithms in Go: Determine if a number is in a list
  • Passed the tests without needing to find the solution, so that’s a win.
  • Had to remember to grab the second value from the range operator like for _, i := range items instead of using foreach($i in $items) like PowerShell would do. It’s more similar to using hashtables with GetEnumerator().
  • Used codespaces with Docker and also experimented with WSL2 and Visual Studio Code mounting the directory …
  read more

Terraform's Elegance in Abstraction

Migrated a forked copy of a module over to a new module with similar schema. There were some additional properties that were removed. In rerunning the plan I was expecting to see some issues with resources being broken down and rebuilt. Instead, Terraform elegantly handled the module change.

I imagine this has to do with the resource name mapping being the same, but regardless it’s another great example of how agile Terraform can be.

Reflections on Being a New Gopher With A Dotnet Background

Disclaimer

Newbie Gopher. Much of what I observe is likely to be half right. I’ll probably look back at the end of the year and shake my head, but gotta start the journey somewhere, right? 😁

My Background

I’ve learned my development skills primarily in the dotnet world. Coming from SQL Server performance, schema, and development, I transitioned into learning PowerShell and some C#. I found for the most part the “DevOps” nature of what I was doing wasn’t a good fit …

  read more

Go R1 Day 7

Day 7 of 100

progress

  • Successfully deployed lambda to AWS
  • Figured out how to return value cleanly from AWS Lambda vs the log output.

Go R1 Day 6

Day 6 of 100

progress

  • Learned a little on bubble sort algorithm
  • Edited aws-go lambda tests
  • Used debugger a bit more to look at error return values on failure

Rebuild Dash Index Due to Corrupted Index

I use Dash for improved doc access. Terraform updated recently to 0.13.x and I began having odd issues with AWS provider results coming through. If you need to rollback, just go to the preferences and pick an older docset, in my case 0.13.0 worked correctly. Make sure to remove the problematic version (the uninstall refers to just the most recent, not any additional versions you selected under the dropdown)

If the index doesn’t rebuild, you can close the app, manually remove the index, …

  read more

Incredible setup experience with gitpod

What a polished setup experience from gitpod. Super impressed as I’ve never seen an interactive terraform setup asking for user input.

This basically generated an entire setup for GitPod, and persisted the Terraform plan for the entire stack it created in a directory for management and adjustments as desired.

I’m seriously impressed.

Check this out at: Install on AWS

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# Setup Gitpod with self-setup docker installer
# …
  read more

Go R1 Day 5

Day 5 of 100

progress

  • I created my first unit test for go
  • It’s a bit interesting coming from a background with PowerShell and Pester as my primary unit test framework. For instance, in Pester you’d declare the anything, but autodiscovery works with *.tests.ps1, being the normal convention.
  • There is no pointer value providing the test package, it’s just other PowerShell calling PowerShell.
  • I’m biased I know, but the first test condition being like below seems clunky. I …
  read more

Go R1 Day 4

Day 4 of 100

progress

  • In the last week some more Pluralsight Go (Nigel’s courses are always stellar)
  • I’ve done some odd work as had time in between last update, but nothing structured. Might continue with learn-go-with-tests but also came across exercism and might tackle that soon as well.
  • Setup new project in Visual Studio Codespaces
  • Used Serverless Framework to generate aws-go template project
  • Imported aws-go-sdk resources for AWS SSM Secrets Manager
  • Grabbed SSM Secrets manager …
  read more

Go R1 Day 3

Day 3 of 100

progress

  • Learned about GOROOT, GOPATH and how to configure
  • Ran into problems with Visual Studio code reporting:
1
Failed to find the "go" binary in either GOROOT() or PATH(/usr/bin:/bin:/usr/sbin:/sbin. Check PATH, or Install Go and reload the window.
  • After attempting solution with various profile files, I tried setting the setting: "go.goroot": "/usr/local/opt/go/libexec/", in settings.json and this resolved the issue.
  • After it recognized this, …
  read more

How to Iterate Through A List of Objects with Terraform's for_each function

What I want to do

1
2
3
4
5
6
7
8
# create file local.users.yml
user:
  - name: foobar1
    email: [email protected]
  - name: foobar2
    email: [email protected]
  - name: foobar3
    email: [email protected]
1
2
3
4
5
locals {
  users_file         = "local.users.yml"
  users_file_content = fileexists(local.users_file) ? file(local.users_file) : "NoSettingsFileFound: true"
  users_config       = yamldecode(local.users_file_content)
}

What I want to work:

1
2
3 …
  read more

simple conditional flag in terraform

Sometimes, you just need a very simple flag for enabled or disabled, or perhaps just a resource to deploy if var.stage == "qa". This works well for a single resource as well as collections if you provide the splat syntax .

1
2
3
4
5

resource "aws_ssm_association" "something_i_need_in_testing_only" {
   count = var.stage == "qa" ? 1 : 0
   name = var.name
}
  read more

Go R1 Day 2

Day 2 of 100

progress

  • Focused on logistics, setup for remaining tests
  • Forked Learn Go With Tests
  • Setup Visual Studio Codespaces (Docker Workspace) for isolating this work
  • Codespaces default container + Added pwsh as default prompt
  read more

grave accent

TIL : What I’ve been calling the backtick 👉 ```` 👈 for years, is technically the grave accent.

Getting Started with Stream Analytics

Resources

Resources
If you want a schema reference for the json Application Insights produces // Azure Application Insights Data Model // Microsoft Docs
If you want to visualize last 90 days of App Insight Data with Grafana // Monitor Azure services and applications using Grafana // Microsoft Docs

The Scenario

Application insights is integrated into your application and is sending the results to Azure. In my case, it was blob storage. This can compromise your entire insights …

  read more

setting default open with on macOS

It should be easy to pick a default program to open a file. On macOS, I was surprised at how poor the design was. Seriously, how is this intuitive? Open With > Set this as default. Apparently this only set it for an individual file. This means, every different csv file required me to do this again.

Instead, I had to Get Info > Unlock settings and then choose the default Open With setting, and further select Use this application to open all documents like this.

I enjoy most of my …

  read more

Go R1 Day 1

Day 1 of 100

progress

  • Cloned learning-go-with-tests to ensure a nice structured start, even though I’ve already done hello-world
  • Setup fresh gotools updates - Ran golangci-lint through docker to ensure improved linting options ready for further tests
  • Fixed default debug template in vscode to use workspacefolder instead of file directory. Strange that it defaulted to the wrong path.
  read more

Assume a role with AWS PowerShell Tools

Assume A Role

I’ve had some issues in the past working with AWS.Tools PowerShell SDK and correctly assuming credentials.

By default, most of the time it was easier to use a dedicated IAM credential setup for the purpose.

However, as I’ve wanted to run some scripts across multiple accounts, the need to simplify by assuming a role has been more important.

It’s also a better practice than having to manage multiple key rotations in all accounts.

First, as I’ve had the need to …

  read more

Compiling a Custom Provider and Including for Terraform Cloud

Assumptions

  • You are familiar with the basics of setting up Go and can run basic Go commands like go build and go install and don’t need much guidance on that specific part.
  • You have a good familiarity with Terraform and the concept of providers.
  • You need to include a custom provider which isn’t included in the current registry (or perhaps you’ve geeked out and modified one yourself 😁).
  • You want to run things in Terraform Enterprise ☁.

Terraform Cloud

For Terraform Cloud, …

  read more

2020-07-13T14:00:00-05:00

PowerShell has some functionality that can help in pre-processing data by grouping and aggregating. If you are using ImportExcel this might be useful to pre-aggregate the results prior to an Excel workbook. If you are working with PowerShell and needing to do some quick measurement of objects, maybe this will be useful.

2020-07-06T12:00:00-05:00

Windows users, nice little win for making the great git-town tool even more accessible. 🎉

  • install scoop: iwr -useb get.scoop.sh | iex
  • scoop install git-town

This is one of my favorite tools for git workflow. If you use GitHub flow to keep a simple workflow, it’s a life saver.

For example, on a branch and need to start a new bit of work to keep your commits atomic? switch to master > stash pending work > pull latest with rebase > create new branch > push branch to remote OR …

  read more

2020-06-29T18:29:03+00:00

Visual Studio Code has a pretty great way to browse through themes by just selecting installed themes and using arrow keys to preview without apply. However, browsing those themes isn’t quite so good, as you need to install to see the changes.

Ran across [Vscode Themes](https://vscodethemes.com/ https://bit.ly/2NHNsMW “Vscode Themes”) which provides a really nice experience if you feel like changing things up on your editor.

  read more

2020-06-24T16:03:49+00:00

After using Windows versions of launchers that tried to emulate Alfred , I finally took the plunge and bought Alfred’s Powerpack. The buyer remorse of paying > $60 on a “shortcut” app hasn’t really set in as I’m seeing such a wealth of great features that I think the gains as a developer and shortcut aficionado will be well worth the cost in my workflow. So far, highly recommend. The best part for me is the easy plugging in of bash/pwsh scripts to execute on …

  read more

Azure Data Studio SQL Notebook for Diagnostic Queries

Diagnostic Queries

Glenn Berry has long been known for producing the definitive diagnostic query set for various SQL Server versions. Between his amazing work and my favorite Brent Ozar First Responder Kit, you are pretty much set.

One of the things that can be painful though about running diagnostic queries is that it’s a lot of small individual queries that you want to run and ideally save the results for review.

You can do this with dbatools and running queries individually, which is …

  read more

My Experience Switching To A Macbook Pro From Windows

update 2021-05-19

updated with fresh thoughts

Regarding stability issues, I’d say those initial stability issues haven’t continued, so I’m very happy with the overall stability. The only thing that really gave me pain was DisplayLink drivers, which seem to always be a pain on Windows or MacOS.

My background

My …

  read more

2020-06-17T22:32:32+00:00

Here’s a cool way to visualize runspaces and how they work asynchronously.

1
2
3
4
5
6
$IndentLevel = 2
Get-Random; @(1..100) | ForEach-Object -Parallel {
    $i = $_
    Start-Sleep -Milliseconds (Get-Random -Minimum 100 -Maximum 1500)
    "{0,$($i * $using:IndentLevel)}" -f $i | Write-Host
}

The random delay can help show how some tasks finish out of order. For example, running that might result in this in the console:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
       4
 1
     3 …
  read more

2020-06-10T22:43:37+00:00

Set an environment variable export DOCKER_BUILDKIT=1 to enable a much cleaner Dockerfile output when you don’t need verbose debug level information. Reference: Buildkit

2020-06-05T20:06:36+00:00

brew install micro resulted in my finding what I think will be my new go to cli editor. Very impressed so far. I’ve got too many things to learn to be fluent in vim, and this cross platform cli tool might be my new best friend for more command line-fu. Micro

2020-06-04T22:15:21+00:00

  • add dev container configuration for Go project in Visual Studio code
  • Added docker compose file
  • Add SQL Server to compose as another service.
  • docker-compose up -d
  • Attach to running container in VSCode
  • Magic ⚡

Now I can open Visual Studio Code and run a go project against SQL Server, and tear it all down as I want. Gonna definitely blog on this, as it’s super cool to see this work so well.

While Docker has a steep learning curve, being able to have a full clean dev test environment with …

  read more

2020-06-02T19:22:51+00:00

The GitHub logo is an octopus with ears… not a cat.

Mind blown. 🤯

2020-06-02T17:53:51+00:00

Quickly install Git Town using bash in Ubuntu container with the following:

2020-05-29T22:16:02+00:00

Iterm2 is just beautiful. What a fantastic tool with so many usability features.

2020-05-19T17:27:31+00:00

Migrating from Windows 10 to macOS for professional use this week. So far the most painful things have been:

  • Pretty rough experience getting displaylink to work, definitely not as plug-and-play as Windows.
  • Shortcuts! I’m a serious shortcut fanatic. The difference in control/command/alt usage on on a mac is painful to my muscle memory and coding flow. Trying to not remap to windows based keys, but it’s been hard.
  • Window management. I’ve used divvy and tried some other’s, …
  read more

2020-05-17T16:32:48+00:00

Digging the guitar tone in this. Need to break out my Line6 Helix now. 🎸

2020-05-15T16:09:22+00:00

✔ Animated a fuzzy tickle creature.

✔ Rescue a bird stuck in a vent

✔ Begin DevOps yaking shaving session

2020-05-13T03:36:28+00:00

Jedi: Fallen Order has the most linear gameplay I’ve done in a while. View map, get object, run for 15 mins to get back to beginning of map. Rinse and repeat. Feels like I’m back to Skyrim and endless walking. I think Dying Light ruined me with it’s parkour and movement dynamics that made everything feel so immersive.

2020-05-07T22:54:34+00:00

Kept getting an error Incorrect syntax near the keyword 'read' when running the some updated PowerShell 7 in lambda with the dotnet3.1 sdk. Was troubleshooting loading types thinking I was having path issues.

Turns out one of these things is not like the other. 🤣

1
2
set nocount on
set transaction isolation read uncommitted
1
2
set nocount on
set transaction isolation level read uncommitted

I think this explains why “error during “read”. Maybe I should have run in …

  read more

2020-05-07T04:19:31+00:00

GitHub Codespaces was announced today. I’ve been a believer in this for a while now, and have been on the early access testing of online.visualstudio.com. Apparently it’s renamed to Visual Studio Codespaces now, and is the same tech. Will be a while before this trickles out to be mainstream, but as an early adopter of “developer workspaces as code” it’s an exciting time.

The fact that I can now spin up with a couple text files a full development test environment, …

  read more

2020-05-05T20:12:01+00:00

Finally got atomic algolia to work in CICD for my hugo blog. I’ve tried tackling this in many ways over time, but this finally just worked with plug and play ease thanks to just adding a line to the hugo build netlify.toml file.

If you want to try this out, assuming you’ve already got an algolia index, json file generated and all… then just:

  1. Setup env variables in netlify build
  2. Add the following line to your netlify production build script
1
2
echo "Starting …
  read more

2020-05-05T17:33:00+00:00

If you want to simplify keeping up with github releases instead of using email, try the GitHub slack app. Simple create a releases channel and then run these two steps:

  1. /github subscribe terraform-providers/terraform-provider-terraform
  2. /github unsubscribe terraform-providers/terraform-provider-terraform issues, deployments, statuses, public, commits,pulls

This should result in a final message saying:

1
2
This channel will get notifications from …
  read more

2020-04-30T05:26:32+00:00

Got some use out of the new beta plugins for netlify.

I added a link checker task and it ran over 2000 internal tests to ensure all internal resources such as images, internal links, and even css assests all correctly were found. 🧹

That’s a great idea for static sites. Incremental maintenance always is better than trying to catch up after years of no upkeep.

Using Pester to Improve Operational Tasks

Taking the Time To Test

Requirements in a constant state of change set you up for failure.

Failure to work through requirements before starting can also increase the risk of failure.

Planning with defined acceptance criteria of work you are committing to is not about filling in more documentation and work that no one cares about. Properly defining the acceptance criteria for yourself is about the exploratory process that defines and limits the scope of the work to deliver the minimum viable …

  read more

Improved Windows Terminal Setup

I’ve long been a Cmder/ConEmu user for Windows as it’s provided a much-needed improvement of the standard Windows terminal.

I’ve started trying to use the newer Windows Terminal project to benefit from the improved performance and support, and found getting it up and running with any customizations was a little time consuming and confusing. This wasn’t something I’d hand off to someone who wasn’t looking for experimentation.

So here it goes! Rather than …

  read more

A Smattering of Thoughts About Applying Site Reliability Engineering principles

What’s This about

I figured I’d go ahead and take this article which I’ve gutted several times and share some thoughts, even if it’s not an authority on the topic. 😀

In the last year, I’ve been interested in exploring the DevOps philosophy as it applies to operations as well as software development. I originally started various drafts on these concepts back before April 2019, but never got around to finishing it until now.

This isn’t a very focused post, more …

  read more

Quickly Create Github Release via Cli

Intro

I’ve been trying to improve modularization with Terraform. Using Terraform Cloud, you get a private module repository. The modules are linked to tags in git.

I’ve wanted additionally to specifically create releases for the versions in addition to the tags, to make tracking of usable versions a little cleaner.

There are several ways to do this, including using the GitHub API, npm modules, and more. I wanted a simple CLI tool to do this and ran across this great Go utility that …

  read more

Asciidoc Distributed Docs as Code

The Problem

  • I want to keep my code and my documentation in the same place.
  • I want to separate the presentation layer from my documentation content.
  • I want to be flexible to publish documentation to a variety of endpoints and formats as processes evolve, without my content being impacted.
  • I want to write a solid runbook for things that can’t be fully automated, but still include scripts and other code in their native format.

Documentation is such an important part of a developer’s …

  read more

Running SQL Server in Docker

Updated 2020-05-05

I’ve had lots of challenges in getting docker for sql-server working because I’ve wanted to ensure for my dev use case that there was no need for virtual volume management and copying files into and out of this. Instead, I’ve wanted to bind to local windows paths and have it drop all the mdf/ldf right …

  read more

2019

Contents

Getting Started With Python For Data Exploration

Intro

To get started with running python queries with SQL Server is actually pretty easy. I waited far too long to tackle this, thinking it was much harder than it turned out to be. Hopefully, this can be a good starting point for you as well.

Why would I want to do this?

When you use great tools like dbatools with PowerShell, you come to think that PowerShell is a first class citizen for working with SQL Server. This is true in regards to administration and general usage. However, data …

  read more

Improving the Quality of Your Automation Logging with Cowsay

Automation Taxes Your Sanity

You have to glue together systems with your amazing duct taped scripts.

You see failure after failure.

You want help predicting the success of your next run, so I’m going to provide you with an advanced artificially intelligent way to do this through the power of npm install.

NPM

1
2
3
npm install cowsay -g
npm install lucky -g
npm install catme -g
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
 _____________________________________
< Will my run succeed this time? …
  read more

Getting Started With Terraform

Updated 2020-07
  • Added comments about brand new Terraform users ignoring Terraform Cloud for first time tests.
  • Added comment about pulling credentials using data source instead of environment variables for AWS as a more advanced option to consider in the future.
  • Replaced details on creating terraform credential file with the new tf login …
  read more