Skip to content

Instantly share code, notes, and snippets.

@chrislovecnm
chrislovecnm / kops-iam-installer.txt
Created April 18, 2017 20:08
IAM roles for kops kubernetes installer
//All the resource "*" we can prune down to a
//"Resource": "arn:aws:iam::ACCOUNTNUMBER:role/ROLENAME"
// which is tied to a VPC
// This is a list of the permissions that our installer tools
// use.
// There are multiple modes that our installer uses, we
// will not need the perms for VPC creation as we
// will be using a pre installed VPC
// Will need all of these
@thomasdarimont
thomasdarimont / KeycloakAdminClientExample.java
Last active September 28, 2025 10:05
Using Keycloak Admin Client to create user with roles (Realm and Client level)
package demo.plain;
import org.keycloak.OAuth2Constants;
import org.keycloak.admin.client.CreatedResponseUtil;
import org.keycloak.admin.client.Keycloak;
import org.keycloak.admin.client.KeycloakBuilder;
import org.keycloak.admin.client.resource.RealmResource;
import org.keycloak.admin.client.resource.UserResource;
import org.keycloak.admin.client.resource.UsersResource;
import org.keycloak.representations.idm.ClientRepresentation;
{
"__inputs": [
{
"name": "DS_GRAPHITE",
"label": "graphite",
"description": "",
"type": "datasource",
"pluginId": "graphite",
"pluginName": "Graphite"
}
@bwhaley
bwhaley / peer_routes.py
Last active October 6, 2021 17:18
A script to configure routes in in a VPC peering connection
# Quick script to configure routes for a VPC peering connection
# Searches a region for all peering connection and prompts to choose one
# Configures routes between the peered networks for all routing tables
# STS/AssumeRole not implemented cross-account peering. Instead,
# Choose accepter/requestor depending on which credentials are set in the environment
# Enter either IPv4 and IPv6 route destinations
# Example usage:
# ( Assuming boto credentials are configured)
# $ pip install boto3
# $ python3.6 peer_routes.py
@unacceptable
unacceptable / README.md
Last active February 27, 2019 08:19
This leverages the AWS CLI to easily check availability and order a domain.

Order domain.sh

Description

Have you ever wished that there was an easy way to order domains via the command line? Look no further! You can check a domain's availability and order it via this utility.

Prerequisits

Install the AWS CLI

@ryu1kn
ryu1kn / Makefile
Last active March 19, 2023 13:02
Encrypt/decrypt with AWS KMS using AWS cli
# How to encrypt/decrypt your text/blob secret with AWS KMS with AWS cli
KEY_ID=alias/my-key
SECRET_BLOB_PATH=fileb://my-secret-blob
SECRET_TEXT="my secret text"
ENCRYPTED_SECRET_AS_BLOB=encrypted_secret_blob
DECRYPTED_SECRET_AS_BLOB=decrypted_secret_blob # Result of decrypt-blob target
encrypt-text:
@serithemage
serithemage / AWSSecurityContents.md
Last active July 24, 2025 04:30
AWS 보안 관련 자료 모음집

AWS 학습 링크집 시리즈

@gene1wood
gene1wood / aws_iam_managed_policies_2019-02-12.json
Last active May 14, 2025 18:03
Script to export all AWS IAM managed policies as well as the resulting list of all managed policies
[
{
"Document": {
"Statement": [
{
"Action": [
"directconnect:Describe*",
"ec2:DescribeVpnGateways"
],
"Effect": "Allow",
@andytumelty
andytumelty / aws query example: show VPC ID, Name and CIDR
Last active September 3, 2024 15:19
AWS CLI List VPC ID, Name and CIDR Block
# display VPC ID, CIDR Block and Name
aws ec2 --output text --query 'Vpcs[*].{VpcId:VpcId,Name:Tags[?Key==`Name`].Value|[0],CidrBlock:CidrBlock}' describe-vpcs
@sebble
sebble / stars.sh
Last active October 27, 2025 01:21
List all starred repositories of a GitHub user.
#!/bin/bash
USER=${1:-sebble}
STARS=$(curl -sI https://api.github.com/users/$USER/starred?per_page=1|egrep '^Link'|egrep -o 'page=[0-9]+'|tail -1|cut -c6-)
PAGES=$((658/100+1))
echo You have $STARS starred repositories.
echo