Skip to content

Instantly share code, notes, and snippets.

@aaronzirbes
aaronzirbes / jira
Created April 6, 2016 15:30
Jira Script to open JIRA
#!/bin/bash
JIRA_HOST="https://jira.atlassian.com"
ISSUE=""
DEFAULT_PROJECT=PCDR
if [ "$1" == "" ]; then
current_branch=`git rev-parse --abbrev-ref HEAD`
if [ $? == 0 ] && [[ "${current_branch}" =~ [A-Za-z]-[0-9] ]]; then
echo "Using git branch name as JIRA issue"
@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 / 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 / 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) {
@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 / make-time-machine-work.sh
Last active August 25, 2016 19:45
Script to setup SMB share for time machine backup
#!/bin/bash
###
### This is the script I use to setup time machine to work with my LinkSys attched NAS (USB 3.0 Hard Drive)
###
#### Configurable Parameters #########
SIZE=300g
NAME="Z.org Time Machine Backup"
@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 / 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
@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 ⭕ |
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 {