Skip to content

Instantly share code, notes, and snippets.

View vladimir-rybalko's full-sized avatar

Vladimir Rybalko vladimir-rybalko

View GitHub Profile
@vladimir-rybalko
vladimir-rybalko / convert-geojson-to-wkt.py
Created March 12, 2024 08:51 — forked from drmalex07/convert-geojson-to-wkt.py
Convert GeoJSON to/from WKT in Python. #python #geojson #geometry
import json
import geojson
from shapely.geometry import shape
o = {
"coordinates": [[[23.314208, 37.768469], [24.039306, 37.768469], [24.039306, 38.214372], [23.314208, 38.214372], [23.314208, 37.768469]]],
"type": "Polygon"
}
s = json.dumps(o)
@vladimir-rybalko
vladimir-rybalko / listen.py
Created March 7, 2023 04:59 — forked from kissgyorgy/listen.py
How to use PostgreSQL's LISTEN/NOTIFY as a simple message queue with psycopg2 and asyncio
import asyncio
import psycopg2
# dbname should be the same for the notifying process
conn = psycopg2.connect(host="localhost", dbname="example", user="example", password="example")
conn.set_isolation_level(psycopg2.extensions.ISOLATION_LEVEL_AUTOCOMMIT)
cursor = conn.cursor()
cursor.execute(f"LISTEN match_updates;")
@vladimir-rybalko
vladimir-rybalko / readme.md
Created February 21, 2023 18:53 — forked from kgjenkins/readme.md
Interpolate points along lines using QGIS virtual layers

Interpolate points along lines using QGIS virtual layers

Suppose we want to interpolate a number of points along each line in a layer:

image

We have a column called stations that specifies how many points to interpolate on each line:

image

@vladimir-rybalko
vladimir-rybalko / elevation_server.md
Created November 28, 2022 11:56 — forked from emxsys/elevation_server.md
How to setup a NASA WorldWind elevation server

How to setup a NASA WorldWind elevation server

Introduction

This guide shows how to create a WMS server on a local VM using Apache, MapServer and elevation data sets curated by NASA. This WMS server serves as a model for a production MapServer instance to be deployed on an a network.

The guide contains a brief overview of how the WorldWind clients make requests, followed by instructions for setting up the Apache web server, MapServer and the Apache caching.

@vladimir-rybalko
vladimir-rybalko / 3D Tiles Bounds.ipynb
Created May 22, 2022 09:57 — forked from banesullivan/3D Tiles Bounds.ipynb
Extract EPSG:4326 bounding boxes from 3D Tiles dataset and plot with ipyleaflet
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vladimir-rybalko
vladimir-rybalko / tiles.md
Created July 8, 2019 19:45 — forked from veltman/tiles.md
Making a big image zoomable

Making a big image zoomable

When you have a giant image and you want to make it easy to pan and zoom without downloading the whole 50MB image into someone's browser, a nice workaround is to cut that image into tiles at different zoom levels and view it as it were a map. An example where I've used this technique is The "Snowpiercer" Scenario.

One way to cut your big image into the requisite tiles is with gdal2tiles.py.

Alternatively, this Node script will do the cutting after you install node-canvas and mkdirp:

const fs = require("fs"),
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vladimir-rybalko
vladimir-rybalko / geoserver-install.sh
Created May 8, 2019 07:28 — forked from iacovlev-pavel/geoserver-install.sh
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
@vladimir-rybalko
vladimir-rybalko / PyTorStemPrivoxy.md
Created March 10, 2019 09:26 — forked from KhepryQuixote/PyTorStemPrivoxy.md
Python script to connect to Tor via Stem and Privoxy, requesting a new connection (hence a new IP as well) as desired.

Crawling Anonymously with Tor in Python

adapted from the article "Crawling anonymously with Tor in Python" by S. Acharya, Nov 2, 2013.

The most common use-case is to be able to hide one's identity using TOR or being able to change identities programmatically, for example when you are crawling a website like Google and you don’t want to be rate-limited or blocked via IP address.

Tor

Install Tor.

@vladimir-rybalko
vladimir-rybalko / GoogleFormLimit
Created November 17, 2018 04:13 — forked from creotiv/GoogleFormLimit
Setting limits for Google Form
/* Time zone used from your Google Callendar */
FORM_OPEN_DATE = "2014-12-20 08:00";
FORM_CLOSE_DATE = "2014-12-25 23:30";
RESPONSE_COUNT = "100";
/* Init the from and set triggers */
function Initialize() {
deleteTriggers_();