This file contains hidden or 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
from geoserver.catalog import Catalog | |
from geonode import settings | |
user, password = settings.GEOSERVER_CREDENTIALS | |
url = "http://localhost:8001/geoserver-geonode-dev/rest" | |
cat = Catalog(url, user, password) | |
print "Connected to GeoServer, about to get resources" | |
resources = cat.get_resources() | |
print "Got %d resources" % len(resources) | |
fixed =0 | |
for resource in resources: |
This file contains hidden or 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
""" | |
Utilities for reading Microsoft Excel files. | |
""" | |
#requires | |
#pip install xlrd | |
import xlrd | |
import datetime | |
class ExcelDictReader(object): |
This file contains hidden or 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
# easy_install boto fabric | |
# The only pre-req is having created a keypair via the amazon web interface | |
# | |
# Usage: | |
# fab geonode | |
from fabric.api import env, sudo, run, cd | |
import os, time, boto | |
import ConfigParser |
This file contains hidden or 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
# easy_install fabric | |
# | |
# Usage: | |
# fab geonode | |
from fabric.api import env, sudo, run, cd | |
def setup(): | |
sudo('apt-get -y update') | |
sudo('apt-get -y dist-upgrade') | |
sudo('add-apt-repository "deb http://archive.canonical.com/ lucid partner"') |
This file contains hidden or 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
# easy_install boto | |
# You will also need: | |
# - A .pem keyfile generated using the Amazon web interface to create new instances | |
# - The secret and access keys created from the | |
# The only pre-reqs are having created a keypair (.pem file) | |
# via the amazon web interface and knowing the AWS key and secret | |
# | |
# Usage: | |
# export AWS_ACCESS_KEY_ID='blahblah' | |
# export AWS_SECRET_ACCESS_KEY='blebleble' |
This file contains hidden or 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
name=middle and lower Cauca river basin; northlimit=8.87; southlimit=3.12; westlimit=-76.7; eastlimit=-74.7 | |
name=Magdalena river basin; northlimit=11.09; southlimit=3.64; westlimit=-74.97; eastlimit=-73.71 | |
name=Barranquilla and Soledad; northlimit=11.09; southlimit=10.82; westlimit=-74.84; eastlimit=-74.71 | |
name=Cartagena; northlimit=10.51; southlimit=10.33; westlimit=-75.59; eastlimit=-75.36 | |
name=middle Bogotá river basin; northlimit=4.88; southlimit=4.53; westlimit=-74.33; eastlimit=-74.01 | |
name=lower Bogotá river basin; northlimit=4.46; southlimit=4.28; westlimit=-74.82; eastlimit=-74.59 | |
name=lower Sumapaz river basin; northlimit=4.26; southlimit=4.18; westlimit=-74.79; eastlimit=-74.53 | |
name=Saldaña river basin; northlimit=4.26; southlimit=4.18; westlimit=-74.79; eastlimit=-74.53 | |
name=La Gamarra; northlimit=8.45; southlimit=8.14; westlimit=-73.86; eastlimit=-73.69 |
This file contains hidden or 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
def sendEmail(toAddr: Array[String], fromAddr: String, subject: String, headers: Scriptable, content: String): String = { | |
try { | |
val badAddresses = for (a <- toAddr if (a.indexOf("@") == -1)) yield a; | |
if (badAddresses.length > 0) { | |
"The email address"+(if (badAddresses.length > 1) "es" else "")+" "+ | |
badAddresses.mkString("\"", "\", \"", "\"")+" do"+(if (badAddresses.length == 1) "es" else "")+ | |
" not appear to be valid."; | |
} else { | |
val debug = false; |
This file contains hidden or 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
# easy_install fabric | |
# | |
# fab -H user@hostname setup | |
from fabric.api import run, env | |
def setup(): | |
run('echo "[opengeo]" >> /etc/yum.repos.d/opengeo.repo') | |
run('echo "name=opengeo" >> /etc/yum.repos.d/opengeo.repo') | |
run('echo "baseurl=http://opengeo:[email protected]/centos/" >> /etc/yum.repos.d/opengeo.repo') | |
run('echo "enabled=1" >> /etc/yum.repos.d/opengeo.repo') |
This file contains hidden or 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
#export HOST="127.0.0.1" | |
export DEBIAN_FRONTEND=noninteractive | |
sudo apt-get -y dist-upgrade | |
# For Java 6 JDK | |
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner" | |
# For GeoNode | |
sudo add-apt-repository "deb http://apt.opengeo.org/lucid lucid main" |
This file contains hidden or 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 | |
# Optionally, uncomment this to install dependencies. | |
#sudo apt-get install -y openjdk-6-jdk unzip gdal-bin curl xmlindent | |
export JAVA_HOME=/usr/lib/jvm/java-6-openjdk | |
# Download GeoServer | |
wget -c http://gridlock.opengeo.org/geoserver/trunk/geoserver-trunk-latest-bin.zip | |
unzip geoserver-trunk-latest-bin.zip |