Skip to content

Instantly share code, notes, and snippets.

View kitplummer's full-sized avatar
🏠
Working from home

Kit Plummer kitplummer

🏠
Working from home
View GitHub Profile
@kitplummer
kitplummer / openstack.groovy
Created June 12, 2013 22:01
Simple Groovy script working with OpenStack's Keystone and Compute(Nova) APIs.
@Grab(group="org.codehaus.groovy.modules.http-builder", module="http-builder", version='0.5.2')
import groovyx.net.http.RESTClient
import groovy.util.slurpersupport.GPathResult
import groovy.json.*
keystone = new RESTClient( 'http://10.0.1.49:5000/v2.0/' )
resp = keystone.post( path : 'tokens',
body : [auth:[passwordCredentials:[username: "admin", password:"stack"], tenantId: "2ba2d60c5e8d4d1b86549d988131fe48"]],
err: /Stage[main]/Omar::Omar/Package[postgis2_92]/ensure: change from absent to present failed: Execution of '/usr/bin/yum -d 0 -e 0 -y install postgis2_92' returned 1: Error: Package: postgis2_92-2.0.3-2.rhel6.x86_64 (pgdg92)
Requires: libgdal.so.1()(64bit)
Available: gdal-1.7.2-1.el6.x86_64 (pgdg91)
libgdal.so.1()(64bit)
Available: gdal-1.7.3-15.el6.x86_64 (epel)
libgdal.so.1()(64bit)
Installed: gdal-1.9.2-1.x86_64 (@codice)
Not found
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
@kitplummer
kitplummer / initialize.sh
Created February 1, 2013 00:10
initialize openstack instance.
#!/bin/bash
if [ -f /root/.initialized ]; then
exit 0
fi
FQDN=`/usr/bin/curl -s http://169.254.169.254/latest/user-data | grep hostname | sed 's/.*=//' | sed 's/ //'`
HOSTNAME=`echo ${FQDN} | awk -F"." '{print $1}'`
PM=`/usr/bin/curl -s http://169.254.169.254/latest/user-data | grep puppetmaster | sed 's/.*=//' | sed 's/ //'`
@kitplummer
kitplummer / Vagrantfile
Last active December 11, 2015 05:28
Vagrantfile for OMAR box
Vagrant::Config.run do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "CentOS6_64"
config.vm.customize ["modifyvm", :id, "--memory", 2048]
# The url from where the 'config.vm.box' box will be fetched if it
@kitplummer
kitplummer / gh_ark.rb
Created January 9, 2013 17:53
Fetch from githubarchive.org and drop into MongoDB...
require 'open-uri'
require 'zlib'
require 'yajl'
require 'mongo'
require 'date'
require 'iconv'
include Mongo
@client = MongoClient.new('localhost', 27017)
@kitplummer
kitplummer / initialisation.sh
Created November 30, 2012 17:29
Initialize in EC2
#!/usr/bin/ruby
require 'rubygems'
require 'fog'
# Import EC2 credentials e.g. @aws_access_key_id and @aws_access_key_id
require './config.rb'
# Set up a connection
connection = Fog::Compute.new(
:provider => 'AWS',
:region => 'us-east-1',
@kitplummer
kitplummer / temp.c
Created November 14, 2012 03:39
tmp102 from Pi.
#include <errno.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <linux/i2c-dev.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
@kitplummer
kitplummer / wfs.xml
Created October 2, 2012 02:46
WFS from OMAR
<?xml version='1.0' encoding='utf-8'?>
<wfs:FeatureCollection xmlns:omar='http://omar.ossim.org' xmlns:wfs='http://www.opengis.net/wfs' xmlns='http://www.opengis.net/wfs' xmlns:gml='http://www.opengis.net/gml'>
<gml:boundedBy>
<gml:null>unknown</gml:null>
</gml:boundedBy>
<gml:featureMember>
<omar:raster_entry fid='raster_entry.1'>
<omar:id>1</omar:id>
<omar:version>1</omar:version>
<omar:access_date />
elevation_manager.elevation_source2.type: dted_directory
elevation_manager.elevation_source2.connection_string: /Volumes/Iomega_HDD/data/elevation/dted/1k
elevation_manager.elevation_source2.min_open_cells: 500
elevation_manager.elevation_source2.max_open_cells: 1000
elevation_manager.elevation_source2.memory_map_cells: true
epsg_database_file1: $(OSSIM_DEV_HOME)/ossim/share/ossim/ossim_epsg_projections-v7_4.csv
epsg_database_file2: $(OSSIM_DEV_HOME)/ossim/share/ossim/ossim_harn_state_plane_epsg.csv
epsg_database_file3: $(OSSIM_DEV_HOME)/ossim/share/ossim/ossim_state_plane_spcs.csv
epsg_database_file4: $(OSSIM_DEV_HOME)/ossim/share/ossim/ossim_harn_state_plane_esri.csv
Scanning dependencies of target ossim_plugin
[ 82%] Building CXX object ossim_plugins/ossim/CMakeFiles/ossim_plugin.dir/ossimTerraSarTiffReader.cpp.o
In file included from /home/omar/projects/ossim_plugins/ossim/ossimTerraSarTiffReader.cpp:14:
/home/omar/projects/ossim_plugins/ossim/ossimTerraSarTiffReader.h:16:47: error: ossim/imaging/ossimTiffTileSource.h: No such file or directory
/home/omar/projects/ossim_plugins/ossim/ossimTerraSarTiffReader.h:17:38: error: ossim/base/ossimFilename.h: No such file or directory
In file included from /home/omar/projects/ossim_plugins/ossim/ossimTerraSarTiffReader.cpp:15:
/home/omar/projects/ossim_plugins/ossim/ossimTerraSarProductDoc.h:20:39: error: ossim/base/ossimConstants.h: No such file or directory
/home/omar/projects/ossim_plugins/ossim/ossimTerraSarProductDoc.h:21:36: error: ossim/base/ossimRefPtr.h: No such file or directory
In file included from /home/omar/projects/ossim_plugins/ossim/ossimTerraSarModel.h:16,
from /home/omar/projects/ossim_plugins