Skip to content

Instantly share code, notes, and snippets.

{
"Effect": "Allow",
"Action": [
"cloudfront:CreateCloudFrontOriginAccessIdentity",
"cloudfront:CreateDistribution",
"cloudfront:CreateInvalidation",
"cloudfront:CreateStreamingDistribution",
"cloudfront:GetCloudFrontOriginAccessIdentity",
"cloudfront:GetCloudFrontOriginAccessIdentityConfig",
"cloudfront:GetDistribution",
@limed
limed / aws-resources.py
Last active October 27, 2021 12:37
Prints out all aws resources using the skew library, just putting this here for easy reference
#!/usr/bin/env python
import skew
from skew.arn import ARN
arn = ARN()
services=arn.service.choices()
services.sort()
#services=["route53", "iam"]

Keybase proof

I hereby claim:

  • I am limed on github.
  • I am limed (https://keybase.io/limed) on keybase.
  • I have a public key ASCt9ikyClQA1DbJH-erM8NTHj6KBx--4_ND-n2XAM_elwo

To claim this, I am signing this object:

@limed
limed / nntp.py
Created February 1, 2017 22:27
Dumps out nntp posts of a group
#!/usr/bin/env python
import nntplib
import re
import sys
usage = """./nntp-stats [nntp-group-name]"""
if len(sys.argv) < 2:
print usage
@limed
limed / get-totp-key
Created January 11, 2017 18:52
Decrypts totp key and runs it through oathtool to give you your otp key
#!/bin/bash
unset HISTFILE
encrypted_file=$1
if [ -z "${encrypted_file}" ] || [ ! -f "${encrypted_file}" ]; then
echo "Something is wrong with the file, exiting"
exit 1
fi
#!/bin/bash
# Simply creation of aws-vault profile
set -eu
color_ok()(set -o pipefail;"$@" 2>&1>&3|sed $'s,.*,\e[0;32m&\e[m,'>&2)3>&1
echo_bad () {
echo -e "\033[0;31m$@\033[0m"
}
resource "aws_iam_policy_attachment" "read_only" {
count = "${var.create_users}"
name = "read-only-attachments"
groups = ["${aws_iam_group.read_only_users.name}"]
roles = ["${aws_iam_role.readonly.name}"]
policy_arn = "arn:aws:iam::aws:policy/ReadOnlyAccess"
}
+ module.global_admins.aws_iam_access_key.admins.2
secret: "" => "<computed>"
ses_smtp_password: "" => "<computed>"
status: "" => "<computed>"
user: "" => "riweiss"
+ module.global_admins.aws_iam_access_key.admins.3
secret: "" => "<computed>"
ses_smtp_password: "" => "<computed>"
status: "" => "<computed>"
environments/stage/global/nubis-users/global-admins/elim/sshPublicKey
environments/stage/global/nubis-users/global-admins/elim/uid
environments/stage/global/nubis-users/global-admins/jcrowe/sshPublicKey
environments/stage/global/nubis-users/global-admins/jcrowe/uid
environments/stage/global/nubis-users/global-admins/pchiasson/sshPublicKey
environments/stage/global/nubis-users/global-admins/pchiasson/uid
environments/stage/global/nubis-users/sudo-users/riweiss/sshPublicKey
environments/stage/global/nubis-users/sudo-users/riweiss/uid
environments/stage/global/nubis-users/sudo-users/rtucker/sshPublicKey
environments/stage/global/nubis-users/sudo-users/rtucker/uid
+resource "null_resource" "user_management_credstash" {
+ count = "${var.enabled * var.enable_user_management * length(split(",", var.environments))}"
+
+ lifecycle {
+ create_before_destroy = true
+ }
+
+ triggers {
+ region = "${var.aws_region}"
+ environment = "${element(split(",", var.environments))}"