Note: All examples use Ubuntu 19.10
If used as a second auth factor, this would secure the laptop a bit more. This might also make the laptop unusable if the key is lost.
| #!/bin/bash -eu | |
| # Need jq (should be quite rewritable without jq) | |
| # Place it as something named `pro` in your path before `/usr/bin` | |
| # e.g.`/usr/local/sbin/pro` or `~/.local/bin/pro` if that's in your path | |
| if [ "${1:-} ${2:-}" = 'security-status --format=json' ]; then | |
| /usr/bin/pro security-status --format=json | jq -cM '.packages = []' | |
| exit 0 | |
| fi | |
| exec /usr/bin/pro "$@" |
| #!/usr/bin/env python3 | |
| import pathlib | |
| import re | |
| import subprocess | |
| import sys | |
| import threading | |
| import traceback | |
| {"schemaVersion":1, "label":"ARM wheel", "message":"1.2.3", "color":"green"} |
| import contextlib | |
| import functools | |
| from typing import Awaitable, Callable, Coroutine, Dict, Type | |
| ExceptionMapping = Dict[Type[Exception], Type[Exception]] | |
| CoroutineFunction = Callable[..., Awaitable] | |
| @contextlib.contextmanager |
| [ | |
| { | |
| "os": "linux", | |
| "language": "python", | |
| "dist": "xenial", | |
| "cache": { | |
| "pip": true | |
| }, | |
| "script": [ | |
| "tox -e $TOX_ENV" |
| # workalendar/i18n.py | |
| import gettext | |
| import collections | |
| _ = lambda x: x | |
| def get_translation_for_language(language: str) -> gettext.Translations: |
| #!/usr/bin/env python3 | |
| import base64 | |
| from cryptography.hazmat.primitives import serialization | |
| from cryptography.hazmat.backends import default_backend | |
| from cryptography.hazmat.primitives.hashes import SHA256 | |
| from cryptography.hazmat.primitives.asymmetric.ec import ECDSA | |
| def check_signature(payload, public_key, signature): |
| POST /your/token/endpoint HTTP/1.1 | |
| Host: yourhost.com | |
| User-Agent: curl/7.54.0 | |
| Accept: */* | |
| Content-Type: application/json | |
| GITHUB-PUBLIC-KEY-IDENTIFIER: 90a421169f0a406205f1563a953312f0be898d3c7b6c06b681aa86a874555f4a | |
| GITHUB-PUBLIC-KEY-SIGNATURE: MEQCIAfgjgz6Ou/3DXMYZBervz1TKCHFsvwMcbuJhNZse622AiAG86/cku2XdcmFWNHl2WSJi2fkE8t+auvB24eURaOd2A== | |
| [{"type":"github_oauth_token","token":"cb4985f91f740272c0234202299f43808034d7f5","url":" https://github.com/github/faketestrepo/blob/b0dd59c0b500650cacd4551ca5989a6194001b10/production.env"}] |