This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task prefixNewMigrations { | |
fileTree(dir: 'dev/src/db/listhub').exclude({ isFilePrefixed(it.file) }).each { file -> | |
doLast { | |
def timestamp = new Date().format('yyyyMMddHHmmssSSS', TimeZone.getTimeZone('GMT')) | |
println "Renaming $file.name to ${timestamp}__$file.name" | |
file.renameTo("$file.parentFile.absolutePath$file.separator${timestamp}__$file.name") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example use: | |
# | |
# 1.9.3p392 :000 > equal_div(432,239842934,22) | |
# => [[432, 10902364], [10902365, 21804297], [21804298, 32706230], [32706231, 43608163], [43608164, 54510096], [54510097, 65412029], [65412030, 76313962], [76313963, 87215895], [87215896, 98117828], [98117829, 109019761], [109019762, 119921694], [119921695, 130823627], [130823628, 141725560], [141725561, 152627493], [152627494, 163529426], [163529427, 174431359], [174431360, 185333292], [185333293, 196235225], [196235226, 207137158], [207137159, 218039091], [218039092, 228941024], [228941025, 239842934]] | |
# | |
# 1.9.3p392 :001 > equal_div(432,239842934,4) | |
# => [[432, 59961058], [59961059, 119921685], [119921686, 179882312], [179882313, 239842934]] | |
# | |
def equal_div(first, last, num_of_groups) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function errexit() { | |
local err=$? | |
set +o xtrace | |
local code="${1:-1}" | |
echo "Error in ${BASH_SOURCE[1]}:${BASH_LINENO[0]}. '${BASH_COMMAND}' exited with status $err" | |
# Print out the stack trace described by $function_stack | |
if [ ${#FUNCNAME[@]} -gt 2 ] | |
then | |
echo "Call tree:" | |
for ((i=1;i<${#FUNCNAME[@]}-1;i++)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Building static nginx for teh lulz | |
# | |
# basic dependencies | |
sudo apt-get install libxslt1-dev libxml2-dev zlib1g-dev libpcre3-dev libbz2-dev libssl-dev | |
# download nginx and openssl | |
wget http://nginx.org/download/nginx-1.5.6.tar.gz | |
tar xf nginx-1.5.6.tar.gz; cd nginx-1.5.6 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# script to automate the creation of chroot jail | |
# w/ minimal executables to run git | |
export CHROOT=/var/chroot | |
function copy_binary() { | |
for i in $(ldd $*|grep -v dynamic|cut -d " " -f 3|sed 's/://'|sort|uniq) | |
do | |
cp --parents $i $CHROOT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// layout file | |
<body> | |
<div class="container"> | |
<%= flash_messages %> | |
<%= yield %> | |
</div><!-- /container --> | |
</body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
NGINX_VERSION="1.6.0" | |
NGINX_TARBALL="nginx-${NGINX_VERSION}.tar.gz" | |
PCRE_VERSION="8.34" | |
PCRE_TARBALL="pcre-${PCRE_VERSION}.tar.gz" | |
OPENSSL_VERSION="1.0.1g" | |
OPENSSL_TARBALL="openssl-${OPENSSL_VERSION}.tar.gz" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Install homebrew: | |
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" | |
## Run brew doctor to make sure everything is ok | |
brew doctor | |
## Install mutt | |
brew install mutt | |
## Setup your .muttrc file with the gmail smtp info: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jbarnett@Hackintosh-10 ~ $ cat ~/.ssh/config | |
Host r176.spigit.com r178.spigit.com | |
ProxyCommand ssh -T operations002.c.mindjet-gce-stack.internal 'nc %h %p' | |
jbarnett@Hackintosh-10 ~ $ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Author: Jason Barnett <[email protected]> | |
# | |
# The MIT License (MIT) | |
# | |
# Copyright (c) 2014 Jason Barnett | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights |