Skip to content

Instantly share code, notes, and snippets.

View deric4's full-sized avatar
🌮
DevSecOpsLeanSREAgileWTFBBQ

deric4 deric4

🌮
DevSecOpsLeanSREAgileWTFBBQ
  • The Hood Canal
View GitHub Profile
@benkehoe
benkehoe / package_with_single_sourced_version.py
Last active June 22, 2022 13:31
Single sourcing a python package version using importlib.metadata.version()
# MIT No Attribution
#
# Copyright 2022 Ben Kehoe
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this
# software and associated documentation files (the "Software"), to deal in the Software
# without restriction, including without limitation the rights to use, copy, modify,
# merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so.
#
@DomWeldon
DomWeldon / README.md
Last active September 21, 2024 10:27
SSM + pydantic: ARNs in environment variables are queried at load time

SSM + Pydantic

Query values from SSM when deployed, by placing an SSM ARN as the environment variable

Background

I wanted to query secrets from SSM at runtime, to laod them into a pydantic.BaseSettings settings object, but still be able to pass standard values during development (and I guess, if I want, in prod).

I've done a couple of similar implementations before, but they have always felt clunky and involved altering the object after instantiation, or hard coding which values to take out of SSM.

@josh-works
josh-works / cannot-get-4k-and-and-60hz-at-same-time.md
Last active March 8, 2021 06:35
I'm making a plea for help from others for resolving my display problems. This is basically what I would write in StackOverflow, if I knew which StackOverflow topic to use. Any help is much appreciated!

currently trying: USB-C->DisplayPort cord with SwitchResX to "force" the display up to a reasonable level

My home office setup has suffered some problems of late that are driving me insane.

The most annoying is my wired mouse. I use a wired Redragon Mammoth hooked up to my USB-C hub, and it started giving me problems when dragging anything. Like... a file, a screenshot, a window, it would rapidly (dozens of times a second) "drop" what I was dragging and then pick it up again.

This had extremely unpredictable effects, and was highly disruptive to my workflow.

I don't think my mouse is failing (my bluetooth mouse works fine, and for a variety of reasons I think the problem is my monitor is running at 30hz, not 60. more on that later.)

@pascal-hofmann
pascal-hofmann / 00-configure-source-ssh.ps1
Created June 17, 2020 07:09
Simplified Packer Buildfile: Using windows-restart with session-manager-plugin leads to timeout and 100% cpu load
<powershell>
# Version and download URL
$openSSHVersion = "7.6.1.0p1-Beta"
$openSSHURL = "https://github.com/PowerShell/Win32-OpenSSH/releases/download/v$openSSHVersion/OpenSSH-Win64.zip"
Set-ExecutionPolicy Unrestricted
# GitHub became TLS 1.2 only on Feb 22, 2018
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12;
@joevt
joevt / EDIDUtil.sh
Last active February 11, 2025 22:34
A set of shell functions used to view and edit EDIDs.
#!/bin/bash
#!/bin/zsh
# by joevt May 24/2023
#=========================================================================================
edid_decode=edid-decode
#=========================================================================================
# Modify EDID
@lizthegrey
lizthegrey / attributes.rb
Last active March 27, 2025 02:16
Hardening SSH with 2fa
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'
@cliffrowley
cliffrowley / STREAMDECK_HID.md
Last active April 11, 2025 04:07
Notes on the Stream Deck HID protocol

Stream Deck Protocol

How to interface with a Stream Deck device.

Synopsis

The device uses the HID protocol to communicate with its software.

Configuration

@dikiaap
dikiaap / git-io-custom-url.md
Last active December 5, 2024 06:42
git.io custom URL

Update: As of 11 January 2022, git.io no longer accepts new URLs.

Command:

curl https://git.io/ -i -F "url=https://github.com/YOUR_GITHUB_URL" -F "code=YOUR_CUSTOM_NAME"

URLs that can be created is from:

  • https://github.com/*
  • https://*.github.com
@acolyer
acolyer / jessfraz.md
Created November 19, 2017 13:39
Containers, operating systems and other fun things from The Morning Paper
#!/usr/bin/python
# Credit to frogor for the objc
from Foundation import NSBundle
import json
import objc
import os
import plistlib
import subprocess