What did I learn?

Keeping track of the things we figure out


It turns out that if you were using terraform.io as a remote state only situation, hashicorp is upping the price to a price per resource model and making things really expensive. It is now time to migrate from tf.io to s3 and not pay a ton of money.. BLADE And never again have to pay for a service that would be dirt cheap... RAZOR ...IF it weren't run by a bunch of profiteering gluttons!...

2023-09-15 · 2 min · 292 words · Mike Fettis


adeventures in old technology so there is an application called minimodem and it will transmit and receive data at various bps etc. why not see what it takes to move a 1.5mb file. cause lol base64 -i img.jpg|minimodem --tx 9600 --ascii -f 9600.wav ffmpeg -i 9600.wav 9600.mp3 ffmpeg -i 9600.mp3 9600.wav minimodem --rx 9600 -f 9600.wav|base64 -d >img_output9600.png at 9600 bps the file is 36 minutes long. and 120mb once in mp3 its 17mb....

2023-08-24 · 1 min · 118 words · Mike Fettis

terraform targeting

terraform targeting https://github.com/ridingintraffic/ridingintraffic.github.com/wiki/code_sre#terraform-targetingd Yes you are supposed to never use a targeted plan and apply in terraform becuase it is the violation of the Infra as code creed. But you know what sometimes you just gotta do a thing and get it done. Then you never want to remember your shame and as a result you go and forget how to do that thing. so here it is terraform plan -target="aws_appautoscaling_scheduled_action....

2023-08-18 · 1 min · 81 words · Mike Fettis

gitlab exit codes aws arm building

gitlab and exit codes Sometimes gitlab will have a command or a script that runs and it will not trap an exit code properly. This results in an error condition happening in a script, but the job in the pipeline to come back green. here is some meat and context around the issue as well. https://gitlab.com/gitlab-org/gitlab-runner/-/issues/25394 and then a bit more here https://gitlab.com/gitlab-org/gitlab/-/merge_requests/77601 and then of course it still isn’t fixed as of today’s writing https://gitlab....

2023-08-17 · 2 min · 336 words · Mike Fettis

boost audio on video file

Was the audio too quiet on something that you recorded? Are you lazy and you don’t want to drop in the file to a timeline editor just so you can gain boost? most laptops will have ffmpeg on them, and if your mac doesnt then a simple brew install ffmpeg https://formulae.brew.sh/formula/ffmpeg ffmpeg -i "your_input_file.mp4" -vcodec copy -filter:a "volume=15dB" "your_output_file.mp4" there you have it short and simple now your video file is louder....

2023-08-14 · 1 min · 72 words · Mike Fettis

improvisation as a way of life

I am a leaf on the wind, watch how I soar. this is an old post from 2018 that I never added here but I thought it was still relevant today - Roll with the punches, go with the flow, make it up as you go… People always say that you should stay flexible with your plans. Don’t be afraid to change things. Never in my wildest dreams would I fully understand what it means to live a life of constant improvisation than when we had our first child....

2023-08-14 · 3 min · 534 words · Mike Fettis

python base64 requests jq and terraform

base64 user auth in requests use the base64 for the first header and then reuse the bearer token that you get back. import requests import json from requests.auth import HTTPBasicAuth headers = { 'Content-Type': 'application/json', 'Accept': 'application/json' } base_url = 'https://www.something.com' token_url = "/tauth/1.0/token/" url=base_url + token_url response = requests.post(url, headers=headers, auth=HTTPBasicAuth(USER, PASSWORD)) data = response.json() #reusing that bearer token from the repsonse headers = { 'Authorization': f"Bearer {data['token']}", 'Content-Type': 'application/json', 'Accept': 'application/json' } url="/something/" response=requests....

2023-05-23 · 1 min · 140 words · Mike Fettis

python nested dictionary access

