All posts

2024

Improve Language Matching in Vscode

Let’s say you have the Red Hat YAML extension. This does a great job with formatting and validation.

However, other directories contain files for Azure DevOps Pipelines that are also yaml. You can tweak the matching logic based on common paths you’d use and get those to default to a different language.

1
2
3
4
5
6
"files.associations": {
"*.json5": "json5",
"CODEOWNERS": "plaintext",
"*.aliases": "gitconfig", …
  read more

2023

Chunnel, Train, and Pubs

I want to travel by train more. It’s not standard in the US.

Room for my legs, minimal lines & boarding drama.

They just take off without having everyone put their seats in the upright position.

The first few minutes had a wonderful English lady great the children (fellow traveler) and made the kids feel welcome.

Walk down the street, enter a restaurant that had the name “Coffee” in it that turns out to be a pub.

Noisy with a …

  read more

Easiest Way to Run Local Ai

Ollama makes this really easy. I’ve tried a few options to have local code generation tooling available, and this took the cake for wrapping up localized model running.

I’ve got 64gb of ram on my M2 Max Macbook, so I can just run ollama run llama2:13b and get a local model up and ready to use.

If you are like most of humanity and want less resources taken up, try just ollama run llama2.

Connect this to Continue and you’ve got a local coding assistant. It’s click and go to …

  read more

St Michel to Versailles

We set off in the car to explore Saint Mont Michel. After a beautiful cruise in the rental at 130kph, we arrived. The parking lot was huge, reminding me of a smaller version of a Six Flag Over Texas. A single bus picked us up and took us to the site. This bus is one of maybe 2 actively in rotation, with a max capacity of 68.

I can’t even imagine how insane this journey would have been during peak season. There’s no way I’d recommend it during a …

  read more

Differences in France To My Expectations

Also feels like this isn’t true. While it may be a bit more than the US, which I’d normally greet a small shop owner if we made eye contact, it’s also the same here. Being pleasant goes a long way.

Haven’t seen any case personally where a look was given because of a lack of a greeting, mostly people are busy doing their work and don’t pay you attention.

From online material, I had the impression that French folks dressed …

  read more

Parisian Rain, Gluten Free Grains, and Basilica Lanes

Today, I took Karis out for a bit of spontaneity. We decided to go down to Copains, a bakery about 30 minutes away, taking the D train followed by Metro 2. As we walked up the idyllic streets, wet with Paris rain, Copains stood out, bright and cheerful in contrast to the surrounding shops. Its layout was beautiful, reminding me of a minimalist, modern style with plenty of space that could have been used for café tables, but was instead just empty. A mosaic-style ceiling …

  read more

Potato Chips Taste Better in France

Most of the basic foods lack the same preservatives, food dye, and corn syrup that we commonly have in non-speciality foods in Europe. Lays potato chips at the local market are “natural” and contain far less salt and really taste great.

Lower your expectations with spice though. Last salsa I tried was tomato paste. I asked for the Thai medium spice and it’s like a desert.

They seriously must not like their taste buds to tingle like us Texans.

I’m going through taco …

  read more

First Week in Paris

Here’s a bit from the first week. We were pretty exhausted from jet lag so I’ve delayed posting, but figured better something now than to keep on delaying. Enjoy!


Karis’ Entry: We went to a bakery the first full day here in Paris, France. After the bakery, we enjoyed our food at a park. I had a delicious glazed croissant chocolate. Then, as if on cue, a double rainbow appeared. It was amazing - the new double rainbow people! At a bus stop, I caught my first …

  read more

Ventilation Systems

Got sucked into reading about ventilation systems in Europe. There’s mechanical and passive based ventilation. I’ve lived most of my adult life where central air systems are used, that it took me a day before I registered the oddity of:

  • no ceiling vents
  • the constant whoosh of air in the bathroom1
  • the seeming airflow from about the full length doors.

While I’m betting this would be a subpar experience in summer compared to what we have in Texas, during less heat induced times …

  read more

An Unexpected Supporter of the Paris Sanitation System

Somtimes you feel that you’ve done things right as a parent, even when things go awry. There we were at the park, kids needing a restroom break. Inside, I find no toilet paper, everything broken down, a poor public restroom experience.

Coming out, I see my family on the steps of this Parisian public edifice. I comment on the bathroom’s state.

Me: They were gross. No toilet …
  read more

New York - First Visit

Now that I’ve left New York, here’s what I had started capturing.

Ella: She’s too tired right now to narrate, but there’s a few funny highlights from her day. One of the challenges I gave the kids was to find the first official New York City rat. Ella scored the first point and was very proud of that. She also spent much of the day chasing pigeons and generally being a rascal. Of all the things she noticed, it was stuff like a pair of tennis shoes hanging from a cable …

  read more

Region & Language Defaults

Language defaults seem to be an interesting mix when it comes to websites. The results that show up for a different search region can also be different based on Google’s docs Search Region

One video streaming site refused to show me subtitles in English without me using a VPN to appear as a US member. My quick search through some posts on reddit and the like show this can be a really inconsistent mess depending on the site.

  read more

Leveled Up With Truck Driving

I bought my car, a 2010 Mazdaspeed3, without knowing how to drive a manual tranmission. Thanks to my buddy Jake driving it home, we brought it back. I got a late night crash course in a parking lot, and this saw me through the first month.1

I might have killed the engine a few times2.

So this last week, I drove another stick for the first time. Despite all this time, I realized I’d only driven my Mazdaspeed3. It’s a very touchy and tight sports clutch.

I had to dry a 1998 Ford F150 …

  read more

Alexa Customization

This bugged me for a while, as it random notifications were intrusive in when I was working.

Remove the marking notications by going to Alexa app, settings, notifications, and then turn off any categories you don’t want to be annoyed with.

How Many Commits Did You Make in Last Month

Been playing with opencommit and wanted to assess how much using it on every single commit I still could track locally might cost me.

This script loops through all the ${HOME}/git directories and totals the commits made in last month.

Looks like using OpenAI’s api would cost me about $4-$5 if I’d used on every single commit and the size of the commits was smaller.

Not as bad as I’d thought it would be.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 …
  read more

O'Reilly

Creating a new chrome alias so my typo doesn’t keep annoying me. I’m lucky enough to have access to O’Reilly Books through $work.

Problem is everytime I google it I keep letting my autocomplete show me O’Reilly Auto. 😄

Digital Garden Released

Split my blog into notes.sheldonhull.com for evergreen note taking and reference content. I’ll still maintain this blog for posts.

Mkdocs allows a minimal friction to publishing and previewing. The directory structure is built automatically from directories.

While I love Hugo, it’s more work to maintain small reference pages so I’m going to split up my notes more like a “digital garden” approach.

  • Free hosting through GitHub.
  • 60 seconds from push to page refresh. …
  read more

2022

Amply Repaid

That’s how children reward you for having them. They are such a responsibility and such a miracle at the same time, that the miracle of the relationship you can have with them amply repays you for the responsibility, if you can only see it. But then you have to go into the depths and take that relationship as a sacred reality and ethical requirement. And you deal with those things casually at your great peril. - Jordan Peterson1

This was a beautiful quote that I had to capture from …

  read more

To Get a Cup of Coffee

  • Take the car into shop to get state inspection that’s overdue, since I don’t drive it much.
  • Find out a check engine light fails the test.
  • Drive towards grocery store near house, and hit a long line of traffic.
  • Decide to be a dilligent budgeter and pick up milk instead of buying coffee.
  • Train decides to park at road I have to cross.
  • Go to gas station, grab milk.
  • Arrive home.
  • Make coffee.

Sometimes working from an office has it’s advantages, especially those fancy places with …

  read more

Check Azure Devops Pr for Conventional Commit Title

  • Is it needed… No.
  • Is it the only way… No.
  • Is consistency better than inconsistentcy, mostly yes.

I’ve used conventional commit most of my career and it’s a fine basic standard, even if sometimes it feels strange as you get used to it. I think it’s far better than inconsistency and is common enough with tooling you can do some nice release, changelog, and versioning with it.

However, getting folks used to it can be tricky. I’m a big …

  read more

The Pulumi Verdict So Far

  • Pulumi is like a muscle car. Great if you want full control, power, and flexibility.
  • Pulumi is fast.
  • Has actual loops. Sorry HCL… Your loops are just confusing.1
  • Pulumi is like a rally car. You will be traveling a gravel road that might result in a few bumps and potholes. It can handle it. However, there are things (just like HCL had/has over time) you’ll run into that don’t make sense or are bugs, but since it’s younger there …
  read more

Using Randomization for Pulumi Kubernetes Resources

Pulumi requires unique logical names (URN) for tracking the state of resources. I ran into an issue with this once I expanded to a multi-cluster deployment since Pulumi began erroring on the logical name not being unique. Let’s say you are defining a service:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
_, err = corev1.NewService(
		ctx,
		"myservice", // 👈👈👈👈 this is the logical name
        &corev1.ServiceArgs{
            ApiVersion: pulumi.String("v1"), …
  read more

Remove Pending Operations From Pulumi State

If you need to work through some issues with a deployment and remove a pending operation in Pulumi state file, you can do this pretty easily manually, or save a quick bit of scrolling and use gojq (or jq if you want).

  • Export: pulumi stack export --file state.json
  • Align formatting: cat state.json | gojq > stateFormatted.json
  • Remove pending operation: cat stateFormatted.json | gojq '.deployment.pending_operations = []' > stateNew.json
  • Now you can compare the results without any whitespace …
  read more

Pulumi Secrets

Secrets with infrastructure are a problem.

  • I want to source control my secrets, and deploy via CD.
  • I want to use infrastructure-as-code to define my configuration, including secrets.

But I don’t want to expose the values at any stage during this. I want to keep them in a secret store, and only expose them when I need them, but I still want to manage them via code.

For a while I’ve done a blend of loading local environment variables or creating manually in a …

  read more

Go Templates With Kubectl

An alternative to using jsonpath with kubectl is go templates!

Try switching this:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
kubectl get serviceaccount myserviceaccount --context supercoolcontext --namespace themagicalcloud -o jsonpath='{.secrets[0].name}'
```

To this and it should work just the same.
Since I know go templates pretty well, this is a good alternative for jsonpath syntax.

````shell
kubectl get serviceaccount myserviceaccount --context supercoolcontext --namespace …
  read more

Reflex for Quick Filewatching Commands

1
go install github.com/cespare/reflex@latest

Then you can run a command like:

1
reflex -r 'nginx.conf' -- curl -v -L http://127.0.0.1:8080 2>&1 | grep -i "^< location:\|HTTP/1.1"

You should see triggered output from the command whenever the file is saved.

Nice work @cespare. Found this pretty useful to speed up testing cycles with some cli tools.

Follow: Caleb and twitter for more cool Go magic.

  read more

My Job

Acted like I wasn’t going to go to work today with my 4 year old daughter. She looked over at me and told me I don’t have to go somewhere, I just walk up the stairs. “Your boss will want you to go to work today”. Very astitute, I observed.

But what do I do when I go to work? Do I fix cars, construction, or other things?

She looked at at me and said I put on my headset and talk to people about important stuff.

No cool computer hacker cred for me today.

  read more

Pulumi Round 2

This is not a comprehensive article, but more a log of the issues and wins as I work through Pulumi adoption.

  • Pulumi is pretty powerful.
  • Once you get beyond the basics, it requires a lot of effort since the tooling doesn’t have as many examples as I’d hope. This is especially true for Kubernetes. It’s a lot easier to get moving on other providers.
  • It’s more intensive of a pilot to do complex things IMO than Terraform, because you aren’t getting pre-built …
  read more

2021

Helm Is Like Hugo

Turns out helm is pretty intuitive if you already have been working with something like Hugo, which is Go template driven.

Was able to convert an entire K8 stack to helm with a couple hours of work and render everything.

I have this problem of trying to avoid percieved complex tools in an attempt to reduce “another tool” syndrome for others I work with. Sometimes, it’s important to keep in mind who is editing and doing the majority of the work, and not worry as much about the …

  read more

Go R1 Day 86 - Wrap Up!

Done! I’ve pretty much done above and beyond 100 days, but finding the blogging format to take a lot more effort to keep up when I’m doing a mix of puzzles, courses, and work.

Since my full-time job has Go development as a part of it now, I’ve exceeded this and going to track any future training goals in a lower overhead way, such as GitHub issues or such.

Yes, it was worth it. It helped me break down a large amount of learning back into a …

  read more

Setup Sourcegraph Locally

I went through the Sourcegraph directions, but had a few challenges due to the majority of code being behind SSH access with Azure DevOps.

Finally figured out how to do this, with multiple repos in one command and no need to embed a token using https.

Navigate to: manage-repos and use this.1 Better yet, use Loading configuration via the file system (declarative config) - Sourcegraph docs and persist locally in case you want to upgrade or rebuild the container.

{
  "url": …
  read more

Docker Healthchecks for Spinning Up Local Stacks

I’ve used a few approaches in the past with “wait-for-it” style containers.

Realized there’s some great features with healthchecks in Docker compose so I decided to try it out and it worked perfectly for Docker compose setup.

This can be a great way to add some container health checks in Docker Compose files, or directly in the Dockerfile itself.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42 …
  read more

Go R1 Day 85

🎉Finished Ultimate Syntax course.

Worked on Enumerators concept using iota.

I still find this very confusing in general.

Here’s the gist I created.

Go R1 Day 84

Ultimate Syntax (Ardan Labs - Bill Kennedy) and went back through various topics such as:

  • Pointers: One thing mentioned that resonated with me was the confusion regarding pointers in parameter declarations. I also find the usage strange that the deference operator is used to denote a pointer value being dereferences in the parameter. I’d expect a pointer value to pass clearly with func (mypointer &int) and not func (mypointer int) with a pointer call.
  • Literal Structs: …
  read more

Thermal Throttling Mac Intel Woes

I lost roughly half a day in productivity. CPU hit 100% for an extended period, making it difficult to even use the terminal.

Initially, I thought the culprit was Docker, as it was running some activity with local codespaces and linting tools. Killing Docker did nothing.

Htop pointed out kernel as the primary hog, and you can’t kill that.

After digging around online, I found further mentions about charging on the right side, not the left to avoid thermal issues causing CPU throttling.

The …

  read more

Go R1 Day 83

Revisited Ultimate Syntax (Ardan Labs - Bill Kennedy) and went back through various topics such as:

  • Variables: When to use var vs walrus operator for readability and zero value initialization.
  • Type Conversions: How identical named types aren’t the same in Go’s eyes when named.
  • Pointers: General overview. Mostly stuff I knew, but good basic overview again.
  read more

Keyboard Remapping in Goland

This is a continuation of my evaluation using Goland.

I tend to be a VSCode user primarily, but am working on adopting Goland incrementally to leverage some of it’s features that work a bit more consistently (like refactoring).

Losing keyboard shortcuts is painful.

VSCode lets you assign keyboard shortcuts in command pallette by clicking on the gear icon in the command you hover over. For a while I couldn’t find this in Goland. I see now I can assign any action defined from the quick …

  read more

Go R1 Day 80

Built a Mage task to handle creation of Azure DevOps pull requests. Since the tooling out there is primarily around Github, this was useful to help standardize PR creation with autocomplete, conventional commit naming, and other properties that typically require manual changes. I found a great little TUI components library that simplified using Bubbletea components: Promptkit.

In addition, noticed some new linting help from golangci-lint for varnamelen.

This was useful as it …

  read more

Go R1 Day 79

Felt like revisiting Exercism since the great updates and wanting a break from the more deep concept dives on mechnical sympathy and optimization in the Ultimate Go course (which is stellar).

Completed the following to continue on syllabus. It’s taking me back to basics, but stuff I can knock out pretty quick.

  read more

Go R1 Day 78

Scenario:

  • 2k stack for each goroutine.
  • 50,000 goroutines.
  • Eventually, you’ll want to make the function call and you’ll want to grow the stack if the current stack limit is hit.
  • We’ll want to use contigous stacks.
  • The new stack will be a new contigous allocated block of memory.
  • The stack growth requires all the prior values to be moved over to the new doubled stack.

A goroutine can only share values from the …

  read more

Go R1 Day 77

Been doing a ton the last month with golangci-lint tooling. I think this has been one of the most educational tools for learning Go I’ve come across. It has forced me to evaluate why issues are flagged, if they are opinionated preferences or best practices.

For example, wsl ensures that statements are not cuddled. This follows Dave Cheney’s writing about having an empty line seperate phrases of thought.

It’s a bit annoying to …

  read more

Go R1 Day 76

Lots of more technical detail on Memory & Data Semantics Section.

I value this as my background in databases means that things like Stack/Heap weren’t part of my education as much. This has been useful as there are new concepts, paradigms, and ways of thinking and it’s providing a lot more foundational concepts for me to better understanding the system and compiler behavior in Go.

  • Stacks are self-cleaning …
  read more

Go R1 Day 74

  • Worked with DynamoDB schema (NoSQL Document database).
  • Invoked local lambda function using Docker and also remove invocation with serverless invoke. This took a bit of work to figure out as the parameters weren’t quite clear. Upon using --path for the json template I got from AWS Lambda console, I was able to to get to invoke, and stream the logs with --log.
  • More mage magic with promptui and other features, so I can now test a full tear down, build, publish, and invoke a test …
  read more

Go R1 Day 73

  • I’m more on day 90+ but haven’t made the time to log it.

  • Been working a ton with Mage and have some really cool work I’ll be writing up soon, including using for health checks on projects, setup of core tooling, encoding credentials, and more. 💯

  • Also been working heavily on Go mono-repo module structure and some serverless based architecture tests that will make a fun write-up. I’m thinking of a demo of “Disappointment as a Service” with a …

  read more

Go R1 Day 72

  • Learned more on “mechanical sympathy” related to Go and memory management.
  • How the Go compiler works related to frames with memory allocation.
  • Built Mage tasks for licensing and validating problematic licenses aren’t included in a project.
  read more

Go R1 Day 71

  • Learn Go With Tests -> Using select with channels to wait for multiple goroutines.
  • Of particular interest is this:

Notice how we have to use make when creating a channel; rather than say var ch chan struct{}. When you use var the variable will be initialised with the “zero” value of the type. So for string it is “”, int it is 0, etc. For channels the zero value is nil and if you try and send to it with <- it will block forever because you cannot send …

  read more

Go R1 Day 70

  • Concurrency section wrap-up with Learn Go With Tests.
  • Reviewed material learned from: Go R1 Day 61
  • Read material, but didn’t do a lot of tests on this, per mostly concept oriented. Used concurrent progressbar example from uiprogress project to test concurrent UI updates.
  • My last concurrency test case was to launch many concurrent processes for a load test. This didn’t leverage goroutinues as typically used, since it was calling to an executable on the host machine. …
  read more

Go R1 Day 68

  • Did exercism.io for gigasecond puzzle.
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
package gigasecond

// import path for the time package from the standard library
import (
	"time"
)

// gigasecond represents a very very very small portion of a second.
const gigasecond = 1000000000

// AddGigasecond adds a very very very small portion of a second called a gigasecond to a provided time input.
func AddGigasecond(t time.Time) time.Time {
	gcDuration := gigasecond * …
  read more

Go R1 Day 67

Built functionality in my blog repo to create a new 100DaysOfCode post using Mage. This provides an interactive prompt that automatically tracks the days left and increments the counter as this progresses.

  • ingest toml configuration
  • unmarshal to struct
  • update struct
  • marshal and write back to the toml configuration file
  • replace matched tokens in file
  read more

Go R1 Day 66

This wasn’t specific to Go, but was the first step towards using Go in a distributed test.

I had an interesting project today with my first development level effort using Kubernetes. Here’s my log of attempting to use Getting started with Dapr | Dapr Docs and getting two Go APIs to talk to each other with it.

First, what is Dapr?

Dapr is a portable, event-driven runtime that makes it easy for any developer to build resilient, stateless and stateful applications …

  read more

Go R1 Day 65

  • Built mage tasks for go formatting and linting.

Using this approach, you can now drop a magefile.go file into a project and set the following:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
// +build mage

package main

import (

	"github.com/magefile/mage/mg"
	"github.com/pterm/pterm"

	// mage:import
	"github.com/sheldonhull/magetools/gotools"
)

Calling this can be done directly now as part of a startup task.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
// Init runs …
  read more

First Pass With Pulumi

Instead of learning a new domain specific language that wraps up cloud provider API’s, this let’s the developer use their preferred programming language, while solving several problems that using the API’s directly don’t solve.

  • Ensure the deployment captures a state file of the changes made.
  • Workflow around the previews and deployments.
  • Easily automated policy checks and tests.

This can be a really useful tool to bring infrastructure code maintainability …

  read more

SweetOps Slack Archive

Just wanted to give props to the Cloudposse team lead by Erik Osterman @eosterman.

Slack provides a great community chat experience, but there are quite a few problems about using it for Q&A. 1 Since the free plans for communities hide content over 10,000 messages, a healthy community will go over this quickly.

With all the great conversations, I want to find prior discussions to benefit from topics already covered.

Cloudposse archives the community discussions so they can be searched. …

  read more

Go R1 Day 62

  • Worked with mocks.

Still using the is package to test.

1
2
3
if !reflect.DeepEqual(want, spySleepPrinter.Calls) {
  t.Errorf("wanted calls %v got %v", want, spySleepPrinter.Calls)
}

was replaced with:

1
is.Equal(spySleepPrinter.Calls, want) // spySleepPrinter shows correct order of calls

Go is messing with my head with how everything gets simplified to the lowest common interface when possible. Instead of buffer, I’d want to use io.Writer for example. …

  read more

Go R1 Day 61

It was a dark and stormy night. The world was bleak. A command was sent to The Compiler.

The assumptions were flawed. The command was rejected.

You have given me an invalid command with -argument-that-shall-not-work 5 being invalid.

But I’ve provided --argument-that-shall-not-work, the indomitable wizard said.

Your command is unworthy.

Digging into esoteric tomes of knowledge, the wizard discovered others have had similar issues when calling external processes using the …

  read more

Go R1 Day 60

  • Finished up the basics of dependency injection and how this helps with testable code.
  • Worked through concurrency test using channels and go routines. This will take a bit more to get comfortable with as there is a variety of concepts here. My initial attempts finally started working using an anonymous function, but couldn’t finalize due to some issue with launching the parallel executable being called. Not sure why the --argname seemed to be trimming the first dash from the …
  read more

Go R1 Day 59

  • Built some Mage tasks for setup of local projects.
  • Used retool post from Nate Finch with Mage project and found it promising to vendor Go based tooling into a local project and not rely on the global package library.
  • Created magetools repo to house some basic general mage tasks I could share with other projects.
1
2
year, month, day := time.Now().Date()
dateString := fmt.Sprintf("%d-%02d-%d", year, month, day)

Use padding in the Sprintf call to ensure a date comes …

  read more

Go R1 Day 57

  • Did some adhoc work in this repo (the hugo repo that contains this blog) testing out Mage, which is a Go based Make alternative.
  • Generated dynamic target directory for hugo posts using stringify for kebab case.
  • Unexpected behavior when generating dynamic file path including date.
1
2
3
year, month, day := time.Now().Date()
str := stringy.New(title)
slugTitle := strings.Join([]string{string(year), string(month), string(day), str.KebabCase("?", "").ToLower()}, …
  read more

Go R1 Day 56

  • Worked on ci-cd pipelines for Go apps.
  • Learned a bit more on building Azure Pipeline templates to use with Go, learning a bit from SignalFx and how they did it.
  • Read more on semver versioning, and still can’t find anything as good as GitVersion
  read more

Go R1 Day 58

  • Avoiding a panic in Go for missing dictionary match is very straight forward. The error pattern for failed conversions and out of range index matches is the same, with: ok, err := action.
  • TODO: Figure out if ok to reference an error in a test by: is.Equal(error.Error(),"unable to find value in map"). Linter warns me with: Method call 'err.Error()' might lead to a nil pointer dereference.
  • Started work with dependency injection.
  read more

My Goland Log

This is a log of my second journey in using Goland from Jetbrains for Go development.

I’ve got VSCode in a great state. It’s flexible, powerful, and I’ve highly customized it to my workflow.

However, doing Go development, I’d like to better explore Jetbrains Goland and see if the experience proves positive.

I’ll log updates and issues here as I work through it in the hope that it might provide you better information if you are considering Goland as well. …

  read more

Go R1 Day 55

In Go, when you call a function or a method the arguments are copied. 1

  • Built some test cases for working with pointers and test methods.
  • Did this in Goland to become more familar with it and figured out how to use the nice tests explorer with a floating window to auto-test.
  • Built a filewatcher configuration watcher as alternative to tests panel, allowing automated run in terminal or output panel of go test ./....
  • Couldn’t figure out how to run every test in project, as …
  read more

Go R1 Day 54

  • worked with tests and Goland.
  • Modified table driven tests to remove hard coded test case inputs.

Steampipe Is Sql Magic

I tried Steampipe out for the first time today.

 Follow Steampipe On Twitter

I’m seriously impressed.

I built a project go-aws-ami-metrics last year to test out some Go that would iterate through instances and AMIs to build out aging information on the instances.

I used it to help me work through how to use the AWS SDK to iterate through regions, instances, images, and more.

In 15 mins I just solved the equivalent issue in a way that would benefit …

  read more

Go R1 Day 53

  • Troubleshooting on: typechecking loop that helped me learn a bit more on how the compiler parsing occurs. Quick fix was to simply change var logger *logger.Logger to var log *logger.Logger.
  • Read up on dependency injection concepts and clean architecture design.
  read more

Go R1 Day 52

  • published extension pack for Go1
  • Learned about magic number linter in golanglint-ci. For instance this would be flagged as a bad practice (while not applicable for a simple test like this, having a const makes sense in almost all other cases).
1
2
3
func Perimeter(width float64, height float64) float64 {
	return 2 * (width + height)
}
  • Learned a few extra linter violations and how to exclude including:
    • lll: for maximum line length
    • packagetest: for emphasizing blackbox …
  read more

My First Vscode Extension Pack for Go

Took a swing at creating my own extension pack for Go.

  sheldonhull/extension-pack-go - GitHub

This was a good chance to familarize myself with the eco-system and simplify sharing a preset group of extensions.

Setup the repo with a Taskfile.yml to simplify running in the future. If frequent updates needed to happen, it would be easy to plug this into GitHub actions with a dispatch event and run on demand or per merge to main.

Here’s the marketplace link if you want to see what it …

  read more

Go R1 Day 51

  • Did iteration exercise, however, I skipped ahead and did strings.Repeat instead of iteration because I’m lazy. 😀
  • Moved all tests into blackbox test packages.
  • Worked through variadiac functions.
  • Tweaked my VSCode autotest to run on save.
  • Further tweaks to golanglint-ci to reduce noise on linting checks.

  read more

Use Driftctl to Detect Infra Drift

Use Driftctl to detect drift in your your infrastructure. This snippet generates a html report to show coverage and drift figures of the target.

For multiple states, you’ll need to adapt this to provide more --from paths to ensure all state files are used to identify coverage.

1
2
3
4
5
6
7
8
9
$S3BucketUri = "terraform-states-$AWS_ACCOUNT_NUMBER/$AWS_REGION/$TERRAFORMMODULE/terraform.tfstate"
$Date = $(Get-Date -Format 'yyyy-MM-dd-HHmmss')
$ArtifactDirectory = ( …
  read more

Go R1 Day 50

At this point, I’m still struggling with the proper way to abstract a logging wrapper that calls a logging library. There’s enough boilerplate for setup of my preferred defaults in zerolog that I want to …

  read more

Go R1 Day 49

  • Learned about White-Box vs Black-Box testing. Apparently, you can access all indentifiers of a package if you use the same package name such as: package packagename. If you are testing as a consumer might be, then you can use package packagename_test for only accessing the exported identifiers.
  • Used examples in test file to provide self-documentation of how to use the method.
  • Worked further with golanglint-ci and found it challenging when working with multiple modules in …
  read more

How To Reduce Noise From Slack

Slack can be a really effective tool with asynchronous work, but the defaults aren’t great out of the box.

I want to get you a few tips on how to use Slack effectively.

Piping through release notifications, work-item updates, alerts and more can help you reduce context switching with other tools, but without proper control you’ll likely find it overwhelming.

Use sections to organize your content and customize the level of priority you want to assign to the …

  read more

Go R1 Day 48

  • worked through more test concepts with learn-go-with-tests, including test helpers.
  • enjoyed the results GitHub copilot was producing. I can see a lot of promise for speeding up things and reducing the need for snippets as it builds code suggestions on the fly with far more context than a general snippet could do.

  read more

Luminar AI

Update

Customer service bumped my older version of Luminar 3 to 4. The issues with distortion on the preview screen aren’t there with version 4.

The new AI enhancements aren’t there, so it’s missing some of the new features. For now I’m going to try and use this as my daily driver for images and see how it goes. …

  read more

Simplify Aws Developer Security With Leapp

Security can add overhead, get in the way, complicate development, generally can cause challenges to development efforts. The balance of security and usability is one that all development organizations have to deal with.

I could be ultra-secure by requiring carrier pigeon multi-factor authentication for my team, but I’m not sure that would be well received.

  read more

Go R1 Day 47

  • worked with lefthook to run golang-lint tools and discovered how vast the configuration for this was, simplifying many of the other linting tools that was running seperately.
  • created some goyek tasks for bringing up and down docker compose stacks.
  • learned that file.Close() shouldn’t be used with defer to avoid unsafe file handling operations.
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
// taskComposeDestroy tears down the docker stack including volumes
// this is …
  read more

Go R1 Day 46

  • At $work I focused on dockertest.
  • Modified the provided test statements to ensure autoremoval of container occurred on failure.
  • Had packet issues I couldn’t figure out this time, so shelved for now. packets.go:37: unexpected eof
  • At home, I played with bubbleteam a bit, and decided while an epic TUI interface, the framework is far too involved for what I want to mess around with at this time. For instance, it doesn’t provide multi-select, instead much of that is manually …
  read more

Understanding The Basics of SQL Server Security

As I’ve worked with folks using other database engines, I’ve realized that Microsoft SQL Server has some terminology and handling that is a bit confusing. Here’s my attempt to clarify the basics for myself and others needing a quick overview. This is not comprehensive coverage of security architecture, which is a very complex topic, more just terminology.

Note that it’s best to consider SQL Server as it’s own operating system, not just …

  read more

Go R1 Day 45

  • Worked through merging flags and the “run” approach from Mat Ryer.
  • Used ff for parsing.

The resulting logic seems correct with main being very simple with:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
package main
import(
    "io"
    "flag"
    "os"
    "github.com/peterbourgon/ff/v3"
    "github.com/peterbourgon/ff/v3/ffcli"
    "github.com/peterbourgon/ff/v3/fftoml"
)
const (
 // exitFail is …
  read more

Go R1 Day 44

  • Generated tests for Gorilla Mux and realized need more context and reading on how to properly test Gorilla Mux to avoid excessively mocking.
  • Reviewed two different paradigms for struct methods, using parameters and using global configuration objects.
  read more

Go R1 Day 43

  • Modified forked SharedBrain repo to use yaml parser instead of toml.
  • Modified tests handle invalid casting of interface, which was causing a panic.
1
2
3
4
otherDate, ok := otherDateInt.(time.Time)
if !ok {
  log.Printf("[time.Parse] probable invalid date format %s", plainFilename)
}
  • Improved tests to align to markdown standard formatting.
  • FOSS license scanned on 4 repos to test compliance of licensing for badge.
  • Use goyek templates to build out initial go based …
  read more

Go R1 Day 41

  • Enabled Go code coverage for tests in VSCode
  • go install github.com/jpoles1/gopherbadger@master to install tooling for generating code coverage badge for readme.
  • Set ![gopherbadger-tag-do-not-edit]() in the readme, and then this gets replaced with a code coverage percentage badge.
  • Generate the required code coverage reports using: go test -coverprofile cover.out followed by go tool cover -html=cover.out -o coverage.html for a visual report.
  read more

Go R1 Day 40

  • Learned a bit more modules vs packages, including internal package special behavior.
  • Configured Azure DevOps remote module source with package level imports.
  • Successfully migrated a utility logger for setup of Zerolog into a seperate remote module for importing.
  • Setup 50% test coverage for logger using gotest test generator.
  • Used Is for test setup. (this would be a cool use of gotest templates test generation)
  • Modified sharedbrain forked repo to generate yaml front matter with …
  read more

Go R1 Day 39

  • built a better understanding of how to resolve Go modules from private Azure DevOps instances

Using Azure DevOps for Private Go Modules

2022-12-14
Provided an example of how to handle private go modules in Azure Pipeline compatible method.

This took a few hours of work to iron out, so figured maybe I’d save someone time.

⚡ Just keep it simple and use SSH

⚡ Use dev.azure.com even if using older project.visualstudio.com to keep things …

  read more

GitPod User Feedback

  1. Thank you GitPod for integrating with VSCode. 🎉
  2. Upcoming ssh support, so freaking cool! Are you using Chisel in the backend per the GitHub issues I found discussing workaround? As a Go dev, I’m interested ⚡ I believe Jetbrains + VSCode users will now both be able to leverage the same backend.
  3. GitHub took over the codespace arena with Visual Studio Codespaces being abandoned. Enterprise customers using Azure Repos can’t benefit from any of this new flexibility 💔. Is it in the roadmap …
  read more

Log4 Brains Improves ADR Experience

I’m a fan of architectural decision records. Docs as code sets a practice for a team to track decisions in process and design.

Log4Brains provides markdown template based adr creation, with an option to render a static site for reading.

If you want to start managing your ADRs in a structured way, but benefit from simple markdown as the source files, then this is a great option to consider.

It’s really easy to get started with docker, no npm install required.

Just run: docker run --rm …

  read more

Career Advice From a Drunk Dev on Reddit

Drunk Post: Things I’ve learned as a Sr Engineer has trending with some fantastic discussion on Twitter & Reddit.

What makes it so interesting is the raw and unfiltered message, mixed in with some great humor.

My Background

The author of that post comes from a Data Engineer side.

I’ve been a Database Developer, Production …

  read more

Highlight Problem Characters in Code

Use Vscode Gremlins to help flag characters that shouldn’t be in your code.

You can give a range to flag multiple characters with a single rule.

For example, if using macOS and the option key is set to a modifier, it’s easy to accidentally include a Latin-1 Supplemental Character that can be difficult to notice in your code.

To catch the entire range, the Latin-1-Supplement link provided shows a unicode range of: 0080—00FF

Configure a rule …

  read more

The Dark Side

Saw this on a Twitter thread and had to save it. If you’ve ever debated light vs dark themes, you might find this as funny as I did.

Nearly choked on my dinner.