Skip to content

Instantly share code, notes, and snippets.

View ivanfoong's full-sized avatar

ivanfoong ivanfoong

View GitHub Profile
@ivanfoong
ivanfoong / jarfile.sh
Created April 15, 2013 06:30
Start/Stop script for Java jar executables
#!/bin/bash
export JAVA_HOME=/usr/local/java/
CLASSPATH=ajarfile.jar:.
case $1 in
start)
echo $$ > /var/run/xyz.pid;
exec 2>&1 java -cp ${CLASSPATH} org.something.with.main 1>/tmp/xyz.out
;;
stop)
@ivanfoong
ivanfoong / toggleShowHiddenFiles.sh
Created April 14, 2013 08:09
Display Hidden Files/Folders for Mac
# check if hidden files are visible and store result in a variable
isVisible=”$(defaults read com.apple.finder AppleShowAllFiles)”
# toggle visibility based on variables value
if [ "$isVisible" = FALSE ]
then
defaults write com.apple.finder AppleShowAllFiles TRUE
else
defaults write com.apple.finder AppleShowAllFiles FALSE
fi
# Some good references are:
# http://russbrooks.com/2010/11/25/install-postgresql-9-on-os-x
# http://www.paolocorti.net/2008/01/30/installing-postgis-on-ubuntu/
# http://postgis.refractions.net/documentation/manual-1.5/ch02.html#id2630392
#1. Install PostgreSQL postgis and postgres
brew install postgis
initdb /usr/local/var/postgres
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start