Skip to content

Instantly share code, notes, and snippets.

Error: SiteDomain parameter not defined in your config/domain file. You
must edit it for using this version of AWStats.
Setup ('/etc/awstats/awstats.conf' file, web server or permissions) may
be wrong.
Check config file, permissions and AWStats documentation (in 'docs'
directory).
@wildintellect
wildintellect / 5rc5to5rc6.sh
Created August 28, 2011 03:26
osgeolive5rc5fix
#!/bin/sh
#
# Corrections file for 5.0rc5
# Must be run as sudo
#
# Theoretically these should be solved in upstream tickets if building from scratch.
# cd ~/gisvm/
# svn up
# cd bin
# wget https://gist.github.com/gists/1176202/download -O gist.tar.gz
@wildintellect
wildintellect / latexlistings.tex
Created October 18, 2011 07:18
Example latex use of listings package with custom keywords added to a langauge definition.
\lstset{language=SQL,
numbers=left,
frame=single,
backgroundcolor=\color[RGB]{234,237,230},
numberstyle=\tiny,
basicstyle={\footnotesize\ttfamily\bfseries},
frameround=tttt,
breaklines=true,
keywordstyle=\color[RGB]{32,74,135},
commentstyle=\color[RGB]{143,89,2},
@wildintellect
wildintellect / buildliveinchroot.sh
Created May 1, 2012 23:31
OSGeo Live chroot build
#LiveCD on the commandline
#https://help.ubuntu.com/community/LiveCDCustomization
DIR=`dirname ${0}`
VERSION=`cat "$DIR"/../VERSION.txt`
PACKAGE_NAME="osgeo-live"
ISO_NAME="${PACKAGE_NAME}-${VERSION}"
sudo apt-get install squashfs-tools genisoimage
#TODO add wget to grab a fresh image, optional
@wildintellect
wildintellect / awstats-historical.sh
Created August 23, 2012 20:23
Bash process old apache logs with awstats
#!/bin/bash
# Alex Mandel 2011
# Apache 2.0 License
#Script outline for updating awstats from historical logs
#Take start number of oldest log via arguments
# grass.osgeo.org
configfile=$1
# grass-access.log
apachelogbase=$2
@wildintellect
wildintellect / GISTIndexCheck
Created May 19, 2014 18:23
Listing all GIST indexes in a Postgis database.
SELECT i.relname as indexname,
idx.indrelid::regclass as tablename,
am.amname as typename,
ARRAY(
SELECT pg_get_indexdef(idx.indexrelid, k + 1, true)
FROM generate_subscripts(idx.indkey, 1) as k
ORDER BY k
) as indkey_names
FROM pg_index as idx
JOIN pg_class as i
@wildintellect
wildintellect / worldfile
Last active August 29, 2015 14:01
Convert BBOX+Image to World File
#how to make world file from a bounding box and an image file - aka kml/kmz
#Generic Formula
(W-E)/(width pixels)
0
0
(N-S)/(width pixels)
West+.5*abs((W-E)/(width pixels))
North-.5*abs((N-S)/(height pixels))
#Example
<GDAL_WMS>
<Service name="TMS">
<ServerUrl>http://c.tile.thunderforest.com/cycle/${z}/${x}/${y}.png</ServerUrl>
</Service>
<DataWindow>
<UpperLeftX>-20037508.34</UpperLeftX>
<UpperLeftY>20037508.34</UpperLeftY>
<LowerRightX>20037508.34</LowerRightX>
<LowerRightY>-20037508.34</LowerRightY>
<TileLevel>18</TileLevel>
@wildintellect
wildintellect / osm_scales.xml
Created September 22, 2014 21:10
Spherical Mercator tile levels approximate scales for use in QGIS with GDAL TMS layers.
<qgsScales version="1.0">
<!--Approximate Tile Scales for OSM and other Spherical Mercator Projections.
Source:http://www.3liz.com/blog/rldhont/index.php?post/2012/07/17/OpenStreetMap-Tiles-in-QGIS
-->
<scale value="1:591659030"/>
<scale value="1:295829515"/>
<scale value="1:147914757"/>
<scale value="1:73957378"/>
<scale value="1:36978689"/>
@wildintellect
wildintellect / sort.py
Last active August 29, 2015 14:06
Sorts bracketed photos into 3 subfolders
#!/usr/bin/env python
# -*- coding: utf_8 -*
#
# Script to sort bracketed photos by exposure into bins.
# Default assumes 3 photos per bracket set, into 3 folders
#
# Alex Mandel 2014
# tech@wildintellect.com
# requires python