Skip to content

Instantly share code, notes, and snippets.

View SiteRelEnby's full-sized avatar
🐺
feel like a c.e.o. I got that c.e.d.

Site Reliability Enby SiteRelEnby

🐺
feel like a c.e.o. I got that c.e.d.
View GitHub Profile
#! /usr/bin/env bash
[[ -z "${AGENT_TYPES}" ]] && AGENT_TYPES="[\"AI Assistant\", \"AI Data Scraper\", \"AI Search Crawler\", \"Undocumented AI Agent\"]"
usage(){
echo -e "Usage:\n
-t | DARKVISITORS_TOKEN= Site's access token
-d | DARKVISITORS_DISALLOW= A string specifying which URLs are disallowed. Defaults to / to disallow all URLs.
-a | AGENT_TYPES= An array of agent types. Agent types include AI Assistant, AI Data Scraper, AI Search Crawler, and Undocumented AI Agent. Defaults to ${AGENT_TYPES}
-c | CURL_ARGS= Args to pass to curl
#! /usr/bin/env bash
set -e -o pipefail
USE_DOCKER_FILTER_REPO=1
#[[ -z "${BRANCHES}" ]] && BRANCHES="anduril2 multi-channel"
[[ -z "${BRANCHES}" ]] && BRANCHES="multi-channel"
[[ -z "${LP_USER}" ]] && LP_USER="toykeeper"
# "auto": Delete commits that became empty due to filtering; preserve ones that were already empty. "always" / "never" = obvious
@SiteRelEnby
SiteRelEnby / gist:903436b3d21857a58de740ab9df7443a
Last active March 18, 2023 00:21
poweroff a docker buildx builder when it is idle (e.g. if it is a VM)
#! /usr/bin/env bash
[[ "${SLEEP_TIME}" == "" ]] && SLEEP_TIME=60
[[ "${SHUTDOWN_DELAY}" == "" ]] && SHUTDOWN_DELAY=1800
wait_for_builds(){
while (ps auxw | grep -E '[d]ocker +buildx +build') #[d] stops grep self-matching without wasting a process launch
do
echo "$(date --rfc-3339=seconds): builds are running" >&2
sleep ${SLEEP_TIME}