Skip to content

Instantly share code, notes, and snippets.

View ldlsegovia's full-sized avatar

Leandro Segovia ldlsegovia

View GitHub Profile
Install postgress
1 - sudo apt-add-repository ppa:sharpie/for-science # To get GEOS
2 - sudo apt-get -y --force-yes install postgresql-9.1 postgresql-server-dev-9.1 postgresql-contrib-9.1 gdal-bin binutils libgeos-c1 libgeos-dev libspatialite libspatialite-dev libgdal1-dev libxml2 libxml2-dev libxml2-dev checkinstall libproj0 libproj-dev libpq-dev build-essential
3 - sudo mkdir -p '/usr/share/postgresql/9.1/contrib/'
4 - cd usr/share/postgresql/9.1/contrib/
5 - wget http://postgis.refractions.net/download/postgis-2.0.2.tar.gz
6 - tar zxvf postgis-2.0.2.tar.gz && cd postgis-2.0.2
7 - ./configure --with-raster --with-topology
8 - make
1 - sudo aptitude install tomcat6
2 - Download Web Archive from http://geoserver.org/display/GEOS/GeoServer+2.1.0
3 - Copy geoserver.war into /var/lib/tomcat6/webapps
4 - sudo /etc/init.d/tomcat6 restart
5 - Open browser at http://localhost:8080/geoserver/web/
6 - Default login and pass: admin - geoserver
Basic configuration...
1 - Go to: http://localhost:8080/geoserver/web/ o wherever you geoserver is running.
@ldlsegovia
ldlsegovia / osx-postgres-postgis.sh
Last active December 6, 2022 09:54
Installing postgis 2.1.4 with previously installed postgres 9.3.2 on OS X 10.9
$ brew install geos proj gdal libxml2 json-c
$ wget http://download.osgeo.org/postgis/source/postgis-2.1.4.tar.gz
$ tar xvfz postgis-2.1.4.tar.gz
$ cd postgis-2.1.4
$ ./configure --with-projdir=path-to-proj --with-jsondir=path-to-json-c (example: ./configure --with-projdir=/opt/boxen/homebrew/Cellar/proj/4.8.0 --with-jsondir=/opt/boxen/homebrew/Cellar/json-c/0.11)
$ make
$ sudo make install
$ cd path-to-your-postgres-previously-installed/contrib/postgis-2-1 (example: cd /opt/boxen/homebrew/Cellar/postgresql/9.3.2-boxen/share/postgresql/contrib/postgis-2.1)
$ createdb template_postgis
$ createlang plpgsql template_postgis
@ldlsegovia
ldlsegovia / ..ionic-gulp-pow.md
Last active March 12, 2016 23:28
Lineamientos generales para instalar el entorno de una app cliente usando ionic(cordova), gulp y pow

Herramientas necesarias y configuración general

  1. Instalar el sdk de android
  2. Agregar al path platform-tools y tools del sdk: $ export PATH=${PATH}:/Applications/adt/sdk/platform-tools:/Applications/adt/sdk/tools
  3. Agregar la variable de entrono $ export ANDROID_HOME=Applications/adt/sdk/tools
  4. Agregar los pasos 2 y 3 al archivo .zshenv que está en mi home. Esto para cargar las variables de entorno al inicio.

TODO: configurar pow para trabajar con la api

YARD CHEATSHEET http://yardoc.org

cribbed from http://pastebin.com/xgzeAmBn

Templates to remind you of the options and formatting for the different types of objects you might want to document using YARD.

Modules

Namespace for classes and modules that handle serving documentation over HTTP

/^((\+?56\s)?(0?2|0?3[2-5]|0?4[1-5]|0?5[123578]|0?6[13457]|0?7[1235])?(\s2\d{6}|\s\d{6}))$/
'+56 2 2xxxxxx',
'+56 51 2xxxxxx',
'+56 51 xxxxxx',
'56 75 xxxxxx',
'56 051 xxxxxx',
'56 051 2xxxxxx',
'+56 051 2xxxxxx'
@ldlsegovia
ldlsegovia / local_resource.rb
Created June 25, 2016 16:13
Simple class to create a tmp local file from a url
require 'open-uri'
class LocalResource
def initialize(_url, _tmp_filename)
@uri = URI.parse(_url)
@tmp_file_name = File.basename(_tmp_filename, ".*")
@tmp_file_ext = File.extname(_tmp_filename)
end
def file
ENV['RAILS_ENV'] = ARGV[0] || 'production'
DIR = File.dirname(__FILE__)
require DIR + '/config/environment'
class DupPriceChanges
include PricingLogger
def initialize(realm)
raise 'invalid realm' unless ["gasco", "enex"].include?(realm)
@realm = realm
ENV['RAILS_ENV'] = ARGV[0] || 'production'
DIR = File.dirname(__FILE__)
require DIR + '/config/environment'
class LoadOldValues
include PricingLogger
def initialize(realm)
raise 'invalid realm' unless ["gasco", "enex"].include?(realm)
@realm = realm