Install the server:
sudo apt-get install postgresql-9.1 postgresql-contrib-9.1 pgadmin3
Execute the psql command under user postgres
(sudo -u postgres)
and connect to database postgres
(psql postgres):
/** | |
Title: Google Apps Script for exporting CSV files from the Fulcrum Query API to a Drive folder | |
Notes: Be sure to manually run the exportData() function at least once to authorize the script. Set a timed trigger to automate exports. | |
Author: Bryan R. McBride | |
Contributor: Joe Larson, exportPhotos() | |
**/ | |
var fulcrumToken = "abcdefghijklmnopqrstuvwxyz"; | |
var fulcrumFormName = "My App"; | |
var filesFolder = "1ByvB7rSq_Pi2AE_JvqRFm6zUETbdJ8dG"; |
function b2a(a) { | |
var c, d, e, f, g, h, i, j, o, b = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", k = 0, l = 0, m = "", n = []; | |
if (!a) return a; | |
do c = a.charCodeAt(k++), d = a.charCodeAt(k++), e = a.charCodeAt(k++), j = c << 16 | d << 8 | e, | |
f = 63 & j >> 18, g = 63 & j >> 12, h = 63 & j >> 6, i = 63 & j, n[l++] = b.charAt(f) + b.charAt(g) + b.charAt(h) + b.charAt(i); while (k < a.length); | |
return m = n.join(""), o = a.length % 3, (o ? m.slice(0, o - 3) :m) + "===".slice(o || 3); | |
} | |
function a2b(a) { | |
var b, c, d, e = {}, f = 0, g = 0, h = "", i = String.fromCharCode, j = a.length; |
#!/bin/bash | |
INPUT=fire_hydrants.csv | |
OLDIFS=$IFS | |
IFS=, | |
[ ! -f $INPUT ] && { echo "$INPUT file not found"; exit 99; } | |
while read -a csv_line | |
do | |
mv ${csv_line[0]}.pdf ${csv_line[8]}-${csv_line[0]}.pdf | |
done < $INPUT |
import urllib2 | |
import datetime | |
def timeStamped(fname, fmt='%Y-%m-%d-%H-%M-%S_{fname}'): | |
return datetime.datetime.now().strftime(fmt).format(fname=fname) | |
url = 'https://web.fulcrumapp.com/shares/6e158acd08cacfad.csv' | |
u = urllib2.urlopen(url) | |
localFile = open('fulcrum_data.csv', 'w') | |
localFile.write(u.read()) | |
localFile.close() | |
with open(timeStamped('fulcrum_data.csv'),'w') as outf: |
sudo mkdir -p /Library/Frameworks/GDAL.framework/Versions/1.9/ | |
sudo ln -s /usr/local/lib/libgdal.dylib /Library/Frameworks/GDAL.framework/Versions/1.9/GDAL | |
sudo mkdir -p /Library/Frameworks/PROJ.framework/Versions/4/ | |
sudo ln -s /usr/local/Cellar/proj/4.8.0/lib/libproj.dylib /Library/Frameworks/PROJ.framework/Versions/4/PROJ | |
# did not work: sudo ln -s `pwd`/libgeos.dylib /Library/Frameworks/GEOS.framework/Versions/3/GEOS | |
# did work: | |
# $PWD is /usr/local/Cellar/geos/3.3.6/lib | |
sudo ln -s `pwd`/libgeos_c.1.dylib /Library/Frameworks/GEOS.framework/Versions/3/GEOS | |
sudo mkdir -p /Library/Frameworks/SQLite3.framework/Versions/3/ | |
sudo ln -s /usr/local/Cellar/sqlite/3.7.15/lib/libsqlite3.0.8.6.dylib /Library/Frameworks/SQLite3.framework/Versions/3/SQLite3 |