All posts

2021

Go R1 Day 38

  • Worked on cross platform binary builds and CICD with GoReleaser.
  • Lots of container work here.
  • Started blog post on how to use GoReleaser.

Value Local Art

Our culture is driven on some much virtual comsumption of media and performances. It’s important to remember just how critical it is to support local art and performance.

In a YouTube culture, it’s easy to default to virtualized arts. I think it’s easy to lose the appreciation for the disciplined effort creating music, dance, art requires when it’s all just something on a screen.

It also gives an unrealistic expectation for live performances if our only consumption is the …

  read more

Dance Time

Uploaded a few to my gallery from time I had with my daughter watching her live performance this weekend. Take a peek.

I need to catch-up on a few posts with the family with all the great stuff they’ve been doing lately. (My son just got his black belt in Taekwondo 👏)

Dance Time

The Open Guide to Amazon Web Services

The guide you didn’t know you needed for AWS. Came across this when Corey Quinn 1 mentioned this on a podcast.

This is a resource I wish I’d known about earlier. It covers the core essentials on services, and cuts through the confusion of the AWS Docs pretty well.

For example, I noticed the ELB references for ALB docs and this caused me some confusion.

Right front and center on Load Balancer Basics 2:

Before the introduction of ALBs, “Classic Load Balancers” were known …

  read more

Cloudflare Analytics for Your Jamstack Site

A new alternative to Google Analytics if you want to keep things simple.

Cloudflare Web Analytics seems promising.

I’d probably have started with this if I was setting up my site from scratch.

The problem I have with adopting a tool like this is no basic import of metrics from Google Analytics means I’d lose years of history.

Does the history matter signficantly? Not really for me. I just don’t like losing out the entire history to see how things have improved over time.

  read more

Make Vscode Annoy Me When I Make a Typo

Not sure why, but I’ve had 2 typos that keep plauging me.

  • ngnix should be nginx
  • chocolatey should be chocolatey

With Go, I get compile errors with typos, so no problem. With PowerShell or Bash, this can be really annoying and waste time in debugging.

You can configure many autocorrect tools on a system level, but I wanted a quick solution for making it super obvious in my code as I typed without any new spelling extensions.

Install Highlight: fabiospampinato.vscode-highlight 1

Configure …

  read more

Azure Devops PR Automation Requires Generic Contribute

Big fan of renovate for terraform dependency management.

Ran into some complications with restarting an onboarding with Whitesource Renovate in Azure DevOps Repos and the Azure Pipeline automation. I’ve run into this before, so logging this for my sanity.

  • If you failed to onboard with Azure DevOps, you can’t rename the PR like in GitHub to simplify restarting the onboarding process.
  • Instead, delete the renovate.json file and commit to your default branch.
  • Then re-add and get the …
  read more

Hackattic

Came across this pretty nifty site HackAttic that provides a small set of practical oriented exercises. Will look at using further in my Go journey, as seems really useful to stretch one’s development skills in less familar, but still practical ways.

A few of the challenges:

  • Generate an SSL certificate according to given data.
  • Extract some data from Redis. In a way.
  • Handle some incoming JWTs for us.

Take a look at the newsletter topics covered. I love that sense of humor.

  read more

Diagrams as Code

It’s not for everyone.

I prefer to write diagrams out logically and then let the visual aspect be generated.

This helps me by making the visual presentation an artifact of what is basically a written outline.

I’ve learned that communicating flows of information can often be better presented visually than trying to write them out, especially once it involves more than a few “nodes” of responsibility. Visualizing a complicated process can be …

  read more

Go R1 Day 37

  • initialized new start of cli tool to try to parse markdown content using Goldmark1 and then convert markdown links into reference style links
  • Improved default template for starting new basic cli tools with Go to include zerolog and run based design instead of the majority of logic being in main.
  read more

Go R1 Day 35

  • Worked with Taskflow a bit more.
  • Need to identify better error handling pattern on when to resolve vs handle internal to a function, as it feels like I’m doing needless error checking.
  • Wrote func to run terraform init, plan, and apply.
  • This takes dynamical inputs for vars and backend file.
  • Also dynamically switches terraform versions by running tfswitch.

