This file contains 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 | |
[ -e /etc/profile.d/proxy.sh ] && source /etc/profile.d/proxy.sh | |
# Some defaults that may be overridden by command line | |
HEADLESS=false | |
CLEAN=false | |
# Execute getopt |
This file contains 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
source 'https://rubygems.org' | |
gem 'json' | |
group :test do | |
gem 'minitest' | |
gem 'test-unit' | |
end |
This file contains 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 | |
function isLocalhost { | |
local TEST_IP=$(getent hosts $1 | cut -f1 -d\ | head -1) | |
local ALL_MY_IPS=$(ip addr | grep inet | grep -v link | cut -f2- -de | cut -f2 -d\ | cut -f1 -d/) | |
( echo $ALL_MY_IPS | grep -q $TEST_IP ) && return 0 | |
return 1 | |
} |
This file contains 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 | |
while ! klist -s ; do | |
ERR=$( kinit 3>&2 2>&1 1>&3- ) | |
EC=$? | |
if [ $EC -ne 0 ] ; then | |
echo $ERR | |
if ( echo $ERR | grep -q "Cannot contact any KDC" ) ; then | |
exit 2 | |
fi |
This file contains 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 | |
FILE_PATH=$1; | |
while([ -h "${FILE_PATH}" ]) do cd -P $(dirname "${FILE_PATH}"); FILE_PATH=$(readlink "${FILE_PATH}"); done | |
cd -P $(dirname "${FILE_PATH}") > /dev/null | |
echo $(pwd); |
This file contains 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 | |
function whereIsFile() { | |
pushd . > /dev/null | |
FILE_PATH=$1; | |
while([ -h "${FILE_PATH}" ]) do cd -P $(dirname "${FILE_PATH}"); FILE_PATH=$(readlink "${FILE_PATH}"); done | |
cd -P $(dirname "${FILE_PATH}") > /dev/null | |
echo $(pwd) | |
popd >/dev/null | |
} |
This file contains 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 | |
curl http://localhost:8983/solr/gettingstarted/schema -D - -X POST -H \ | |
'Content-type:application/json' --data-binary '{ | |
"add-field" : { | |
"name":"name", | |
"type":"text_general", | |
"stored":true | |
}, | |
"add-field" : { |
This file contains 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
$ cat git-show-big | |
#!/bin/bash | |
# Ref http://naleid.com/blog/2012/01/17/finding-and-purging-big-files-from-git-history | |
SHAS=$(git rev-list --objects --all | sort -k 2) | |
BIGOBJS=$(git gc && git verify-pack -v .git/objects/pack/pack-*.idx | egrep "^\w+ blob\W+[0-9]+ [0-9]+ [0-9]+$" | sort -k 3 -n -r) | |
join <(echo "$BIGOBJS" | sort ) <(echo "$SHAS" | sort ) | sort -k 3 -n -r | cut -f 1,3,6- -d\ |
This file contains 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
#!/usr/bin/env python3 | |
from circuits import Debugger, BaseComponent, handler | |
from circuits.web import Controller, Server | |
from circuits.web.errors import redirect | |
from urllib.parse import urlparse, urlunparse | |
class Root(Controller): | |
def index(self): | |
return "Hello World!" |
This file contains 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/env python3 | |
from circuits.web.client import Client, request as request_event | |
from circuits.web import Server, Controller | |
from circuits import handler, Debugger | |
class Root(Controller): | |
channel = "web" | |
def __init__(self): |
OlderNewer