Skip to content

Instantly share code, notes, and snippets.

@miguelfrde
miguelfrde / kubernetes-aws.sh
Created March 1, 2016 06:07
Kubernetes AWS
sudo apt-get update
sudo apt-get install -y python-pip
sudo pip install awscli
aws configure # enter credentials for a user with full s3,ec2 access / admin access
export KUBERNETES_PROVIDER=aws
export KUBE_AWS_ZONE=us-west-2a
export KUBE_AWS_INSTANCE_PREFIX=k8s
export KUBE_MINION_IMAGE=ami-9abea4fb # Ubuntu server 14.04
from botocore.credentials import RefreshableCredentials
from botocore.session import get_session
from boto3 import Session
def assumed_session(role_arn, session_name, session=None):
"""STS Role assume a boto3.Session
With automatic credential renewal.
@centic9
centic9 / README.md
Last active March 7, 2026 09:34
notepad++ syntax highlighting for Dockerfiles, store at something like C:\Users\[user]\AppData\Roaming\Notepad++\userDefineLangs\userDefineLang_Dockerfile.xml

Notepad++ syntax highlighting for Dockerfiles

Store userDefineLang_Dockerfile.xml at %AppData%\Roaming\Notepad++\userDefineLangs\userDefineLang_Dockerfile.xml and select Language > Dockerfile in Notepad++.

Automatically apply style

Since Dockerfile has no extension, the style is not automatically applied.

@earthgecko
earthgecko / bash.generate.random.alphanumeric.string.sh
Last active February 11, 2026 10:15
shell/bash generate random alphanumeric string
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1