Skip to content

Instantly share code, notes, and snippets.

@sergioharo
sergioharo / changeNetworkLocation.sh
Created April 5, 2013 17:47
Bash script to programatically change the network location on a mac. This can be used for example to switch to a network location with a SOCKs proxy. The proxy can be started before the last exit.
#!/bin/bash
trap 'exit_with_reset; exit' SIGTERM SIGQUIT SIGINT SIGHUP
exit_with_reset()
{
echo "Resetting network location"
scselect "Automatic"
}
@sergioharo
sergioharo / tomcat7-instance-create
Created November 15, 2012 20:20
Script to create a CATALINA_BASE directory for your own tomcat. This is designed for tomcat installed via brew.
#!/bin/sh
# Script to create a CATALINA_BASE directory for your own tomcat
PROG=`basename $0`
TARGET=""
HPORT=8080
CPORT=8005
CWORD="SHUTDOWN"
warned=0
warnlowport=0