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 "$@" |
#!/bin/bash -eux | |
yesterday=$(date -d yesterday +%s) | |
# dnsdock should not be stopped : we limit to the containers created after it | |
docker ps --filter since=dnsdock -q --format "{{.ID}} {{.CreatedAt}}" | while read line | |
do | |
# line looks like: | |
# 123456789abcdef 2017-01-01 00:00:00 +02:00 CEST | |
set $line | |
id=$1 |
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"}] |
#!/usr/bin/env python3 | |
import pathlib | |
import re | |
import subprocess | |
import sys | |
import threading | |
import traceback | |
"Yay" if __import__("hashlib").md5((next((n & g).pop() for g, n in | |
( | |
(g, set(dr["Owner"] for dr in v if all(el in t.lower().split() for el in | |
[ | |
dr["Color"].lower(), dr["Make"].lower(), | |
dr["Height"].split("'")[0] + "'", | |
]) and | |
dr["License Plate"].startswith(__import__("re") | |
.search(r'starts with "([A-Z0-9]+)"', t).group(1)) and | |
dr["License Plate"].endswith(__import__("re") |
{"schemaVersion":1, "label":"ARM wheel", "message":"1.2.3", "color":"green"} |
# workalendar/i18n.py | |
import gettext | |
import collections | |
_ = lambda x: x | |
def get_translation_for_language(language: str) -> gettext.Translations: |
import contextlib | |
import functools | |
from typing import Awaitable, Callable, Coroutine, Dict, Type | |
ExceptionMapping = Dict[Type[Exception], Type[Exception]] | |
CoroutineFunction = Callable[..., Awaitable] | |
@contextlib.contextmanager |