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 | |
# vim: set ai et ts=4 sts=4 sw=4 syntax=bash: | |
# -*- coding: utf-8 -*- | |
export DEBUG=no | |
export REMOVE_AFTER_DELINK=no | |
export SOURCE= | |
set -euo pipefail |
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 | |
docker run -it --rm \ | |
--privileged \ | |
--net=host \ | |
-v "$PWD":"/workdir/$PWD" \ | |
-v /var/run/docker.sock:/var/run/docker.sock \ | |
--workdir="/workdir/$PWD" \ | |
docker/compose:latest \ | |
docker-compose $* |
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 | |
# -*- coding: utf-8 -*- | |
# vim: set ai et ts=4 sts=4 sw=4: | |
import apt | |
import argparse | |
import os | |
import pathlib | |
import shutil | |
import sys |
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 | |
CONNECT_TIMEOUT=${HTTP_CONNECT_TIMEOUT:-1} | |
HTTP_ADDR=${FILEBEAT_HTTP_ADDR:-http://localhost:5066/} | |
REPORT_TIME=$(($WATCHDOG_USEC / 2000000)) | |
SD_NOTIFY=${SD_NOTIFY_PATH:-/bin/systemd-notify} | |
set -euo pipefail | |
function watchdog() { |
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 zsh | |
# -*- coding: utf-8 -*- | |
# vim: set ai et ts=4 sts=4 sw=4 syntax=zsh: | |
set -o pipefail | |
function __ensure_envdir() { | |
[[ ! -d "${HOME}/.envmgr.d/" ]] && mkdir -p "${HOME}/.envmgr.d/" | |
return 0 | |
} |
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
# -*- coding: utf-8 -*- | |
import functools | |
import operator | |
from typing import Optional | |
ANY = object() | |
class regex: |
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
@respond_to(regex=r"^scale\s+(?P<params>.*)", flags=re.I) | |
@abac.allow_access("nomad.scale", defer=True) | |
async def scale(self, msg: Message, authz: abac.Authorizer, params: str): | |
params: dict = kvinline.parse(params) | |
service_name: Optional[str] = None | |
regions: Optional[str] = None | |
scale_groups: Mapping[str, int] = {} | |
for key, value in params.items(): |
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 typing | |
from functools import partial | |
from typing import Optional, Tuple, Type, Union | |
K = typing.TypeVar("K") | |
V = typing.TypeVar("V") | |
class TypedDict(typing.Dict[K, V]): | |
pass |
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 | |
# -*- coding: utf-8 -*- | |
import asyncio | |
import json | |
import os | |
import re | |
import shutil | |
import sys | |
from datetime import datetime |
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
# -*- coding: utf-8 -*- | |
import inspect | |
def get_caller(): | |
""" Inspects the call stack to determine the path of a caller. | |
Returns a string representing the full path to the caller. | |
""" |