Skip to content

Instantly share code, notes, and snippets.

View iacovlev-pavel's full-sized avatar

Pavel Iacovlev iacovlev-pavel

View GitHub Profile
@iacovlev-pavel
iacovlev-pavel / tst_postrau_change.sql
Last active March 30, 2021 17:39
tst_postrau_change.sql
CREATE OR REPLACE FUNCTION giscuit_layers.tst_postrau_change() RETURNS TRIGGER AS $$
BEGIN
NEW.the_geom := (SELECT the_geom FROM giscuit_layers.tst_postrau WHERE tst_postrau.gid = NEW.postraugid);
RETURN NEW;
END;
$$ LANGUAGE plpgsql;
DROP TRIGGER IF EXISTS tst_postrau_change ON giscuit_layers.tst_dtpstrau_map;
CREATE TRIGGER tst_postrau_change BEFORE UPDATE ON giscuit_layers.tst_dtpstrau_map FOR EACH ROW EXECUTE PROCEDURE giscuit_layers.tst_postrau_change();
@iacovlev-pavel
iacovlev-pavel / geoserver-startup.sh
Created January 15, 2019 21:13
Geoserver init script
#! /bin/sh
### BEGIN INIT INFO
# Provides: geoserver
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: S 0 1 6
# Short-Description: GeoServer OGC server
### END INIT INFO
@iacovlev-pavel
iacovlev-pavel / geoserver-install.sh
Last active May 8, 2022 06:55
Install GeoServer on Ubuntu 18.04
#
apt-get install openjdk-8-jre
# PostgreSQL and PostGIS
apt-get install postgresql postgresql-contrib postgis postgresql-10-postgis-2.4
# Create "geoserver" database
sudo -u postgres createuser -P geoserver
sudo -u postgres createdb -O geoserver geoserver
sudo -u postgres psql -c "CREATE EXTENSION postgis; CREATE EXTENSION postgis_topology;" geoserver