Skip to content

Instantly share code, notes, and snippets.

View instagrim-dev's full-sized avatar

Jonathan Maye-Hobbs instagrim-dev

  • .local
View GitHub Profile
@instagrim-dev
instagrim-dev / repo-rinse.sh
Created September 29, 2023 23:13 — forked from nicktoumpelis/repo-rinse.sh
Cleans and resets a git repo and its submodules
git clean -xfd
git submodule foreach --recursive git clean -xfd
git reset --hard
git submodule foreach --recursive git reset --hard
git submodule update --init --recursive
@instagrim-dev
instagrim-dev / route_based_on_uid.sh
Created September 6, 2023 00:25 — forked from gunkaaa/route_based_on_uid.sh
Use separate gateway based on iptables owner (UID)
#!/bin/bash
# (In this case) default gateway is 192.168.1.3, alternate is 192.168.1.1.
# Usually default is either .1 or .254 - pay attention.
# If anything involving CDNs is involved, use https://github.com/hadess/resolvconf-override .
# Add new routing table, which uses alternate gateway by default
echo 100 altgateway >> /etc/iproute2/rt_tables
# Mark traffic sourced from UID as needing to go via other gateway (4 is arbitrary)
@instagrim-dev
instagrim-dev / iTerm2.md
Created July 28, 2023 21:19 — forked from soifou/iTerm2.md
iTerm2 Shortcuts

iTerm2 Shortcuts

Tab navigation

  • open new tab: Cmd + t
  • next tab: Cmd + Shift + ]
  • previous tab: Cmd + Shift + [

Pane navigation

function _getUserIamPermissions() {
export AWS_PAGER="";
local _user="${1}";
local outputManagedPolicies="";
local outputUserPolicies="";
local outputManagedGroupPolicies="";
local outputGroupPolicies="";
# Managed Policies Attached to the IAM User
@instagrim-dev
instagrim-dev / example.tf
Created April 28, 2023 19:07 — forked from chancez/example.tf
Support creating a DNS validated ACM certificate containing SANs for multiple different hosted zones
module "combined_acm_certificate" {
source = "../../modules/acm_certificate_dns_validated_multi_zone"
domain_name = "infra.example.com"
zone_to_san = {
"infra.example.com" = [
"*.infra.example.com",
"*.dev.infra.example.com",
"*.staging.infra.example.com",
"*.production.infra.example.com",
@instagrim-dev
instagrim-dev / ifttt_hello_world.py
Created April 21, 2023 20:50 — forked from artrybalko/ifttt_hello_world.py
ifttt_hello_world.py
from fastapi import FastAPI, status, Request
from fastapi.responses import JSONResponse
from pydantic import BaseModel
from typing import Optional
from datetime import datetime, timezone
import uuid
app = FastAPI()
@instagrim-dev
instagrim-dev / gist:20342f458137238cdde53c1cd629a334
Created April 16, 2023 14:19 — forked from jvenator/gist:9672772a631c117da151
PDFtk Server Install Workaround for Mac OS X

Installing PDFtk Server edittion on your Mac

This workaround install is necessary because PDFtk was pulled from homebrew-cask due to issues with it aggressively overwriting file permissions that could impact other installed libraries. See this homebrew-cask issue.
The following steps worked on Mac OS X 10.10.1 with a standard brew installation for the PDFtk Mac OS X server libary version 2.02.
All Terminal commands separated by a full line space. Some commands wrap into multiple lines.

Download and extract the Mac OS X server install pacakge

@instagrim-dev
instagrim-dev / console.save.js
Created April 8, 2023 04:24 — forked from raecoo/console.save.js
Save JSON object to file in Chrome Devtool
// e.g. console.save({hello: 'world'})
(function(console){
console.save = function(data, filename){
if(!data) {
console.error('Console.save: No data')
return;
}
if(!filename) filename = 'console.json'
if(typeof data === "object"){
data = JSON.stringify(data, undefined, 4)
@instagrim-dev
instagrim-dev / how-to-generate-and-use-private-keys-with-openssl-tool.md
Created January 23, 2023 04:41 — forked from briansmith/how-to-generate-and-use-private-keys-with-openssl-tool.md
How to generate & use private keys using the OpenSSL command line tool

How to Generate & Use Private Keys using OpenSSL's Command Line Tool

These commands generate and use private keys in unencrypted binary (not Base64 “PEM”) PKCS#8 format. The PKCS#8 format is used here because it is the most interoperable format when dealing with software that isn't based on OpenSSL.

OpenSSL has a variety of commands that can be used to operate on private key files, some of which are specific to RSA (e.g. openssl rsa and openssl genrsa) or which have other limitations. Here we always use