Skip to content

Instantly share code, notes, and snippets.

@aaronzirbes
aaronzirbes / keybase.md
Created April 18, 2014 19:50
keybase.md

Keybase proof

I hereby claim:

  • I am aaronzirbes on github.
  • I am ajz (https://keybase.io/ajz) on keybase.
  • I have a public key whose fingerprint is 0A9A 9917 713D BC0B E718 A2BC 9DDC 53E1 8051 DD6C

To claim this, I am signing this object:

package org.zirbes.grails.functional.remote
import grails.util.BuildSettingsHolder
import groovyx.remote.transport.http.HttpTransport
/**
* Adds null safe grails specific convenient no arg constructor.
* https://jira.grails.org/browse/GRAILS-10661
*/
class RemoteControl extends groovyx.remote.client.RemoteControl {
@aaronzirbes
aaronzirbes / unicode_color_chars.txt
Created June 11, 2014 00:25
Fun Unicode Characters
231a ⌚ 231b ⌛ 23e9 ⏩ 23ea ⏪ 23eb ⏫ 23ec ⏬ 23f0 ⏰ 23f3 ⏳ 25fd ◽ 25fe ◾ 2614 ☔ 2615 ☕ 2648 ♈ 2649 ♉ 264a ♊ 264b ♋ |
264c ♌ 264d ♍ 264e ♎ 264f ♏ 2650 ♐ 2651 ♑ 2652 ♒ 2653 ♓ 267f ♿ 2693 ⚓ 26a1 ⚡ 26aa ⚪ 26ab ⚫ 26bd ⚽ 26c4 ⛄ 26c5 ⛅ |
26ce ⛎ 26d4 ⛔ 26ea ⛪ 26f2 ⛲ 26f3 ⛳ 26f5 ⛵ 26fa ⛺ 26fd ⛽ 2705 ✅ 270a ✊ 270b ✋ 2728 ✨ 274c ❌ 274e ❎ 2753 ❓ 2754 ❔ |
2755 ❕ 2757 ❗ 27bf ➿ 2b1b ⬛ 2b1c ⬜ 2b50 ⭐ 2b55 ⭕ |
@aaronzirbes
aaronzirbes / jumpssh
Last active August 29, 2015 14:20
SSHing throught a Jumphost
#!/bin/bash
host=${1}
domain=service.consul
environment=staging
#environment=prod
credprefix=mycompany
# IP address of jumphost
@aaronzirbes
aaronzirbes / gist:92a237a611d74da15530
Created July 6, 2015 12:57
GZip Compression : WIP
// import java.io.ByteArrayOutputStream
import java.util.zip.GZIPOutputStream
import java.util.zip.GZIPInputStream
final String THE_RAVEN = '''Once upon a midnight dreary, while I pondered, weak and weary,
Over many a quaint and curious volume of forgotten lore—
While I nodded, nearly napping, suddenly there came a tapping,
As of some one gently rapping, rapping at my chamber door.
“’Tis some visitor,” I muttered, “tapping at my chamber door—
Only this and nothing more.”
@aaronzirbes
aaronzirbes / logback.groovy
Created September 23, 2015 04:55
Logback Groovy Config
import static ch.qos.logback.classic.Level.DEBUG
import static ch.qos.logback.classic.Level.INFO
final String APP = 'my-app'
final String LOG_PATH = "/var/log/${APP}"
include 'org/springframework/boot/logging/logback/base.xml'
appender('STDOUT', ConsoleAppender) {
encoder(PatternLayoutEncoder) {
/* From: SpringSecurityCoreGrailsPlugin.groovy */
// make sure the filter chain filter is after the Grails filter
def getWebXmlFilterOrder() {
def FilterManager = getClass().getClassLoader().loadClass('grails.plugin.webxml.FilterManager')
[springSecurityFilterChain: FilterManager.GRAILS_WEB_REQUEST_POSITION + 100]
}
@aaronzirbes
aaronzirbes / GroovyApiScript.groovy
Last active October 26, 2015 19:05
Starter script for Groovy scripts that call APIs and do stuff.
@Grapes([
@Grab(group='com.squareup.retrofit', module='retrofit', version='2.0.0-beta2'),
@Grab(group='com.squareup.retrofit', module='converter-jackson', version='2.0.0-beta2'),
@Grab(group='com.fasterxml.jackson.core', module='jackson-core', version='2.6.3'),
@Grab(group='com.fasterxml.jackson.core', module='jackson-databind', version='2.6.3'),
@Grab(group='org.slf4j', module='slf4j-simple', version='1.7.12')
])
import retrofit.Retrofit
import retrofit.Call
@aaronzirbes
aaronzirbes / ObservableQueue.groovy
Created November 4, 2015 17:09
A observable queue that you can push to for deferred processing
import java.util.concurrent.LinkedBlockingQueue
import java.util.concurrent.TimeUnit
import rx.Observable
import rx.Subscriber
import rx.schedulers.Schedulers
class ObservableQueue<T> {
protected long pollTimeout = 1
@aaronzirbes
aaronzirbes / packer-kill-orphans.sh
Last active November 11, 2015 01:44
Delete orphaned artifacts left by packer.io
#!/bin/bash
set -e
# Keypairs
echo "Finding Key Pairs..."
KEY_PAIRS_JSON=`aws ec2 describe-key-pairs --filters 'Name=key-name,Values=packer*'`
KEY_PAIRS=`echo "${KEY_PAIRS_JSON}" | grep 'KeyName' |sed -e 's/.*"KeyName": "//' -e 's/",* *$//'`
# Security Groups