Skip to content

Instantly share code, notes, and snippets.

resources:
- samba-ad-config.yaml
- samba-ad-deployment.yaml
- samba-ad-service.yaml
@tunaranch
tunaranch / custom-functions.zsh
Created February 18, 2021 00:57
CloudFormation accelerator
strip-extension(){
echo $1| rev | cut -d. -f2 | rev
}
create-stack(){
TEMPLATE_FILE=$1
shift 1;
aws cloudformation create-stack --stack-name \
"$(strip-extension $TEMPLATE_FILE)" \
--template-body file://${TEMPLATE_FILE} "$@"
@tunaranch
tunaranch / ValidatingFlowConfiguration.groovy
Created June 24, 2019 10:43
Spring Integration/Webflux validation sample
package com.example.siwebfluxvalidationdemo
import groovy.transform.ToString
import org.reactivestreams.Publisher
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
import org.springframework.core.ResolvableType
import org.springframework.http.HttpMethod
import org.springframework.http.MediaType
@tunaranch
tunaranch / PersonController.groovy
Last active August 29, 2015 14:05
Isn't this how you simulate a Grails datepicker? (Grails 2.4.2)
package g242
import grails.converters.JSON
class PersonController {
def testPost(Person person){
log.debug "JSONning ${person}"
render person as JSON
}
@tunaranch
tunaranch / Stack trace:
Created December 23, 2013 04:50
Spock seems to bomb out when there's a delegate that contains a field that's Dependency-Injected. Any ideas for a work around? Grails 2.2.3/Spock 0.7
Property 'sessionFactory' threw exception; nested exception is java.lang.NullPointerException
org.springframework.beans.MethodInvocationException: Property 'sessionFactory' threw exception; nested exception is java.lang.NullPointerException
at grails.plugin.spock.IntegrationSpec.setupSpec(IntegrationSpec.groovy:47)
Caused by: java.lang.NullPointerException
... 1 more
@tunaranch
tunaranch / coordinates.sh
Last active December 15, 2015 05:48
Quick and dirty sh script to copy a file's location to clipboard, so you can paste it into an scp command. OS X only
#!/bin/sh
#Usage: coordinates.sh foo.txt
# realpath function from http://stackoverflow.com/questions/3572030/bash-script-absolute-path-with-osx
USER=`whoami`
IP=`ifconfig en0 inet | grep "inet" | awk -F\ '{print $2}'`
realpath() {
@tunaranch
tunaranch / gist:3203000
Created July 30, 2012 00:47
Make git svn work with mountain lion without re-installing xcode
# If you have an svn install lying around, you can make git svn work without needing to reinstall xcode
$ locate SVN/Core.pm
/opt/subversion/lib/svn-perl/SVN/Core.pm
/opt/subversion_backup.03232012154503/lib/svn-perl/SVN/Core.pm
$ export PERL5LIB=/opt/subversion/lib/svn-perl/
http://repo.grails.org/grails/plugins: no latest strategy defined: using default
http://repo.grails.org/grails/plugins: no resource found for org/codehaus/groovy#groovy;[1.5,1.7.99]: pattern=http://repo.grails.org/grails/plugins/[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]
trying http://repo.grails.org/grails/plugins/org/codehaus/groovy/groovy/[1.5,1.7.99]/groovy-[1.5,1.7.99].jar
tried http://repo.grails.org/grails/plugins/org/codehaus/groovy/groovy/[1.5,1.7.99]/groovy-[1.5,1.7.99].jar
HTTP response status: 404 url=http://repo.grails.org/grails/plugins/org/codehaus/groovy/groovy/%5B1.5,1.7.99%5D/groovy-%5B1.5,1.7.99%5D.jar
CLIENT ERROR: Not Found url=http://repo.grails.org/grails/plugins/org/codehaus/groovy/groovy/%5B1.5,1.7.99%5D/groovy-%5B1.5,1.7.99%5D.jar
tried http://repo.grails.org/grails/plugins/org/codehaus/groovy/groovy/[revision]/groovy-[revision].jar
maven-metadata not available: http://repo.grails.org/grails/plugins/org/codehaus/groovy/groovy/maven-metadata.
@tunaranch
tunaranch / gist:1329575
Created November 1, 2011 01:14
Handly zsh function if you do a lot of quick git svn commits
# Paste into .zshrc
function dcommit {
git commit -am "$@" && git svn dcommit;
}
@tunaranch
tunaranch / gist:1297464
Created October 19, 2011 04:15
Change terminal theme depending on where you're ssh-ing to
# Fix bug talked about at http://news.ycombinator.com/item?id=2418726
# Tested on zsh. Paste the two following functions in your .zshrc.
# Customise the case switch to suit your own colour/host combos
function tabc {
osascript -e "tell application \"Terminal\" to set current settings of $1 to settings set \"$2\""
}