Skip to content

Instantly share code, notes, and snippets.

View leighghunt's full-sized avatar

Leigh Hunt leighghunt

View GitHub Profile
@leighghunt
leighghunt / gist:44616e110bfcd19f60d4
Created July 3, 2014 22:43
Remote file copy cheatsheet
Tar and zip folder input into out.tar.gz file
ubuntu@remote-host$ tar cf out.tar.gz input/
Copy from host to local machine, logging in as user ubuntu
lhunt@local-host$ scp ubuntu@host:/home/ubuntu/out.tar.gz out.tar.gz
In ec2 firewall rules - enable 21, and 64000-64321
local_enable=YES
write_enable=YES
chroot_local_user=YES
pasv_enable=YES
port_enable=YES
pasv_min_port=64000
pasv_max_port=64321
pasv_address=54.79.75.128
@leighghunt
leighghunt / gist:87a8a76ae4f7c09fe883
Last active August 29, 2015 14:07
ogr2ogr Shapefile -> SQL Server
ogr2ogr -overwrite -f "MSSQLSpatial" "MSSQL:server=.;database=geo;tables=wellington_footprints2;trusted_connection=yes" "wellington-city-building-footprints.shp" -progress -lco GEOM_TYPE=GEOGRAPHY -gt 1000
ogr2ogr -overwrite -f "MSSQLSpatial" "MSSQL:server=.;database=geo;tables=wellington_footprints2;trusted_connection=yes" "wellington-city-building-footprints.shp" -progress -lco GEOM_TYPE=GEOGRAPHY -a_srs "EPSG:4326"
ogr2ogr -overwrite -f "MSSQLSpatial" "MSSQL:server=.;database=geo;trusted_connection=yes" "buildings-subset.shp" -progress -lco GEOM_TYPE=GEOGRAPHY -a_srs "EPSG:4326"
ogr2ogr -overwrite -f "MSSQLSpatial" "MSSQL:server=WIN-GN1RC53EIN1;database=geo;trusted_connection=yes" "buildings-subset.shp" -progress -lco GEOM_TYPE=GEOGRAPHY -a_srs "EPSG:4326"
@leighghunt
leighghunt / gist:daed4b8162b059b25881
Created October 15, 2014 03:36
GeoServer/SQLServer cheatsheet
-- Before call to ogr2ogr, drop table
DROP table wellington_buildings
DROP table wellington_buildings_geog
DROP TABLE buildings_subset_small
DROP TABLE buildings_subset_small_geog
-- Call ogr2ogr to import AS GEOMETRY
SELECT * FROM wellington_buildings
@leighghunt
leighghunt / gist:67ed099f4038f32f38de
Last active August 29, 2015 14:09
Ubuntu nodejs install script
- Getting IP address for VirtualBox:
````
VBoxManage list runningvms
"ubuntu nodejs installed" {e42c8b5a-3a0c-48fc-84cb-92f440df8d12}
````
````
VBoxManage showvminfo "<vm name>" | grep mac -i
NIC 1: MAC: 080027F7D29E, Attachment: Bridged Interface 'en0: Wi-Fi (AirPort)', Cable connected: on, Trace: off (file: none), Type: 82540EM, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: deny, Bandwidth group: none
````
@leighghunt
leighghunt / map.geojson
Created November 20, 2014 22:05
Two polygons to intersect
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@leighghunt
leighghunt / map.geojson
Created November 20, 2014 22:08
Resultant geometry
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@leighghunt
leighghunt / map.geojson
Last active August 29, 2015 14:10
Christmas lights
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# You MUST click on the HELP button to see a detailed description of this level!
# The raven will tell you what to use for your maze parameters!
SLIDE = 10
SWITCH = 7
SKIP = 11
# How many sideSteps north of the Red X you've taken.
sideSteps = 1
// The maze is 35 steps along the X axis.
//take the values here from the raven
var slide=9;
//had to use switchh as switch is a keyword
var switchh=5;
var skip=7;
//do we move up of down, start off going up
var ymove = 1;
while(steps <= 35) {