Skip to content

Instantly share code, notes, and snippets.

View pearcec's full-sized avatar
🚀
Fixing bugs

Christian Pearce pearcec

🚀
Fixing bugs
View GitHub Profile
$keyName = '{keyName}'
ssh-keygen -f $keyName -t rsa -N '""' -b 4096 -C '{email}'
$publicKey = (Get-Content "$keyName.pub" -Raw).ToString()
gh auth login
gh api "repos/{userName}/{repo}/keys" -f "key=$publicKey" -f "title=ROkey" -F read_only="true"
@ambakshi
ambakshi / iam-assume-role.sh
Last active July 6, 2024 02:59
Assume an IAM role. An interesting way of doing IAM roles is to give the instance permissions to assume another role, but no actual permissions by default. I got this idea while setting up security monkey: http://securitymonkey.readthedocs.org/en/latest/quickstart1.html#setup-iam-roles.
#!/bin/bash
#
# Assume the given role, and print out a set of environment variables
# for use with aws cli.
#
# To use:
#
# $ eval $(./iam-assume-role.sh)
#