Skip to content

Instantly share code, notes, and snippets.

View ict4eo's full-sized avatar

ICT4EO Research Group ict4eo

View GitHub Profile
@ict4eo
ict4eo / wiki_google2rst.py
Last active August 29, 2015 13:57
Convert a document in Google Code wiki page format to reStructuredText (reST)
"""
Convert a wikipage in Google wiki format to reStructuredText
Version 1.0.2
19 March 2014
Derek Hohls, Meraka, CSIR
Handles
=======
* internal comments (#name - no space)
* bold / italics text
@ict4eo
ict4eo / 0_reuse_code.js
Created March 19, 2014 13:30
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@ict4eo
ict4eo / python_resources.md
Created March 19, 2014 13:30 — forked from jookyboi/python_resources.md
Python-related modules and guides.

Packages

  • lxml - Pythonic binding for the C libraries libxml2 and libxslt.
  • boto - Python interface to Amazon Web Services
  • Django - Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
  • Fabric - Library and command-line tool for streamlining the use of SSH for application deployment or systems administration task.
  • PyMongo - Tools for working with MongoDB, and is the recommended way to work with MongoDB from Python.
  • Celery - Task queue to distribute work across threads or machines.
  • pytz - pytz brings the Olson tz database into Python. This library allows accurate and cross platform timezone calculations using Python 2.4 or higher.

Guides

@ict4eo
ict4eo / nc-quick_view
Last active December 31, 2015 17:59
Quick view of netCDF file (param/lat/lon type)
import gdal
import netCDF4
import sys
import matplotlib.pyplot as plt
def plot(file_path, title=""):
gdal_data = gdal.Open(file_path)
arr = gdal_data.ReadAsArray()
#print "shapes", arr.shape, arr.dtype
@ict4eo
ict4eo / docker_geonode
Created January 8, 2014 12:32
Docker install script for GeoServer/GeoNode
# GeoNode / GeoServer install for Docker
# Save file as Dockerbuild; sudo docker build -t ubuntu/testgeo3 .
# VERSION 1.0.0
FROM ubuntu
MAINTAINER Derek Hohls <dhohls@csir.co.za>
# make sure the package repository is up to date
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
RUN apt-get update
@ict4eo
ict4eo / profile.xml
Last active January 3, 2016 03:09
profile.xml for 52N SOS
<profile>
<id>52n-start</id>
<repositories>
<repository>
<id>n52-releases</id>
<name>52n Releases</name>
<url>http://52north.org/maven/repo/releases</url>
<releases>
<enabled>true</enabled>
</releases>
@ict4eo
ict4eo / serviceProvider.xml
Created January 14, 2014 13:58
Service Provider XML configuration for 52N SOS at Meraka
<?xml version="1.0" encoding="UTF-8"?>
<ows:ServiceProvider xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xlink="http://www.w3.org/1999/xlink">
<ows:ProviderName>Meraka</ows:ProviderName>
<ows:ProviderSite xlink:href="http://www.meraka.org" />
<ows:ServiceContact>
<ows:IndividualName>TBA</ows:IndividualName>
<ows:PositionName>TBA</ows:PositionName>
<ows:ContactInfo>
<ows:Phone>
<ows:Voice>+27 12 8412911</ows:Voice>
@ict4eo
ict4eo / sos_to_wfs.py
Created January 17, 2014 16:03
Create a view for a 52N SOS, so that it can be accessed as a WFS from, for example, QGIS or GeoServer
"""
Create a view for a 52N SOS, so that it can be accessed as a WFS from,
for example, QGIS or GeoServer
Version: 0.1
Author: Derek Hohls, Meraka, CSIR
"""
import psycopg2 as psy
@ict4eo
ict4eo / Dockerfile
Last active August 31, 2016 10:19
Dockerfile: geoserver+geonode+postgresql+52NSOS
# GeoNode / GeoServer install for Docker
# Save file as Dockerbuild; run sudo
# VERSION 0.0.1
# TEST = 'foo'
FROM ubuntu
MAINTAINER Derek Hohls <dhohls@csir.co.za>
# make sure the package repository is up to date
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
@ict4eo
ict4eo / Dockerfile
Created February 28, 2014 08:47
Dockerfile for SVN
FROM ubuntu
MAINTAINER Derek Hohls <dhohls@csir.co.za>
# make sure the package repository is up to date
RUN apt-get update
# general
RUN apt-get install -y gcc patch wget curl nano
# Install Subversion 1.8 and Apache