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 io | |
| def read_in_chunks_of_whole_lines(file, length=1024*1024): | |
| """Read a file in blocks of length bytes, up to the next newline.""" | |
| tail = "" | |
| with open(file, "r") as f: | |
| while True: | |
| chunk = tail + f.read(length) | |
| if not chunk: | |
| return |
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
| - name: ssl_expiry.rules | |
| rules: | |
| - alert: SSLCertExpiringSoon | |
| expr: probe_ssl_earliest_cert_expiry - time() < 86400 * 7 | |
| for: 10m | |
| annotations: | |
| summary: "SSL certificate for {{ $labels.instance }} is about to expire." | |
| labels: | |
| severity: "warning" |
We can't make this file beautiful and searchable because it's too large.
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
| T GULDEN BOEK ( DE CHRISTELIJKE BOEKENCENTRALE ) B.V.,HOUTEN,29.646 | |
| "!PET PROJECTINRICHTERS B.V.",HOOGEVEEN,31.956 | |
| """ SERVICE- EN VERSPREIDINGSBUREAU WILLEMS "" V.O.F.",DUIVEN,9.402 | |
| """AAN DE MAAS"" EXPLOITATIE B.V.",SCHIEDAM,28.848 | |
| """ACHT"" UITZENDBURO B.V.",ZOETERMEER,70.830 | |
| """ACHT"" UITZENDBURO B.V.",ZOETERMEER,25.086 | |
| """ACHT"" UITZENDBURO B.V.",ZOETERMEER,3.780 | |
| """ART OF PRIVATE SHAKING"" GLASS & BAR SUPPLY B.V.",AMSTERDAM,59.979 | |
| """B.V. BOUW- EN AANNEMINGSBEDRIJF G. DE HAAN EN ZN"".",GARYP,68.658 | |
| """BEMI"" AMUSEMENTSAUTOMATEN B.V.",ENSCHEDE,8.412 |
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
| // ... | |
| /** | |
| * Get an DocumentBuilder that is protected from entity injection. | |
| * @return new DocumenBuilder | |
| * @throws ParserConfigurationException when it feels like being peak java | |
| */ | |
| public DocumentBuilder newDocumentBuilder() throws ParserConfigurationException { | |
| final var df = DocumentBuilderFactory.newInstance(); | |
| df.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, ""); | |
| df.setAttribute(XMLConstants.ACCESS_EXTERNAL_SCHEMA, ""); |
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
| # Snippet from my 'dotfiles' (in Ansible) that configures the fonts | |
| - name: Install font packages | |
| become: true | |
| dnf: | |
| state: present | |
| name: | |
| - adobe-source-sans-pro-fonts | |
| - adobe-source-serif-pro-fonts | |
| - adobe-source-code-pro-fonts | |
| - mozilla-fira-mono-fonts |
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
| Host * | |
| ForwardX11 no | |
| ForwardX11Trusted no | |
| ForwardAgent no | |
| VisualHostKey yes | |
| ControlMaster auto | |
| ControlPersist 1 | |
| ServerAliveInterval 300 | |
| ServerAliveCountMax 2 | |
| ControlMaster auto |
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
| # Use like {{ proxy_pass('/admin', 'reljudge') }} | |
| {%- macro proxy_pass(location, backend_name, host='', backend_proto='http', root=None, extra_conf=None) -%} | |
| location {{ location }} { | |
| {% if root != None %} | |
| root {{ root }}; | |
| {% endif %} | |
| proxy_pass {{ backend_proto }}://{{ backend_name }}{{ location }}; | |
| {% if backend_proto == 'https' %} | |
| proxy_ssl_session_reuse on; | |
| {% endif %} |
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
| """ | |
| An old fiddle when we were investigating the size of the ranges owned by Ziggo… | |
| """ | |
| import aiohttp | |
| import asyncio | |
| import json | |
| import itertools | |
| import netaddr | |
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
| { | |
| "__inputs": [ | |
| { | |
| "name": "DS_PROMETHEUS", | |
| "label": "Prometheus", | |
| "description": "", | |
| "type": "datasource", | |
| "pluginId": "prometheus", | |
| "pluginName": "Prometheus" | |
| } |
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
| from passlib.context import CryptContext | |
| myctx = CryptContext(schemes=['argon2', 'bcrypt'], deprecated=['bcrypt']) | |
| # h ~= hash('password', 'bcrypt') | |
| h="$2b$12$/kdxAcUQ432BgwKzhTwGM.CKq7gDHAhgDIYE3zyTirDahma6EshhK" | |
| myctx.needs_update(h) | |
| # True | |
| (verifies, new_hash) = myctx.verify_and_update("password", h) |