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 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
""" | |
This is an example on how to reload Flask app in runtime | |
It can be useful for the use case where you want to enable/disable blueprints/routes dynamically. | |
To run the app: | |
> pip install flask & python app.py | |
Then test it via curl |
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
#!/usr/bin/env bash -e | |
HOST=${1:-cloudflare.com} | |
FILENAME=${2:-${HOST%%.*}} | |
# For file naming, see https://support.ssl.com/Knowledgebase/Article/View/19/0/der-vs-crt-vs-cer-vs-pem-certificates-and-how-to-convert-them | |
# For HTTP Public Key Pinning (HPKP), see https://developer.mozilla.org/en-US/docs/Web/HTTP/Public_Key_Pinning | |
CERTIFICATE_PEM="${FILENAME}_certificate.ascii.crt" | |
CERTIFICATE_DER="${FILENAME}_certificate.crt" | |
PUBKEY_PEM="${FILENAME}_pubkey.ascii.key" |
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
{ | |
"version" : 1, | |
"initialAssetCount" : 4, | |
"assets" : [ | |
{ | |
"id" : "6154CA95-ED90-446A-9C29-F46EDA2B3741", | |
"url-1080-SDR" : "https://sylvan.apple.com/Aerials/2x/Videos/DB_D011_C009_2K_SDR_HEVC.mov", | |
"url-1080-HDR" : "https://sylvan.apple.com/Aerials/2x/Videos/DB_D011_C009_2K_HDR_HEVC.mov", | |
"url-4K-SDR" : "https://sylvan.apple.com/Aerials/2x/Videos/DB_D011_C009_4K_SDR_HEVC.mov", | |
"url-4K-HDR" : "https://sylvan.apple.com/Aerials/2x/Videos/DB_D011_C009_4K_HDR_HEVC.mov", |
Save these files as ~/.config/systemd/user/some-service-name.*
Run this now and after any modifications: systemctl --user daemon-reload
Try out the service (oneshot): systemctl --user start some-service-name
Check logs if something is wrong: journalctl -u --user-unit some-service-name
Start the timer after this user logs in: systemctl --user enable --now some-service-name.timer
ⓘ This list is not meant to be exhaustive and is not guaranteed to be maintained. See the comments for updates and alternative options.
(Items in bold indicate possible concerns)
Keycloak | WSO2 Identity Server | Gluu | CAS | OpenAM | Shibboleth IdP | |
---|---|---|---|---|---|---|
OpenID Connect/OAuth support | yes | yes | yes | yes | yes | yes |
Multi-factor authentication | yes | yes | yes | yes | yes | yes |
Admin UI | yes | yes | yes | yes | yes | no |
OpenJDK support | yes | yes | partial² | yes |
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
""" | |
This gist shows how to run asyncio loop in a separate thread. | |
It could be useful if you want to mix sync and async code together. | |
Python 3.7+ | |
""" | |
import asyncio | |
from datetime import datetime | |
from threading import Thread | |
from typing import Tuple, List, Iterable |
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
-- Refer to manual: https://knot-resolver.readthedocs.io/en/latest/daemon.html#configuration | |
-- Listen on all interfaces (localhost would not work in Docker) | |
net.listen('0.0.0.0') | |
net.listen('0.0.0.0', 853, {tls=true}) | |
-- Auto-maintain root TA | |
trust_anchors.file = '/data/root.keys' | |
-- Load Useful modules |
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
core.register_service("dump", "http", function(applet) | |
local response = core.concat() | |
response:add('---\n') | |
members = { 'sf', 'f', 'sc', 'c' } | |
for i,m in ipairs(members) do | |
response:add('applet.' .. m .. ':\n') | |
for k, v in pairs(getmetatable(applet[m])) do | |
if k == "__index" then | |
local funcs = {} |
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 os | |
import flask | |
import requests | |
BASE_URL = 'https://YOURGITLABURL/api/v4' | |
TOKEN = 'YOURADMINAPITOKEN' | |
app = flask.Flask(__name__) |