Skip to content

Instantly share code, notes, and snippets.

Aaron J. Zirbes aaronzirbes

Block or report user

Report or block aaronzirbes

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@aaronzirbes
aaronzirbes / add-host-to-ubuntu-keystore.sh
Created Feb 3, 2012
This will add a web server's SSL certificate to your Ubuntu System-wide keystore
View add-host-to-ubuntu-keystore.sh
#!/bin/bash
host=$1
port=$2
# Make sure we got the host name
if (( ${#host} == 0 )); then
echo "usage: $0 <hostname> [port]"
exit 1
elif (( ${#port} == 0 )); then
View SpringSecurityCoreGrailsPluginSnippet.groovy
/* 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 / gist:3239033
Created Aug 2, 2012
brew doctor and libmacfuse/libosxfuse
View gist:3239033
If you see...
Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected dylibs:
/usr/local/lib/libmacfuse_i32.2.dylib /usr/local/lib/libmacfuse_i64.2.dylib /usr/local/lib/libosxfuse_i32.2.dylib /usr/local/lib/libosxfuse_i64.2.dylib
Warning: Unbrewed .la files were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
@aaronzirbes
aaronzirbes / shrink-git-repo.sh
Created Jan 19, 2013
This script will help you remove large files from your git repo history and shrink the size of your repository.
View shrink-git-repo.sh
#!/bin/bash
echo "Finding and Purging Big Files From Git History"
echo "=============================================="
echo ""
echo "http://naleid.com/blog/2012/01/17/finding-and-purging-big-files-from-git-history/"
echo ""
pushd "$(git rev-parse --show-toplevel)" > /dev/null
@aaronzirbes
aaronzirbes / gist:4773392
Created Feb 12, 2013
Finding Fast Encryption Algorythms
View gist:4773392
@Grapes([
@Grab(group='org.bouncycastle', module='bcprov-jdk15on', version='1.47'),
@Grab(group='org.jasypt', module='jasypt', version='1.9.0')
])
import java.security.Provider
import java.security.Security
import java.security.NoSuchAlgorithmException
import org.jasypt.exceptions.EncryptionInitializationException
import org.bouncycastle.jce.provider.BouncyCastleProvider
@aaronzirbes
aaronzirbes / gist:4773776
Created Feb 12, 2013
Ensure encryption algos encrypt to the same field length
View gist:4773776
@Grapes([
@Grab(group='org.bouncycastle', module='bcprov-jdk15on', version='1.47'),
@Grab(group='org.jasypt', module='jasypt', version='1.9.0')
])
import java.security.Provider
import java.security.Security
import java.security.NoSuchAlgorithmException
import org.jasypt.exceptions.EncryptionInitializationException
import org.bouncycastle.jce.provider.BouncyCastleProvider
@aaronzirbes
aaronzirbes / find-missing-specs.sh
Created Feb 20, 2013
Find groovy classes that don't have Spock tests written for them yet.
View find-missing-specs.sh
#!/bin/bash
groovy_src=src/main/groovy
spec_src=src/test/groovy
groovy_classes='_groovy_classes.txt'
specs='_spock_specs.txt'
find ${groovy_src} -name *.groovy \
| sed -e 's#.*/##' -e 's/\.groovy$//' \
| sort -u \
@aaronzirbes
aaronzirbes / hammer_grails_console.js
Last active Dec 15, 2015
This will hammer the Grails /console to try to get it to fail when it drops the POST data
View hammer_grails_console.js
for (var wat = 0; wat < 1000; wat++) {
var url = '/console/execute';
var data = { code: "println 'too big to fail'\n" };
$.post(url, data, function(data, textStatus) {
console.log(textStatus);
if (data.exception) {
console.log("Found Error!");
console.log(data.exception);
}
@aaronzirbes
aaronzirbes / GrailsEnum.groovy
Last active Dec 18, 2015
Trying to write an AST transformer to make it easier to add a @GrailsEnum annotation
View GrailsEnum.groovy
class GrailsEnumType {
String name
}
@interface GrailsEnumHolder {
String value() default 'default value'
}
@interface Parameter {
String name() default 'default name'
View diskcheck.sh
#!/bin/bash
devices=`mount |grep -E '^/dev/' | cut -d ' ' -f 1`
warn_threshold="85"
fail_threshold="90"
status="OK"
for device in ${devices}; do
diskfree=`df -h ${device} |grep ${device}`
percent=`echo ${diskfree} |awk '{print $5}' |sed -e 's/%//'`
You can’t perform that action at this time.