Skip to content

Instantly share code, notes, and snippets.

View spenserpothier's full-sized avatar
🍔

Spenser Pothier spenserpothier

🍔
View GitHub Profile
@spenserpothier
spenserpothier / findResourceByType.zsh
Created April 10, 2020 20:54
Shell command to search through regions and profiles and return all `resourceNames` and `resourceIds` for a given ResourceType. meant to be sourced into an RC
function findResourcesByType() {
if (($# == 0)) then
echo "\nUsage: findResourceByType <ResourceType>"
echo "\nResourceType list can be found at https://docs.aws.amazon.com/cli/latest/reference/configservice/list-discovered-resources.html#options"
return 1;
fi
# Fill these with the names of the profiles and regions you want to look through, space seperated
PROFILES=()
REGIONS=()
for o in $PROFILES; do
@spenserpothier
spenserpothier / exportOptions-AdHoc-Distribution.plist
Last active December 13, 2019 18:44
Use xcodebuild for iOS builds
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>method</key>
<string>ad-hoc</string>
<key>teamID</key>
<string>10_DIGIT_DEVELOPER_ID</string>
<key>provisioningProfiles</key>
<dict>
<key>MY_APP_BUNDLE_ID</key>
@spenserpothier
spenserpothier / getGoTools.sh
Last active April 8, 2019 23:25 — forked from tydavis/getGoTools.sh
Setup Go tools
#!/bin/sh
go get -u github.com/dougm/goflymake
go get -u github.com/acroca/go-symbols
go get -u github.com/alecthomas/gometalinter
go get -u github.com/cweill/gotests/...
go get -u github.com/davidrjenni/reftools/cmd/fillstruct
go get -u github.com/derekparker/delve/cmd/dlv
go get -u github.com/dominikh/go-tools/cmd/keyify
go get -u github.com/fatih/gomodifytags
@spenserpothier
spenserpothier / curl.sh
Last active August 29, 2017 17:19
cURL with username/password
curl -k -X POST --netrc-file passfile https://url.with.auth.com
@spenserpothier
spenserpothier / find_iam_user.py
Last active August 16, 2017 20:28 — forked from OnlyInAmerica/find_iam_user.py
Find the IAM username belonging to the TARGET_ACCESS_KEY
#!/usr/bin/env python
# Find the IAM username belonging to the TARGET_ACCESS_KEY
# Useful for finding IAM user corresponding to a compromised AWS credential
# Usage:
# find_iam_user AWS_ACCESS_KEY_ID
# Requirements:
#
# Environmental variables:
# AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
# python:
@spenserpothier
spenserpothier / keybase.md
Last active August 16, 2017 20:27
Keybase proof

Keybase proof

I hereby claim:

  • I am spenserpothier on github.
  • I am spenserpothier (https://keybase.io/spenserpothier) on keybase.
  • I have a public key whose fingerprint is 59A2 A73E FFCF 5306 C7F9 D0DD 7B30 C2DB 40F3 CFCD

To claim this, I am signing this object:

@spenserpothier
spenserpothier / style.css
Last active August 16, 2017 20:27
CSS Snippet for vertical centered element
.element {
position: relative;
top: 50%;
transform: translateY(-50%);
}
@spenserpothier
spenserpothier / gist:2e95ff5186a5ff53ad62
Last active August 16, 2017 20:26
some python snippet for finding instance ids in events
instances = [x['resourceId'] for x in event['requestParameters']['resourcesSet']['items']
if re.search('i-([0-9]|[a-f]){8}', x['resourceId'])]
@spenserpothier
spenserpothier / gist:8b5363931d742a7fd60a
Last active August 16, 2017 20:25
Onename/openname verification
Verifying that +spenserpothier is my openname (Bitcoin username). https://onename.com/spenserpothier