Skip to content

Instantly share code, notes, and snippets.

View copelco's full-sized avatar

Colin Copeland copelco

View GitHub Profile
@copelco
copelco / get-public-acls.py
Created December 9, 2022 17:42
Walk S3 objects within a bucket and output CSV report
import click
import csv
import boto3
import os
from pathlib import Path
import typing
from tqdm import tqdm
client = boto3.client("s3")
import click
import boto3
import os
import typing
from tqdm import tqdm
client = boto3.client("s3")
paginator = client.get_paginator("list_objects_v2")
@copelco
copelco / docker-image-architecture-detection.md
Last active September 30, 2022 14:38
Mac & Linux Docker image architecture detection

MacBook Air M1 - macOS Monterey

Docker Desktop for Mac:

# uname -a
Linux 9fd107b44d94 5.10.124-linuxkit #1 SMP PREEMPT Thu Jun 30 08:18:26 UTC 2022 aarch64 GNU/Linux
# dpkg --print-architecture
arm64
# lsb_release -a
@copelco
copelco / ci-ecr-user.yml
Last active June 24, 2020 13:29
AWS ECR CI User
# Playbook to set up AWS ECR CI user
- hosts: k8s
vars:
ansible_connection: local
ansible_python_interpreter: "{{ ansible_playbook_python }}"
roles:
- role: aws-ci-iam
@copelco
copelco / .graphql
Last active December 6, 2019 21:18
query mySuperDooperSearch {
allMessages(
filter: {labels: {terms: ["PERSON"]}}
search: {msgSubject:{value: "hello"}}
facets: [labels]
) {
facets
pageInfo {
hasNextPage
hasPreviousPage
-----> Node.js app detected
-----> Creating runtime environment
NPM_CONFIG_LOGLEVEL=error
NODE_ENV=production
NODE_MODULES_CACHE=true
NODE_VERBOSE=false
-----> Installing binaries

Keybase proof

I hereby claim:

  • I am copelco on github.
  • I am copelco (https://keybase.io/copelco) on keybase.
  • I have a public key ASDHnM0ZZGMNPB6yZEmbY7yvGBWpvo2KlabPUvI0p-Kcfgo

To claim this, I am signing this object:

from ansible.parsing.dataloader import DataLoader
from ansible.inventory.manager import InventoryManager
inventory_path = "./deployment/environments/{}/inventory".format(env.environment)
inventory = InventoryManager(loader=DataLoader(),sources=[inventory_path])
host_names = inventory.get_groups_dict()[group_name]
return [inventory.get_host(host_name) for host_name in host_names]
version: '3'
services:
app:
build:
context: .
volumes:
- ./styleguideprimer:/code/styleguideprimer
# - .:/code
# - /code/node_modules
[copelco:~/projects/Traffic-Stops] dev ± pip freeze
cffi==1.9.1
cryptography==1.7.2
enum34==1.1.6
Fabric==1.8.1
GDAL==1.11.5
idna==2.2
ipaddress==1.0.18
mercurial==4.1.1
paramiko==2.1.1