Getting dictionaries back from a http endpoint usually results in a mess of objects. Dealing with this in python can be a challenge of ValueError exceptions. so what is the easiest way to handle this? a nested get. if the object looks like message={"detail":{"operation":"create"}} then you can access it like this message.get('detail', {}).get('operation') then if you access something that doesn’t exist you will get a nice None back >>> print(message.get('detail', {})....

2023-04-27 · 1 min · 78 words · Mike Fettis

git single file

Sometimes you just need a single file from a git repo. I know that this is not the typical way we use git, but sometimes you just need to do a thing. So I want a single file, how do i do that? git archive --format=tar --remote=ssh://git@github.com:someuser/somefile.git{main} -- my_file_name |tar xf - and like that you can snag one file from one repo and get on with your life.

2023-03-03 · 1 min · 69 words · Mike Fettis

terraform depends without depends_on

Terraform depends pattern without depends_on. Or how to use hcl to leverage its interal dependancy handling, to to hard things for you. We are going to use an example of an aws sqs queue, dlq, and queue policy all strung together. The issue that I ran in to was I wanted to create all of these using a single list of words as my seed values. Then the issue arose around using a for_each with a dynamic resource group when terraform would need group 1 to be appied before it knew what to setup for group 2....

2023-02-10 · 3 min · 515 words · Mike Fettis

macos text entering weirdness

Just another basic reminder for a thing that I fixed with my laptop when it was acting odd and weird; I was working on my mac and I kept encouring a weird behavior where certain keys that were held down would not repeat, but would pop up a prompt on my screen to enter some kind of special accented internantionl character. In macOS, when a key is held down while entering text, a popup is shown which lets one choose between various accented forms of the character....

2023-02-09 · 1 min · 173 words · Mike Fettis

wireless zmk mac sleep waking bug

bug in zmk fancy keyboards use a controller called a nice nano, that nice nano runs a firmware called zmk. That firmware has a fair few options to configure a few things. One of the nice options is deep sleep, which powers things down to save battery on the board when not in use. Many people argue that this feature eliminates the need for a physical battery switch. However there is a bug with mac that is/was waking up the mac from sleep eventhough the “keyboard is alseep” You can fix it with....

2023-02-01 · 1 min · 114 words · Mike Fettis

fun with cloudwatch logs

writing directly to cloudwatch logs sometimes you just need to write to a cloudwatch log and you want to do that from the terminal? You can do this with jq bash and aws cli yey timestamp=$(date +%s000); \ json_data=$(jq --null-input --arg timestamp $timestamp '{"timestamp": ($timestamp|tonumber), "message": "ssn: 123-12-1234"}'); \ aws logs put-log-events --log-group-name /dev/ridigintraffic --log-stream-name something-special --log-events "$json_data"

2023-01-31 · 1 min · 58 words · Mike Fettis

vertical keyboards

i mesed up my back over the weekend i spent a couple of days on the floor. This was because i messed up my back. This is mostly becuase I have really poor posture. I have had really poor posture for a good 35 years now. It is likley that the poor posture is finally catching up to me. So what do we do when bad things like this happen? We make a whole bunch of changes to things and then revert a number of those changes but hopefully one or two of those changes will stick....

2023-01-17 · 2 min · 398 words · Mike Fettis

building keyboard notes

building keyboards good surface mount diodes https://www.mouser.com/ProductDetail/821-1N4148WRHG

2022-10-07 · 1 min · 7 words · Mike Fettis

open a folder from terminal

open a finder in the terminal of a mac if you need to open a finder window you can just type open or if you want to open the finder with the folder that you are in as the path you can type open . and like that you have magically opened the folder and you are good to go.

2022-10-07 · 1 min · 60 words · Mike Fettis

muting a microwave

Microware muting Ok fine usually I will talk about tech things and IT things, but this is a quality of life thing. It turns out that you can mute your microwave. While i never thought that this would be a thing, it does make really good sense and yea, that should be a thing. 30 seconds later I googled “mute microwave” and low and behold. whirlpool microwave: keypad mute: press and hold 1 for 3 seconds hear "beep beep" end of cycle mute: pread and hold 2 for 3 seconds hear "beep beep"

2022-09-12 · 1 min · 93 words · Mike Fettis

ripgrep file context

rip grep tip I use ripgrep all the time and often times there are little things that can really help you find what you are serarching for. This is one of them. I want to find a string in a specific filename that exists in many folders. Then I want to display those resutls with some context. rg '.wait:' -g '.gitlab-ci.yml' --context 5 The string that I am searching for is ....

2022-09-06 · 1 min · 96 words · Mike Fettis

Building QMK with Rp2040

player 2(040) has entered the game. During the past 2 years if you had not noticed, there has been a chip shortage. Namely the atmega 32u4 chips that power the elite-c and pro micros microcontrollers that are at the centers of custom keyboards. It just so happened that during this time raspberry pi developed a microcontroller of their own. This is known as the rp2040. rp2040 Why does this matter? Well we can now get the 2040 as a drop in replacement for the pro micros....

2022-08-07 · 2 min · 423 words · Mike Fettis

replacing text across files

We built microservices to leverage scale. As a result those microservices are each in their own repos. We don’t need to get into a discussion about mono repos here, we aren’t using them. The example here is a gitlab pipeline file and we needed to add a new yaml anchor block to use later in the pipeline. We are going to look for something that we know exists, in this case: “....

2022-08-07 · 2 min · 255 words · Mike Fettis