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 python3 | |
| # Copyright (c) 2026 John Vrbanac <john.vrbanac@linux.com> | |
| # Licensed under the MIT License. See LICENSE for details. | |
| """Check HSTS (HTTP Strict Transport Security) configuration for a website.""" | |
| import sys | |
| import urllib.request | |
| import urllib.error | |
| from dataclasses import dataclass, field | |
| from urllib.parse import urlparse |
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 | |
| # | |
| # Compliance Git Change List Generator | |
| # | |
| # Generates an auditable git change log over a specified date range, | |
| # with a timestamp fetched live from the US government time source (time.gov). | |
| # | |
| # Output file: {control_number}_{project_name}_YYYY-MM-DD-YYYY-MM-DD.txt | |
| # | |
| # Author : John Vrbanac <john.vrbanac@linux.com> |
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
| bind: 0.0.0.0:8000 | |
| workers: 1 | |
| worker_class: "example.worker:CustomWorker" | |
| timeout: 30 | |
| ca_certs: ca.crt | |
| certfile: server.crt | |
| keyfile: server.key | |
| cert_reqs: 2 | |
| do_handshake_on_connect: true |
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
| #!/bin/bash | |
| sudo apt-get install git python-pip make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev curl | |
| sudo pip install virtualenvwrapper | |
| git clone https://github.com/yyuu/pyenv.git ~/.pyenv | |
| git clone https://github.com/yyuu/pyenv-virtualenvwrapper.git ~/.pyenv/plugins/pyenv-virtualenvwrapper | |
| echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc | |
| echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc |
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 falcon | |
| import jinja2 | |
| def load_template(name): | |
| path = os.path.join('templates', name) | |
| with open(os.path.abspath(path), 'r') as fp: | |
| return jinja2.Template(fp.read()) |
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
| #!/bin/bash | |
| set +x | |
| # Setup all of the pyenvs | |
| export PATH="$HOME/.pyenv/bin:$PATH" | |
| export CONFIGURE_OPTS='--enable-shared' | |
| eval "$(pyenv init -)" | |
| pyenv shell 2.7.5 | |
| pyenv virtualenvwrapper | |
| pyenv rehash |
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
| def get_unused_port(): | |
| sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
| sock.bind(('localhost', 0)) | |
| _, port = sock.getsockname() | |
| sock.close() | |
| return port |
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 the baseline |
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 gunicorn.app.base import BaseApplication | |
| from gunicorn.workers.sync import SyncWorker | |
| from meinheld.gmeinheld import MeinheldWorker | |
| class CustomWorker(object): | |
| def handle_quit(self, sig, frame): | |
| self.app.application.stop(sig) | |
| super().handle_quit(sig, frame) |
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
| #!/bin/bash | |
| export MESSAGE=$(echo -e "\n\n$(git log `git describe --tags --abbrev=0`..HEAD --oneline)") | |
| bumpversion \ | |
| --message 'Bump version: {current_version} → {new_version}{$MESSAGE}' \ | |
| ${@:1} |
NewerOlder