borrowed from : https://gist.github.com/springmeyer/3427021
prior to running thr script you will need to allow epl6 repos with:
# enable EPEL6 by changing enabled=0 -> enabled=1
sudo vim /etc/yum.repos.d/epel.repo
| { | |
| "regions": { | |
| "Banff Yoho Kootenay": { | |
| "display": "Banff, Yoho and Kootenay National Parks", | |
| "url": "http://avalanche.pc.gc.ca/CAAML-eng.aspx?d=TODAY&r=1", | |
| "type": "parks" | |
| }, | |
| "Glacier": { | |
| "display": "Glacier National Park", | |
| "url": "http://avalanche.pc.gc.ca/CAAML-eng.aspx?d=TODAY&r=3", |
| [ | |
| { | |
| "region": "north-columbia", | |
| "dateIssued": "2013-03-02", | |
| "validUntil": "2013-03-03", | |
| "preparedBy": "jlammers", | |
| "dangerRatings": [ | |
| { | |
| "date": "2013-03-02", | |
| "dangerRating": { |
| CREATE OR REPLACE FUNCTION normalize() RETURNS boolean AS $$ | |
| DECLARE | |
| a_record_exists boolean; | |
| BEGIN | |
| PERFORM fix_staging_dates(); | |
| SELECT 1 INTO a_record_exists | |
| FROM vw_bio_val_normalized | |
| WHERE (OrganizationName || CompanyPlotNumber || TreeNumber || MeasurementNumber || MeasurementYear) IN | |
| ( |
| violations = { | |
| 'VARIABLES': { | |
| 'CompanyPlotNumber': [0], | |
| 'DisturbanceYear': [3], | |
| 'DisturbanceDay': [5], | |
| 'DisturbanceNumber': [1], | |
| 'DisturbanceComment': [6], | |
| 'DisturbanceCode': [2], | |
| 'DisturbanceMonth': [4], | |
| 'CompoundFKey': [7], |
| sudo yum install gcc python27 python27-devel postgresql-devel | |
| sudo curl https://bootstrap.pypa.io/ez_setup.py -o - | sudo python27 | |
| sudo /usr/bin/easy_install-2.7 pip | |
| sudo pip2.7 install psycopg2 |
| #credits to: http://www.lecloud.net/post/61401763496/install-update-to-python-2-7-and-latest-pip-on-ec2 | |
| # install build tools | |
| sudo yum install make automake gcc gcc-c++ kernel-devel git-core -y | |
| # install python 2.7 and change default python symlink | |
| sudo yum install python27-devel -y | |
| sudo rm /usr/bin/python | |
| sudo ln -s /usr/bin/python2.7 /usr/bin/python |
| CREATE FUNCTION stage_files(text) RETURNS text AS $$ | |
| DECLARE | |
| path ALIAS FOR $1; | |
| BEGIN | |
| RETURN path; | |
| END; | |
| $$ LANGUAGE plpgsql; |
| #!/usr/local/bin/python | |
| import sys | |
| import sqlparse | |
| # usage cat test.sql | ./format_sql.py > test2.sql | |
| def main(argv): | |
| sql = sys.stdin.read().replace('\n', '') | |
| print sqlparse.format(sql, reindent=True, keyword_case='upper') |
| # usage: curl https://[gist-raw-url] | bash | |
| sudo yum -y update; | |
| sudo yum -y upgrade; | |
| sudo yum -y install git nodejs npm postgresql-devel --enablerepo=epel | |
| git clone https://github.com/mapnik/node-mapnik.git | |
| cd node-mapnik | |
| git checkout 1.4.1 |
borrowed from : https://gist.github.com/springmeyer/3427021
prior to running thr script you will need to allow epl6 repos with:
# enable EPEL6 by changing enabled=0 -> enabled=1
sudo vim /etc/yum.repos.d/epel.repo