Skip to content

Instantly share code, notes, and snippets.

@etes
etes / boreholes.R
Last active October 2, 2015 16:18
plot borehole locations on Google Maps
library(rgdal)
library(RgoogleMaps)
boreholes<- read.csv("boreholes.csv", sep=",", header=TRUE)
bh_grd <- SpatialPoints(boreholes[,c("East","North")],
proj4string=CRS("+proj=utm +zone=32 +datum=WGS84"))
bholes<- SpatialPointsDataFrame(bh_grd,boreholes[,-c(2,3)])
bholes<-bholes[,-c(2,3)]
bh_geo<- spTransform(bholes, CRS("+proj=longlat +datum=WGS84"))
North<-coordinates(bh_geo)[,2]
@etes
etes / Install_Postgis_Ubuntu_11.10.sh
Created May 25, 2012 21:36 — forked from ikennaokpala/Install_Postgis_Ubuntu_11.10.sh
Install Postgres 9.1, PostGIS and create PostGIS template on Ubuntu 11.10 Oneiric Ocelot
#!/bin/bash
#
# Install Postgres 9.1, PostGIS and create PostGIS template on a clean Ubuntu 11.10 Oneiric Ocelot box
# http://wildfish.com
# add the ubuntu gis ppa
sudo apt-get -y install python-software-properties
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
@etes
etes / gist:6257400
Created August 17, 2013 15:21
requirement for deploying a web app.
maps.google.com
### get the google maps api key
### install django on ubuntu test server and centOS
### install PostGres and PostGIS 2.0
### install gdal on python 2.7
### get apache or ngnix server
### get openlayers and GeoDjango
rows, cols = 10, 10
iceraster = (10*numpy.random.random((rows, cols))).astype(int)*5
iceraster = numpy.where( (iceraster >= 20), 20, iceraster)
outarray = numpy.zeros((rows, cols), numpy.float)
NumberOfDays = 3
#Obsolete pixel-by-pixel version, takes very long
for (i,j), value in numpy.ndenumerate(outarray):
if iceraster[i,j] == 0:
outarray[i,j] = outarray[i,j] + ( 0.0 / NumberOfDays)
elif iceraster[i,j] == 5:
@etes
etes / directorySize.ps1
Last active January 3, 2016 05:49
miscellaneous scripts
$startfolder = "c:\data\*"
$folders = get-childitem $startfolder | where{$_.PSiscontainer -eq "True"}
"Directory Name`tDirectory Size (MB)"
foreach ($fol in $Folders){
$colItems = (Get-ChildItem $fol.fullname -recurse | Measure-Object -property length -sum)
$size = "{0:N2}" -f ($colItems.sum / 1MB)
"$($fol.name)`t$size"
}
# Some good references are:
# http://russbrooks.com/2010/11/25/install-postgresql-9-on-os-x
# http://www.paolocorti.net/2008/01/30/installing-postgis-on-ubuntu/
# http://postgis.refractions.net/documentation/manual-1.5/ch02.html#id2630392
#1. Install PostgreSQL postgis and postgres
brew install postgis
initdb /usr/local/var/postgres
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
@etes
etes / smtpcheck.py
Last active March 18, 2020 12:44 — forked from blinks/smtpcheck.py
#!/usr/bin/env python
"""
Check that a particular email address exists.
Adam Blinkinsop <blinks@acm.org>
WARNING:
Checking email addresses in this way is not recommended, and will lead to
your site being listed in RBLs as a source of abusive traffic. Mail server
admins do like it when they get connections that don't result in email being
sent, because spammers often use this technique to verify email addresses.
@etes
etes / pi_mount_usb.md
Last active March 14, 2024 17:31
How to setup mount / auto-mount USB Hard Drive on Raspberry Pi

How to setup mount / auto-mount USB Hard Drive on Raspberry Pi

Follow the simple steps in the order mentioned below to have your USB drive mounted on your Raspberry Pi every time you boot it.

These steps are required especially if your are setting up a Samba share, or a 24x7 torrent downloader, or alike where your Raspberry Pi must have your external storage already mounted and ready for access by the services / daemons.

Step 0. Plug in your USB HDD / Drive to Raspberry Pi If you are using a NTFS formatted drive, install the following

@etes
etes / install_go.sh
Last active October 11, 2016 11:05
Install golang on ArmV6
wget https://storage.googleapis.com/golang/go1.7.1.linux-armv6l.tar.gz
tar -C /usr/local -xzf go1.7.1.linux-armv6l.tar.gz
export PATH=$PATH:/usr/local/go/bin
export GOPATH=$HOME/go
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
@etes
etes / supervisord-example.conf
Created March 7, 2017 12:51 — forked from didip/supervisord-example.conf
Example configuration file for supervisord.conf
[unix_http_server]
file=/tmp/supervisor.sock ; path to your socket file
[supervisord]
logfile=/var/log/supervisord/supervisord.log ; supervisord log file
logfile_maxbytes=50MB ; maximum size of logfile before rotation
logfile_backups=10 ; number of backed up logfiles
loglevel=error ; info, debug, warn, trace
pidfile=/var/run/supervisord.pid ; pidfile location
nodaemon=false ; run supervisord as a daemon