What did I learn?

Keeping track of the things we figure out

makefile list

Working with make commands can be tiresome. Especially when those makefiles are really long and you do not know what commands are in them or you cannot remember what the commands are named. Here is a neat little trick to help with that. make list <Makefile> test: echo "testing" build: echo "building" deploy: echo "deploying" list: @grep '^[^#[:space:]].*:' Makefile | sort just add the extra list command to a makefile like this...

2023-12-15 · 1 min · 92 words · Mike Fettis

tracing redirects

Follow the redirect road Sometimes you want to have a curl command that traces the redirects and lets you see hops that it makes along the way long story short do this curl -sLD - http://test.chrislatta.org/myredirect.html -o /dev/null it will look like this $ curl -sLD - http://test.chrislatta.org/myredirect.html -o /dev/null HTTP/1.1 301 Moved Permanently Content-Type: text/html; charset=iso-8859-1 Content-Length: 244 Connection: keep-alive Location: http://test.chrislatta.org/hop1.html HTTP/1.1 301 Moved Permanently Content-Type: text/html; charset=iso-8859-1 Content-Length: 244 Connection: keep-alive Location: http://test....

2023-12-15 · 1 min · 117 words · Mike Fettis

keyboard-mounts

keyboard mounts this is the easiest cleanest and cheapest way I have found to mount a split keyboard. the sticker that you apply to the keyboard case has adhesive and can be bought in a multi pack these are great because they are pretty cheap and their height is less that your standard silicon bumpon, therefore you can have the bumpons for feet and they will sit nicely on any flat surface when not mounted...

2023-10-27 · 1 min · 212 words · Mike Fettis

tfstate-migration

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

2023-08-24-minimodem

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