This file contains 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 | |
set -euo pipefail | |
CUSTOM_COMPILE_COMMAND="$0" | |
COMPILE_COMMAND='uv pip compile' | |
COMPILE_OPTIONS="--strip-extras --generate-hashes --universal --custom-compile-command '${CUSTOM_COMPILE_COMMAND}'" | |
find_this () { |
This file contains 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
set-aws-secrets() { | |
local profile_name="${1:?"must provide profile name"}" | |
local creds | |
creds=$(aws configure export-credentials --profile "${profile_name}") | |
rc=$? | |
if [ "${rc}" -eq 255 ]; then | |
# using sso and not logged in | |
local sso_session="$(aws configure get sso_session --profile "${profile_name}")" |
This file contains 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 | |
# | |
# Released under the MIT license at | |
# https://gist.github.com/jkeifer/f75c65213c6a327229cf85ffa47e1efe | |
# | |
# Copyright 2023 Jarrett Keifer <jkeifer0@gmail.com> | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the “Software”), to deal | |
# in the Software without restriction, including without limitation the rights |
This file contains 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 | |
# | |
# gfsib: [g]it-[f]ormat-[s]taged, implemented [i]n [b]ash | |
# | |
# This script is _heavily_ inspired by `git-format-staged` by | |
# Jesse Hallett <jesse@sitr.us>. | |
# | |
# This implementation is © Jarrett Keifer <jkeifer0@gmail.com>. | |
# Distributed under the MIT License at | |
# https://gist.github.com/jkeifer/3cb226efcd4a4654a3461732a3f29ab8 |
This file contains 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 | |
# | |
# Released under the MIT license at | |
# https://gist.github.com/jkeifer/62ab2ce30254923f2ecf791f61871490 | |
# | |
# Copyright 2021 - 2023 Jarrett Keifer <jkeifer0@gmail.com> | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the “Software”), to deal | |
# in the Software without restriction, including without limitation the rights |
This file contains 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/sh -eu | |
usage() { | |
cat <<EOF | |
$0 - utility to manage network namespaces through arbitrary files | |
Supported commands: | |
add FILE |
This file contains 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 | |
# Call like `./traps.bash 0` and you should see: | |
# outside | |
# level 1 | |
# level 2 | |
# level 2 trap | |
# This won't run on error | |
# level 1 trap | |
# Nor with this on error |
This file contains 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 __future__ import print_function | |
_id_seq = 1 | |
def id_seq(): | |
global _id_seq | |
num = _id_seq | |
_id_seq += 1 | |
return num |