This file contains hidden or 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
# Install Dependences | |
require 'rsolr' | |
# Connect to solr | |
solr = RSolr.connect :url => 'http://localhost:8983/solr/geoportal' | |
# Search request | |
response = solr.get 'select', :params => {:q => '*:*', :rows => '10000'} |
This file contains hidden or 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 code; code.interact(local=dict(globals(), **locals())) |
This file contains hidden or 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
# Download and Install the Latest Updates for the OS | |
apt-get update && apt-get upgrade -y | |
# Set the Server Timezone to CST | |
echo "America/Chicago" > /etc/timezone | |
dpkg-reconfigure -f noninteractive tzdata | |
# Enable Ubuntu Firewall and allow SSH & MySQL Ports | |
ufw enable | |
ufw allow 22 |
This file contains hidden or 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
var degrees2meters = function(lon,lat) { | |
var x = lon * 20037508.34 / 180; | |
var y = Math.log(Math.tan((90 + lat) * Math.PI / 360)) / (Math.PI / 180); | |
y = y * 20037508.34 / 180; | |
return [x, y] | |
} | |
//test | |
lon= -77.035974 | |
lat = 38.898717 |
This file contains hidden or 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
#! /bin/sh | |
usage_error () { | |
echo 'Usage: sh migrator.sh <path to sqlite_to_postgres.py> <path to sqlite db file> <an empty dir to output dump files>' | |
echo | |
echo 'Example:' | |
echo '>sh migrator.sh sqlite_to_postgres.py ~/reviewboard.db /tmp/dumps' | |
echo | |
echo 'Tested on:' | |
echo 'Python 2.7.3' |
This file contains hidden or 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
server { | |
listen 80; | |
server_name www.opendata-map.org; | |
root /var/www/opendata-map.org; | |
access_log /var/log/nginx/opendata-map.access.log; | |
error_log /var/log/nginx/opendata-map.error.log debug; | |
# GEOSERVER PROXY & CACHE | |
location /geoserver { | |
proxy_pass http://127.0.0.1:8080/geoserver; |
This file contains hidden or 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
Show hidden characters
[ | |
{ "keys": ["ctrl+shift+x"], "command": "tidy_xml" }, | |
{ "keys": ["ctrl+shift+j"], "command": "prettify_json" } | |
] |
This file contains hidden or 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 re | |
myfile = open('list', 'r') | |
callnos = myfile.readlines() | |
p = re.compile("""^(?P<aclass>[A-Z]{1,3}) | |
(?P<nclass>\\d{1,4})(\\ ?) | |
(\\.(?P<dclass>\\d{1,3}))? | |
(?P<date>\\ [A-Za-z0-9]{1,4}\\ )? |
This file contains hidden or 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
/* For Node.js - resolve a chain of HTTP redirects | |
Uses getResponse() from http://gist.github.com/399276 | |
Example: resolveHttpRedirects('http://ow.ly/1Kn4j', function(url) { sys.puts(url) }); | |
*/ | |
function resolveHttpRedirects(url, callback, maxnum) { | |
maxnum = maxnum || 3; | |
var count = 0; | |
function next(url) { | |
getResponse(url, function(response) { |