Skip to content

Instantly share code, notes, and snippets.

# 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
@etes
etes / boreholes.R
Last active October 2, 2015 16:18
plot borehole locations on Google Maps
library(rgdal)
library(RgoogleMaps)
boreholes<- read.csv("boreholes.csv", sep=",", header=TRUE)
bh_grd <- SpatialPoints(boreholes[,c("East","North")],
proj4string=CRS("+proj=utm +zone=32 +datum=WGS84"))
bholes<- SpatialPointsDataFrame(bh_grd,boreholes[,-c(2,3)])
bholes<-bholes[,-c(2,3)]
bh_geo<- spTransform(bholes, CRS("+proj=longlat +datum=WGS84"))
North<-coordinates(bh_geo)[,2]
@etes
etes / Install_Postgis_Ubuntu_11.10.sh
Created May 25, 2012 21:36 — forked from ikennaokpala/Install_Postgis_Ubuntu_11.10.sh
Install Postgres 9.1, PostGIS and create PostGIS template on Ubuntu 11.10 Oneiric Ocelot
#!/bin/bash
#
# Install Postgres 9.1, PostGIS and create PostGIS template on a clean Ubuntu 11.10 Oneiric Ocelot box
# http://wildfish.com
# add the ubuntu gis ppa
sudo apt-get -y install python-software-properties
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
@etes
etes / gist:6257400
Created August 17, 2013 15:21
requirement for deploying a web app.
maps.google.com
### get the google maps api key
### install django on ubuntu test server and centOS
### install PostGres and PostGIS 2.0
### install gdal on python 2.7
### get apache or ngnix server
### get openlayers and GeoDjango
rows, cols = 10, 10
iceraster = (10*numpy.random.random((rows, cols))).astype(int)*5
iceraster = numpy.where( (iceraster >= 20), 20, iceraster)
outarray = numpy.zeros((rows, cols), numpy.float)
NumberOfDays = 3
#Obsolete pixel-by-pixel version, takes very long
for (i,j), value in numpy.ndenumerate(outarray):
if iceraster[i,j] == 0:
outarray[i,j] = outarray[i,j] + ( 0.0 / NumberOfDays)
elif iceraster[i,j] == 5:
@etes
etes / directorySize.ps1
Last active January 3, 2016 05:49
miscellaneous scripts
$startfolder = "c:\data\*"
$folders = get-childitem $startfolder | where{$_.PSiscontainer -eq "True"}
"Directory Name`tDirectory Size (MB)"
foreach ($fol in $Folders){
$colItems = (Get-ChildItem $fol.fullname -recurse | Measure-Object -property length -sum)
$size = "{0:N2}" -f ($colItems.sum / 1MB)
"$($fol.name)`t$size"
}
@etes
etes / install_go.sh
Last active October 11, 2016 11:05
Install golang on ArmV6
wget https://storage.googleapis.com/golang/go1.7.1.linux-armv6l.tar.gz
tar -C /usr/local -xzf go1.7.1.linux-armv6l.tar.gz
export PATH=$PATH:/usr/local/go/bin
export GOPATH=$HOME/go
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
@etes
etes / supervisord-example.conf
Created March 7, 2017 12:51 — forked from didip/supervisord-example.conf
Example configuration file for supervisord.conf
[unix_http_server]
file=/tmp/supervisor.sock ; path to your socket file
[supervisord]
logfile=/var/log/supervisord/supervisord.log ; supervisord log file
logfile_maxbytes=50MB ; maximum size of logfile before rotation
logfile_backups=10 ; number of backed up logfiles
loglevel=error ; info, debug, warn, trace
pidfile=/var/run/supervisord.pid ; pidfile location
nodaemon=false ; run supervisord as a daemon
@etes
etes / supervisord.sh
Created March 7, 2017 12:51 — forked from danmackinlay/supervisord.sh
an init.d script for supervisord
#! /bin/sh
### BEGIN INIT INFO
# Provides: supervisord
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Example initscript
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.
@etes
etes / supervisord.sh
Created March 7, 2017 12:51 — forked from mhayes/supervisord.sh
init.d for supervisord for Amazon Linux AMI
#!/bin/sh
# Amazon Linux AMI startup script for a supervisor instance
#
# chkconfig: 2345 80 20
# description: Autostarts supervisord.
# Source function library.
. /etc/rc.d/init.d/functions
supervisorctl="/usr/bin/supervisorctl"