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
# 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 |
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
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] |
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 | |
# | |
# 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 |
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
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 |
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
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: |
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
$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" | |
} |
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
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 |
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
[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 |
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 | |
### 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. |
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 | |
# 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" |
OlderNewer