Skip to content

Instantly share code, notes, and snippets.

Alexander Salveson Nossum alexanno

Block or report user

Report or block alexanno

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View scraping.js
s = document.createElement("script");
s.src = "https://code.jquery.com/jquery-2.1.4.min.js";
s.type = "application/javascript";
document.head.appendChild(s);
$("tr a").each(function(key,elem){
elem.target="_blank";
elem.click();
})
View wget-kartverket.sh
wget --keep-session-cookies --save-cookies cookies.txt --post-data 'name={USERNAME}&pass={PASSWORD}&form_build_id=form-NaPSEn1C_qDxG4CVz3n0wf5wis4cZuSin2WrZJr68xY&form_id=user_login_block&op=Logg%20inn' http://data.kartverket.no/download/content/velkommen?destination=node/134
wget --load-cookies cookies.txt http://data.kartverket.no/download/mine/downloads
grep -o "http://data.kartverket.no/download/system/files/terrengdata/10m/utm33/Terrengdata.*zip" downloads > dllist
wget --load-cookies cookies.txt -i dllist
@alexanno
alexanno / FOSS4G-PDX-Notater.md
Last active Aug 29, 2015
FOSS4G-PDX-Notater
View FOSS4G-PDX-Notater.md
  • Portland:
    • Bryggerier og tap rooms overalt
    • Universitetsby
    • Kulturell/kunstnerisk
  • Animasjon
    • OL3, Mapbox GL, Leaflet continuous zoom, Torque.js/CartoDB
    • Klient-rendring
    • 3D
    • Cesium: kraftig og modent
    • OL3: 1.0
View trafikkdata-utsnitt-test.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View tmp.json
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View loading into postgis.sh
find ./ -name \*Elveg.SOS -execdir echo "ogr2ogr -update -append -f PostgreSQL PG:'host=localhost port=54321 dbname=sandbox user=postgres active_schema=sandbox' -progress -nln elveg {}" \;
find ./ -name \*Adresser.SOS -execdir ogr2ogr -update -append -f PostgreSQL PG:'host=localhost port=54321 dbname=sandbox user=postgres active_schema=sandbox' -progress -nln adresser {} \;
####################################################
#using shp2pgsql
#!/bin/bash
for f in *.shp
do
View aggregate hex_grid.sql
set search_path to "sandbox","public";
DROP VIEW IF EXISTS grid_test_001;
CREATE VIEW grid_test_001 as (
SELECT g.gid, g.the_geom, count(*) FROM hex_grid_001 g
JOIN n1000_turisthytte p
ON g.the_geom && st_transform(p.wkb_geometry,4326)
GROUP BY g.gid, g.the_geom
);
CREATE TABLE sandbox.t_grid_n1000_byggpkt_0125 AS
View postgis-lamp-provision.sh
#!/usr/bin/env bash
COLOR="\033[;35m"
COLOR_RST="\033[0m"
sudo apt-get update
sudo apt-get -y install python-software-properties build-essential curl
echo -e "${COLOR}--- Installing PHP5 ---${COLOR_RST}"
sudo apt-get install -y php5 php5-curl php5-pgsql
View dump_postgis_ogr2ogr.sh
READHOST=***
READUSER=***
READPASSWORD=***
WRITEHOST=***
WRITEPASSWORD=***
WRITEUSER=***
## vars need integration in commands with ex: host=$READHOST
ogr2ogr --config PG_USE_COPY YES -f GeoJSON testsql.geojson PG:'host=localhost dbname=alexanno user=alexanno' -progress -sql "SELECT * FROM sandbox.kommuner" -lco COORDINATE_PRECISION=5
You can’t perform that action at this time.