Skip to content

Instantly share code, notes, and snippets.

View ingenieroariel's full-sized avatar

Ariel Núñez ingenieroariel

View GitHub Profile
@ingenieroariel
ingenieroariel / s3down.py
Created February 15, 2011 16:49
there are scripts to download from S3 into two folders "zips" and "geotiffs", and then one script to upload the shapefiles to geoserver (zipup.sh) and another one to upload the geo
from boto.s3.connection import S3Connection
from boto.s3.key import Key
import sys
import os
conn = S3Connection('XXX', 'XXXXXXXXX')
bucket = conn.get_bucket('mydata')
rs = bucket.list()
SHP_DIR="haitiwbdata/zips"
from django.conf.urls.defaults import *
from django.conf import settings
from staticfiles.urls import staticfiles_urlpatterns
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
js_info_dict = {
'packages': ('geonode.maps',),
from itertools import cycle, izip
import logging
import re
from django.db import transaction
from django.utils.translation import ugettext as _
from django.contrib.auth.models import User
from geonode.maps.models import Map, Layer, MapLayer, Contact, ContactRole, Role, get_csw
from geonode.maps.gs_helpers import fixup_style
import geoserver
from geoserver.resource import FeatureType, Coverage
@ingenieroariel
ingenieroariel / letter-to-geonode-dev.txt
Created April 4, 2011 20:48
GeoNode stability and automated tests
Hello from Jakarta, Indonesia.
I have spent the last two weeks working with very bright minds of a project called Risk In a Box that uses GeoNode as it's core. The GeoNode demo server has been down a couple of times just before important meetings with local organizations and government officials. We also spent an entire day debugging the upload code in GeoNode for the automatically generated layers and my friend Ole pointed out the fact that there are big try/except blocks that eat up exceptions and fail silently in our upload handling code.
These situations made us take a step back from Risk In a Box development and realize that we need to invest some time bringing up GeoNode to the standards of quality of it's parent projects: GeoServer and Django.
We love GeoNode for what it could be, and will be, but we need to be fair with ourselves, and our users, look at the current status of the project and decide what actions should be taken. This is not the time to point fingers, but I would be the first to admit
@ingenieroariel
ingenieroariel / fabfile.py
Created May 10, 2011 15:43
GeoNode installation
from fabric.api import env, sudo, run, cd, local, put
import os
GEONODE_HOST = os.environ['GEONODE_HOST']
GEONODE_USER = os.environ['GEONODE_USER']
GEONODE_PASSWORD = os.environ['GEONODE_PASSWORD']
env.hosts = ['%s@%s' % (GEONODE_USER, GEONODE_HOST)]
env.password = GEONODE_PASSWORD
@ingenieroariel
ingenieroariel / single_point.dbf
Created May 16, 2011 16:08
Upload to GeoNode using the upload form via a script
@ingenieroariel
ingenieroariel / geonode-setup.sh
Created May 31, 2011 14:08
GeoNode development environment setup
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo apt-get -y update
sudo echo "sun-java6-bin shared/accepted-sun-dlj-v1-1 boolean true" | sudo debconf-set-selections
sudo echo "sun-java6-jdk shared/accepted-sun-dlj-v1-1 boolean true" | sudo debconf-set-selections
sudo echo "sun-java6-jre shared/accepted-sun-dlj-v1-1 boolean true" | sudo debconf-set-selections
sudo echo "sun-java6-jre sun-java6-jre/stopthread boolean true" | sudo debconf-set-selections
sudo echo "sun-java6-jre sun-java6-jre/jcepolicy note" | sudo debconf-set-selections
sudo echo "sun-java6-bin shared/present-sun-dlj-v1-1 note" | sudo debconf-set-selections
sudo echo "sun-java6-jdk shared/present-sun-dlj-v1-1 note" | sudo debconf-set-selections
sudo echo "sun-java6-jre shared/present-sun-dlj-v1-1 note" | sudo debconf-set-selections
--- config.xml.orig 2011-08-11 15:15:19.702395855 +0700
+++ config.xml 2011-01-12 23:42:12.000000000 +0700
@@ -93,7 +93,7 @@
<!-- mckoi standalone -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <resource enabled="false">
+ <resource enabled="true">
<name>main-db</name>
<provider>jeeves.resources.dbms.DbmsPool</provider>
@ingenieroariel
ingenieroariel / integration-tests.sh
Created September 30, 2011 21:26
Running GeoNode integration tests in Ubuntu 11.04
sudo apt-get install -y --force-yes openjdk-6-jdk
udo apt-get install -y vim zip unzip subversion git-core binutils build-essential python-dev python-setuptools python-imaging python-reportlab gdal-bin libproj-dev libgeos-dev python-urlgrabber python-scipy python-nose python-virtualenv python-pastescript postgresql-contrib libpq-dev gettext python-psycopg2
sudo apt-get install maven2 --no-install-recommends
# geonode dev setup
git clone git://github.com/GeoNode/geonode.git
cd geonode
python bootstrap.py
source bin/activate
paver build
@ingenieroariel
ingenieroariel / geonode_restrict.py
Created November 22, 2011 19:40
Make all maps and layers private in a GeoNode
from geonode.core.models import AUTHENTICATED_USERS, ANONYMOUS_USERS
def restrict(item):
"""Works with GeoNode Map and Layer objects to disable unauthenticated access.
"""
item.set_gen_level(ANONYMOUS_USERS, item.LEVEL_NONE)
item.set_gen_level(AUTHENTICATED_USERS, item.LEVEL_READ)
def publish(item):
"""Works with GeoNode Map and Layer objects to enable unauthenticated access.