Definitely more verbose code than powershell, but it’s a good way to get used to Go while achieving some useful …

  read more

Go R1 Day 34

  • figured out how to import util/logger.go as a package
  • after much confusion due to logger, log, *zerolog.Logger and more variables all deviously similar in name… how to pass around the initialized package logger that I configure.
  • learned that global scope and package scoped loggers being initialized at run is concerned an anti-pattern
  • properly wrapping to avoid the log initialization on import with type Logger struct { logger: *zerolog.Logger; } as an example avoids the same …
  read more

Go R1 Day 33

  • successfully created logging package using zerolog
  • learned about scoping with packages
  • linked to a private internal repository and how to leverage the module replace operator to temporarily alter path import from url to local override.
  • middleware is a newer concept, so I need to learn more on this later so I can understand how to use to inject special log handling for http requests and other actions.

Thoughts for today are that the pressure of jumping into an existing codebase is …

  read more

Go R1 Day 32

  • created some structured logging improvements with zerolog
  • began exploration of middleware concepts for logging
  • generated test stubs using gotests

Go R1 Day 31

  • Learned a bit about idiomatic patterns wtih error handling.
  • Learned about inline block intiailization of variables using if err := method(); err != nil {...} approach.
  • Considered a bit more idiomatic patterns when I noticed excessibe nested if blocks.
1
2
3
4
5
6
tfdir := tf.Params().String("tfdir")
if tfdir != "" {
  tf.Logf("tfdir set to: [%s]", tfdir)
} else {
  tf.Errorf("🧪 failed to get tfdir parameter: [%v]", tfdir)
}

This would probably …

  read more

Go R1 Day 30

  • Built some go functions for build tasks work with terraform and setup of projects using taskflow.

Learned one one to pass in arguments using slices. I’m pretty sure you can use some stringbuilder type functionality to get similar behavior, but this worked fine for my use case.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
cmdParams := []string{}
cmdParams = append(cmdParams, "-chdir="+tfdir)
cmdParams = append(cmdParams, "init")
cmdParams = append(cmdParams, …
  read more

Go R1 Day 29

  • Evaluated Mage as a replacement for bash/pwsh based tasks for automation with Azure Pipelines.
  • Was able to get terraform to run with dynamic configuration using the following approach:

Install with

1
2
3
4
5
go get -u github.com/magefile/mage/mg
go mod init mage-build
go get github.com/magefile/mage/mg
go get github.com/magefile/mage/sh
go mod tidy

Then to get mage-select run:

1
2
3
GO111MODULE=off go get github.com/iwittkau/mage-select
cd $GOPATH …
  read more

Azure Pipelines Template Iteration

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.

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 …

  read more

Git Workflow With Git Town

Git-Town

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.

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 …

  read more

Go R1 Day 28

  • 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

  • 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 😄)

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

  • 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

  • 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

  • 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

  • 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

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 …

  read more

Go R1 Day 22

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.

  read more

Go R1 Day 21

  • 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 …

  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

The source code for this repo is located here:

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).

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

  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

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.

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

  read more

Go R1 Day 17

  • 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.
  read more

Go R1 Day 16

  • 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 …
  read more

Filtering Results in Go

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 …
  read more

Go R1 Day 15

  • 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

  • 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

  • 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(). …
  read more

Consider the Benefits of Powershell for Developer Workflows

  • 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 😁)
  • 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 …
  read more

Improving Local Development Workflow With Go Task

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.

This is not …

  read more

Quick Start to Using Influxdb on Macos

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 .

Grabbed this from a comment …

  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

  • 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” …

  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 start …

  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

  • 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 …
  read more

Go R1 Day 8

  • 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 …
  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

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? 😁

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 …

  read more

Go R1 Day 7

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

Go R1 Day 6

  • 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, and …

  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

  • 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 …
  read more

Go R1 Day 4

  • 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 …
  read more

Go R1 Day 3

  • 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 …
  read more

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

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 …
  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

  • 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
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

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

  • 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

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 …

  read more

Compiling a Custom Provider and Including for Terraform Cloud

  • 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 ☁.

For Terraform …

  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

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 …

  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 …

  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. 🤯