So HAProxy is primalery a load balancer an proxy for TCP and HTTP. But it may act as a traffic regulator. It may also be used as a protection against DDoS and service abuse, by maintening a wide variety of statistics (IP, URL, cookie) and when abuse is happening, action as denying, redirecting to other backend may undertaken ([haproxy ddos config], [haproxy ddos])
This file contains 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
#!/usr/bin/env python3 | |
import os | |
import shutil | |
from pathlib import Path | |
import argparse | |
def parse_arguments(): | |
"""Parse command-line arguments.""" |
This file contains 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/bash | |
# Install script for mapfish-print v3 on Ubunut 20.04 (focal) | |
sudo apt-get update && sudo apt-get install -y docker git make build-essential | |
sudo apt-get install -y openjdk-13-jdk && export JAVA_HOME=/usr/lib/jvm/java-13-openjdk-arm64 | |
git clone https://github.com/mapfish/mapfish-print.git && cd mapfish-print/ | |
sudo apt install -y docker-compose docker | |
sudo usermod -aG docker $USER |
This file contains 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
#!/usr/bin/python3 | |
import sys | |
import csv | |
import random | |
import string | |
from datetime import datetime | |
This file contains 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
#!/usr/bin/env python | |
# Get all GWR (ch.bfs.gebaeude_wohnungs_register) on a given parcel (ch.kantone.cadastralwebmap-farbe) | |
import sys | |
import re | |
import requests | |
import json | |
import logging |
This file contains 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/bash | |
##### ch.swisstopo.pixelkarte-farbe-pk25.noscale - pk25_krel_20171012.geojson - 1000 0.1 ####### | |
.venv/bin/python scripts/invalidate.py --profile ltmom_aws_admin --force --bucket bgdi-tod-cache-prod --layer ch.swisstopo.pixelkarte-farbe-pk25.noscale --timestamp current --extent 2812500.00074 1170000.00106 2830000.00075 1182000.00107 --resolutions 1000 0.1 --epsgs 21781 4326 2056 3857 | |
.venv/bin/python scripts/invalidate.py --profile ltmom_aws_admin --force --bucket bgdi-tod-cache-prod --layer ch.swisstopo.pixelkarte-farbe-pk25.noscale --timestamp current --extent 2812500.00074 1158000.00106 2830000.00076 1170000.00107 --resolutions 1000 0.1 --epsgs 21781 4326 2056 3857 | |
.venv/bin/python scripts/invalidate.py --profile ltmom_aws_admin --force --bucket bgdi-tod-cache-prod --layer ch.swisstopo.pixelkarte-farbe-pk25.noscale --timestamp current --extent 2777500.00072 1134000.00106 2795000.00074 1146000.00107 --resolutions 1000 0.1 --epsgs 21781 4326 2056 3857 | |
.venv/bin/python scripts/inval |
This file contains 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
#!/usr/bin/env python | |
import owslib | |
from owslib.wms import WebMapService | |
import requests | |
import lxml | |
urls= ['https://ge.ch/sitgags1/services/VECTOR/SITG_OPENDATA_01/MapServer/WMSServer', | |
'https://ge.ch/sitgags1/services/VECTOR/SITG_OPENDATA_02/MapServer/WMSServer', | |
'https://ge.ch/sitgags1/services/VECTOR/SITG_OPENDATA_03/MapServer/WMSServer', |
This file contains 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
>>> from mapproxy.srs import SRS | |
>>> from mapproxy.grid import TileGrid, tile_grid | |
# Grid creation | |
>>> grid = TileGrid(SRS(21781), | |
... bbox=(20000,30000,900000,350000), origin='ul', | |
... res=[4000,3750,3500,3250,3000,2750,2500,2250,2000,1750,1500,1250,1000,750,650,500,250,100,50,20,10,5,2.5,2,1.5,1,0.5,0.25,0.1]) | |
# Grid origin | |
>>> grid.origin |
This file contains 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
#!/usr/bin/env python | |
#-*- coding: utf-8 -*- | |
import os | |
import pyproj | |
DEBUG= False |
Displaying swisstopo Pixelkarte in Google Map using the new reprojected WMTS tiles.
See http://api3.geo.admin.ch/services/sdiservices.html#other-projections
A Pen by procrastinatio on CodePen.
NewerOlder