Posts

//

Home Assistant

Home Assistant is pretty sweet if you have never set it up before. I won’t go into the “setup” or install as it’s specific to your needs and there’s plenty of information out there about how to do that. This is more about the oddly specific things I build and setup for me.

goals

With HA, I had a few requirements for what I wanted to be able to manage and pull information from.

[...more]
//

Amd Ryzen Issues

Shits on fire

After building and running my home server setup I kept getting alerts and seeing issues with the CPU performance.

Now, there is plenty around the internet surrounding the 5900X processor with regards to heat and performance. The gist of it is that it’s “totally normal for it to operate at 95C”.

Ok, first - I get it. It’s technically a gaming CPU with a TDP of 105W. So if you’re blasting some game it can handle temps while under extreme loads. The assumption there is those loads are peaky and intermittent. So when you are done, it comes back down to a normal level. Also it does say on AMD’s site that the recommended cooling for it is water cooling.

[...more]
//

Nester

one of the dumbest things I’ve ever created

Not because it’s dumb inherently, but worse. Google’s OAuth only allows a refresh token to last 7 days. In part 1 and Part one part 2 I walk through the mess that is Google’s OAuth system and Go library to support it.

7 days?

Ok, so there’s more to it. TL;DR is google expects you to write code that anticipates a granted refresh token to expire. The default is 7 days Link which is annoying as shit considering you have to manually go through the whole OAuth consent screen again to get a new one. IF ONLY THERE WAS A WAY TO AVOID THAT? WOULDN’T THAT BE SMART?

[...more]
//

Oauth2 Part 2

Findings for part 2

Part one here

ApprovalForce

url := a.conf.AuthCodeURL("state", oauth2.AccessTypeOffline, oauth2.ApprovalForce) this line fixes everything. If you dont use the ApprovalForce option then a refresh_token isn’t created in the token that is returned.

With this token we can now load the token from a file, check the expiry, and create a new token source from that token to create a new valid token.

Google API hates numbers

Under ‘API & Services’ -> Credentials Tab is where you create the OAuth2 Client Ids. In there you specify what Authorized redirect URI’s you want to use. For whatever reason, probably a good one, they do not like using IP’s. Since we need to test against a remote machine running Nester, that means we need some DNS. More on that later.

[...more]

background

As much as you can’t avoid IoT devices - especially in home automation - the one thing that seems to suck about all of the devices is telemetry. Specifically, metrics over time. Some devices have maybe 7 days of data with a few graphs but if you have multiple devices of different brands it’s basically impossible to see the data collated in one place, ya know to make it useful?

[...more]
//

Server Build

Like most people who do tech shit, I have random computers, servers, “machines” - that I use to mess around with. Typical shit like raspberryPi’s, intel nuc’s, old random tech. I’m also lazy and have a Synology 2 drive nas.

TLDR - pcpartpicker list

old setup

My old setup was a combo of raspberryPi’s clusters running k3s and an intel nuc. The rPi cluster ran whatever random stuff to use on k8s and the nuc was just a giant docker host with the nas connected. This was all cool until one day I wanted to run something that used MongoDB(gross), but more accurately, it needed a specific instruction set from the CPU to do that. The nas and nuc both have celerons which didn’t have that. So, we build.

[...more]
1 of 1