This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# recusively copy files from sub-directories into the parent | |
$ find ./recursive_search/ -name '*.txt' -exec cp --backup=numbered -t ./ {} + | |
========================================================================================================== | |
#how to create a install script http://askubuntu.com/questions/47404/how-do-i-make-post-install-scripts | |
=========================================================================================================== | |
#how to find install name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#upload python script here https://github.com/glw/chicagodivvybikes.git to download divvy bike station data. output it geojson file. I choose geojson so that I could re-use this script for other projects that will require geojson. | |
#geojson to shpfile | |
ogr2ogr -f "ESRI Shapefile" divvy_stations.shp divvybikestations.geojson | |
#shpfile to sql | |
shp2pgsql -s 4326 -I divvy_stations.shp divvy_stations > divvy_stations.sql | |
#Download Chicago OSM streets: XML format | |
wget http://osm-extracted-metros.s3.amazonaws.com/chicago.osm.bz2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#from ubuntu installation | |
sudo apt-get install dkms build-essential linux-headers-generic gcc make | |
#for ubuntu 14.04 it may be necessary to install the following...when prompted choose yes for new install. | |
sudo apt-get install virtualbox-guest-dkms virtualbox-guest-utils virtualbox-guest-x11 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shp2pgsql -s 4326 -d -g the_geom shapefilename.shp shapefilename |psql -U username --password -p 5432 -h reallylonghostnametoamazonaws.com dbname |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Ubuntu 12.04 | |
#R 3.1.0 | |
terminal: | |
sudo apt-get install libdbd-mysql libmysqlclient-dev | |
wget http://cran.r-project.org/src/contrib/RMySQL_0.9-3.tar.gz | |
sudo R CMD INSTALL --configure-args='--with-mysql-inc=/usr/include/mysql' --configure-args='--with-mysql-lib=/usr/lib64/mysql' /home/user/Downloads/RMySQL_0.9-3.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Compress tif with gdal | |
gdal_translate -of GTiff -co COMPRESS=DEFLATE -co TILED=NO image1.tif image1_compressed.tif | |
#copy all tifs to new location | |
for %I in (image1.tif image2.tif image3.tif image4.tif) do copy %I test\folder\ | |
#mosaic with gdal | |
gdalwarp --config GDAL_CACHEMAX 3000 -wm 3000 *.tif final_mosaic.tif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import arcpy | |
mxd = arcpy.mapping.MapDocument("Current") # finds metadata on your current MXD | |
layerlist = arcpy.mapping.ListLayers(mxd) # grabs a list of layers with in your MXD | |
del layerlist[3] #If you need to delete an item in the layerlist list | |
expr = "'Northwest'" # Variables to run the calculatefield function. **notice the extra '' within ""... | |
field = "Zone" # | |
# Goes through list and assigns expr to the field you specified |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install libxml2-dev libxslt1-dev python-dev | |
sudo pip install lxml | |
sudo pip install pykml | |
sudo apt-get update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#The following will install Postgres, pgAdmin3, PostGIS, PGRouting, QGIS, and numix (for cooler icons) | |
#The ubuntugis launchpad repo provides all but pgrouting, pgAdmin and of course the numix icons, it provides similar versions of software - https://launchpad.net/~ubuntugis/+archive/ubuntu/ubuntugis-unstable | |
#Currently on Ubuntu 14.x the universal package sources offer Posgresql 9.3, and Postgis 2.1.2 so there is no need to add repositories for these alone, unless looking for the most up-to-date version. In which case going straight to the source will be your best bet. | |
#! /bin/bash (include if you want to turn this into a script) | |
#install postgis postgresql pgadmin3 from PGDG Repo **See alternative installation below if interested in a more up-to-date QGIS. | |
#source: http://trac.osgeo.org/postgis/wiki/UsersWikiPostGIS21UbuntuPGSQL93Apt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Name: arcsde-to-shp.py | |
# Description: Copies data from ArcSDE, converts it to shp file format and puts into destination folder | |
# Author: Garret Wais | |
import arcpy, os | |
from arcpy import env | |
arcpy.env.overwriteOutput=True | |
#set OS working directory | |
os.chdir("T:\\") |
OlderNewer