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 bash | |
# determine the local gateway | |
netstat -nr|grep '^default' |
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 ruby | |
require "rubygems" | |
require "thor" | |
require 'terminal-notifier' | |
class NotifyAfter < Thor | |
desc "after ARGS", | |
"ARGS is the after and list of arguments to run, after which you will be notified." |
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 | |
cmd=$1 | |
function init_postgres() { | |
initdb /usr/local/var/postgres | |
} | |
function start_postgres() { | |
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start |
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 | |
# | |
# Simple file unlocking utility for Mac OS X | |
# | |
ARGS=1 | |
E_BADARGS=65 | |
SETFILE=/Applications/Xcode.app/Contents/Developer/usr/bin/SetFile | |
function recursiveUnlock() { | |
pushd $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
#!/usr/bin/env bash | |
cmd=$1 | |
function start_redis() { | |
nohup redis-server /usr/local/etc/redis.conf > /dev/null 2>&1 & | |
} | |
function stop_redis() { | |
redis-cli shutdown |
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 bash | |
# Use curl for REST testing apis | |
# | |
# curl params: | |
# i – show response headers | |
# H – pass request headers to the resource | |
# X – pass a HTTP method name | |
# d – pass in parameters enclosed in quotes; multiple parameters are separated by ‘&’ | |
# curl -i -H "Accept: application/json" -X POST -d "firstName=james" http://192.168.0.165/persons/person |
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 | |
# ether 3c:07:54:12:6d:fc | |
if [ -z "$1" ]; then | |
echo "usage: $0 NETWORK_INTERFACE(en0|en1)" | |
exit 1 | |
fi | |
interface="$1" | |
mac=`openssl rand -hex 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
#!/usr/bin/env bash | |
cmd=$1 | |
function start_tor() { | |
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.tor.plist | |
} | |
function stop_tor() { | |
launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.tor.plist |
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 bash | |
cmd=$1 | |
PROG=/usr/local/opt/varnish3/sbin/varnishd | |
VCL=/usr/local/etc/varnish/default.vcl | |
OPTS="-n /usr/local/var/varnish -f $VCL -s malloc,1G -T localhost:6082 -a :6081" | |
function start_varnish() { | |
echo "Running [$PROG $OPTS]" | |
$PROG $OPTS |
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 ruby | |
# A Ruby bulk file renaming script | |
require 'fileutils' | |
require 'pry' | |
require 'colored' | |
require 'trollop' | |
class BulkFileRename | |
include FileUtils |