Skip to content

Instantly share code, notes, and snippets.

@loosebits
loosebits / git-stconfig
Last active November 3, 2016 11:27
Tools for git subtree
#! /bin/bash
ROOT=$(git rev-parse --show-toplevel)
usage()
{
echo "Configures a subtree for git stpull"
echo ""
echo "git stconfig [-b=<branch>] -r=<remote> -p=<prefix> [--pull] <subtree-config-name>"
echo "git stconfig [-h | --help]"
@loosebits
loosebits / html2groovy.groovy
Last active August 29, 2015 14:12
Converts HTML into Groovy's MarkupBuilder code
import groovy.util.XmlSlurper
import groovy.util.slurpersupport.*
def root = new XmlSlurper().parse(new File(args[0]))
def getAttributes(node) {
String res = '';
node.attributes().each { key, value ->
if (key == 'class') {
key = "'class'"
@loosebits
loosebits / vpn.sh
Last active August 29, 2015 14:09
VPN/Routing script
#! /bin/bash
PPPOE=HCSC
IFNAME=utun0
SUBNET="10.0.0.0/8"
if [ $(id -u) != "0" ]
then
echo "Running using sudo.."
sudo "$0" "$@"
exit $?
fi