Skip to content

Instantly share code, notes, and snippets.

View mrapczynski's full-sized avatar

Matt Rapczynski mrapczynski

View GitHub Profile
@mrapczynski
mrapczynski / .zsh_aws_functions.sh
Last active February 12, 2021 22:10
Zsh/Bash Function for Getting AWS Credentials from SSO
# WHAT IS IT?
#
# After logging into an AWS organization that is SSO enabled using CLI v2, session credentials will be
# cached at $HOME/.aws/sso/cache. Most AWS tools do not know how to integrate directly with AWS SSO. This
# small function for Bash and Zsh gives you a quick shortcut to get temporary STS credentials
# and exports them as environment variables which your tools are likely to understand. Primary use case
# I wrote this for is using the Docker AWS ECR credential helper. I often toggle between different AWS
# organizations, and this function understands looking through the token cache for the correct one based
# the SSO start URL.
#
@mrapczynski
mrapczynski / BannerHibernateConfiguration.groovy
Last active December 17, 2018 17:40
Example of creating a Hibernate configuration class for the Grails platform to allow developer control which tables (via domain objects) are given the GORM treatment during startup of a Grails application. I created it to be simple object-oriented method where I can mix domain objects that were either (a) custom to the application and needed sch…
package edu.fhda.grails.hibernate
import groovy.util.logging.Log4j
import org.codehaus.groovy.grails.commons.GrailsApplication
import org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsAnnotationConfiguration
import org.hibernate.HibernateException
import org.hibernate.dialect.Dialect
import org.hibernate.tool.hbm2ddl.DatabaseMetadata
/**